home *** CD-ROM | disk | FTP | other *** search
- .XLIST
- ;;
- ;; ***********************************************
- ;; * Field Macros for use with SDA *
- ;; ***********************************************
- ;;
- ;; These macros are for use with the Screen Design Aid, and permit
- ;; field manipulation. Basically the user may:
- ;;
- ;; - Input to a field (optionally cleared before input)
- ;; - Output to a field
- ;; - Output followed by input to a field
- ;; - Clear a field
- ;; - Position the cursor to a field (start)
- ;;
- ;; Under output conditions, the cursor is always left one character beyond
- ;; the end of the field. If the string supplied for output to the field
- ;; is shorter than the field, then the field is cleared to the
- ;; end. If the string is longer, output stops at the end of the
- ;; defined field. The string is bounded by a "nul" byte at the end.
- ;;
- ;; When a field is "cleared" (any case), the field is set to the
- ;; attribute contained in the field definition table.
- ;;
- ;; (This is an "internal" macro and should not be directly invoked)
- ;;
- $FDDEF MACRO
- IFNDEF $SDA
- EXTRN $SDA:NEAR
- ENDIF
- ENDM
- ;;
- ;; Output to a field - P1 is field number
- ;; - P2 is output string (terminated by a nul)
- ;;
- $FDOUT MACRO P1,P2
- $FDDEF
- IFNB <P1>
- MOV AX,P1+100H
- ELSE
- MOV AH,1
- ENDIF
- IFNB <P2>
- MOV DX,OFFSET P2
- ENDIF
- CALL $SDA
- ENDM
- ;;
- ;; Input from a field - P1 = Field number
- ;; - P2 = String buffer
- ;; - P3 = Don't clear flag (Optional)
- ;;
- ;; On entry, SI should point to the start of a string buffer. This
- ;; buffer must be as long as the input field plus one. On return
- ;; the last byte (not included in the length) will be a nul, and
- ;; the length will be contained in the AL register (0 is valid).
- ;; AH will contain a code: 0 - CR at end, 1 - Tab right, 2 - tab
- ;; left, 4 - escape, 8 - a "scan code" is returned. The carry is
- ;; set for all cases other than "CR" (normal). If a scan code is
- ;; returned, it will be a one byte field, with the 80H bit turned
- ;; on, and is the value returned by DOS, without the leading nul.
- ;;
- $FDINP MACRO P1,P2,P3
- $FDDEF
- IFNB <P3>
- $SDAEQU = 80H
- ELSE
- $SDAEQU = 0
- ENDIF
- IFNB <P1>
- MOV AX,P1+200H+$SDAEQU
- ELSE
- MOV AH,2
- OR AL,$SDAEQU
- ENDIF
- IFNB <P2>
- MOV SI,OFFSET P2
- ENDIF
- CALL $SDA
- ENDM
- ;;
- ;; Output to, and then input from the same field. In this case, no
- ;; option for clear before input is permitted. P1 = field number,
- ;; and P2 is the label of the string to be output. P3 is the label
- ;; of an input buffer for the returned string. See $FDOUT and
- ;; $FDINP for details of functioning.
- ;;
- $FDOIN MACRO P1,P2,P3
- $FDDEF
- IFNB <P1>
- MOV AX,300H+P1
- ENDIF
- IFNB <P2>
- MOV DX,OFFSET P2
- ENDIF
- IFNB <P3>
- MOV SI,OFFSET P3
- ENDIF
- OR AL,80H
- CALL $SDA
- ENDM
- ;;
- ;; Clear the specified field the the attribute in the field table.
- ;; Cursor is left at the start of the field. P1=field number
- ;;
- $FDCLR MACRO P1
- $FDDEF
- IFNB <P1>
- MOV AX,400H+P1
- ELSE
- MOV AH,4
- ENDIF
- CALL $SDA
- ENDM
- ;;
- ;; Position cursor to the start of the specified field. P1=field number
- ;;
- $FDPOS MACRO P1
- $FDDEF
- IFNB <P1>
- MOV AX,500H+P1
- ELSE
- MOV AH,5
- ENDIF
- CALL $SDA
- ENDM
- ;;
- ;; Display Primary Menu - P1, if specified is label of compressed
- ;; image, else offset to start of image
- ;; should be in DX.
- ;;
- $FDISP MACRO P1
- $FDDEF
- IFNB <P1>
- MOV DX,OFFSET P1
- ENDIF
- XOR AH,AH
- CALL $SDA
- ENDM
- ;;
- .LIST
- .SALL