home *** CD-ROM | disk | FTP | other *** search
- <<* Genfrm.inc *>>
- <<#pragma
-
- function AtrCode( atr : integer ) : string
- string hilite,blink,hues,atrstrg
- integer hinib,lonib
- begin
- hues := 'N ,BU,G ,BG,R ,BR,GR,W '
- if (atr and 8) = 8
- hilite := '+'
- endif
- if (atr and 128) = 128
- blink := '*'
- endif
- lonib := (atr and 7)
- hinib := ((atr shr 4) and 7)
- atrstrg := rtrim( substr( hues,(lonib * 3) + 1,2 ) ) + blink + hilite + '/'
- atrstrg := atrstrg + rtrim( substr( hues,(hinib * 3) + 1,2 ) )
- RETURN atrstrg
- end <<*AtrCode*>>
-
-
- procedure DisplayFormat
- string box, hcolor
- begin
- forall fldlab
- if fldtyp = 'B' <<*BOX Type*>>
- box := fldlab <<*Used to swap chars for Character box*>>
- gen( ' @ ',fldrow,',',fldcol,',' )
- gen( fldrow+flddec,',',fldcol+fldwid,' BOX "' )
- gen( substr(box,1,3),box[5],box[8],box[7],box[6],box[4],'"' )
- else <<*All Fields and Text Objects*>>
- gen( ' @ ',fldrow,',',fldcol,' SAY "',fldlab,'"' )
- hcolor := atrcode(fldhue)
- <<* if substr(upper(screencolor),1,at(',',screencolor)) <> upper(hcolor) *>>
- gen(' COLOR ',hcolor)
- <<* endif *>>
- endif
- genln <<*Send CR/LF*>>
- endfor
- end <<*DisplayFormat*>>
-
-
- procedure GenPicture
- string picstrg
- begin
- if fldpic
- gen( ' PICTURE "',fldpic,'"' )
- elsif fldtyp = 'N' <<*Force numeric picture*>>
- picstrg := replicate( '9',fldwid )
- if flddec
- picstrg[ fldwid-flddec ] := '.'
- endif
- gen( ' PICTURE "',picstrg,'"' )
- endif
- end <<*GenPicture*>>
-
-
- procedure DisplayRecord
- string var3 , hcolor
- integer tcount
- begin
- tcount:=64
- <<*---Only Char, Date, Logical, & Numeric fields---*>>
- forall fldget and (fldtyp $ 'CDLN')
- if fldhor <<*field on the side of label*>>
- gen( ' @ ',fldrow,',',fldcol + len(fldlab),' GET ',fldals+'->'+fldnam )
- else <<*field below label*>>
- gen( ' @ ',fldrow + 1,',',fldcol,' GET ',fldals+'->'+fldnam )
- endif
- GenPicture
- hcolor := rtrim(atrcode(fldatr))
- <<* if substr(upper(screencolor),at(',',screencolor)+1,len(rtrim(screencolor))-at(',',screencolor)) <> upper(hcolor) *>>
- gen(' COLOR ,',hcolor)
- <<* endif *>>
- genln <<*Send CR/LF*>>
- endfor
- end <<*DisplayRecord*>>
-
- function DefaultVal : string
- begin
- if fldtyp = 'C'
- RETURN 'SPACE( ' + str( fldwid ) + ' )'
- elsif fldtyp = 'N'
- RETURN '0.00'
- elsif fldtyp = 'D'
- RETURN 'DATE()'
- else
- RETURN '.F.'
- endif
- end <<*DefaultVal*>>
-
- <<* SIMUTIL.INC *>>
- #>>