home *** CD-ROM | disk | FTP | other *** search
- /*Useofformroutines:
-
- CallCRT_FormStarttoclearoutanyexistingformandinitialize.
-
- AddfieldstotheformwithCRT_FormIntandCRT_FormChars:
- line-screenlineforstartofprompt
- col-screencolumnforstartofprompt
- len-screenlengthforcharsorintvalue(max6forint)
- header-headertoleftofinputarea
- pChanged-pointertovariable,whichafterCRT_FormRead,will
- contain'true'ifthatfieldwaschanged
- ptr-pointertobufferholdingvalue
- check-routinetocalltochecknewvalues
-
- CallCRT_FormRead:
- header-multilineheadertocenterattopofscreen
- flags-byteofflags:
- FORMHEADERS-displayheadersonthiscall
- FORMSKIP-useautoskiponinputfields
- FORMINPUT-allowinput(otherwisejustdisplay)
- FORMOUTPUT-displayvalues(otherwiseassumetheyarethere)
- terminators-stringofcharactersallowedtoterminateinputof
- afield.Thefollowingshouldbepresenttoenabletheir
- functions,butwillneverbereturned:
- CONTROL-R-usedtoforceresetofafield
- CONTROL-Z-usedtoforceresetofallfields
- Thefollowingarenormallypresenttoenabletheirfunctions:
- CONTROL-Q-usedtodoaquickexit
- ESCAPE-usedtoresetallfieldsandexit
- Thecharacterreturnedisthecharacterfrom'terminators'thatthe
- usertypedwhichcausedanexit.Carriagereturn(CONTROL-M)isthe
- mostlikely,i.e.theuserfilledinallfieldsandfellofftheend.
- */
-
- char
- CONTROL_Q='\(0x11)',
- CONTROL_R='\(0x12)',
- CONTROL_Z='\(0x1a)',
- ESCAPE='\(0x1b)';
-
- *charTERMINATORS="\(CONTROL_Q)\(CONTROL_R)\(CONTROL_Z)\(ESCAPE)";
-
- extern
- _F_initialize()void,
- _F_terminate()void,
- CRT_FormIntOK(intn)bool,
- CRT_FormCharsOK(*charp)bool,
- CRT_FormStart()void,
- CRT_FormInt(ushortline,col,len;*charheader;
- *boolpChanged;*intptr;
- proc(intn)boolcheck)void,
- CRT_FormChars(ushortline,col,len;*charheader;
- *boolpChanged;*charptr;
- proc(*charp)boolcheck)void,
- CRT_FormRead(*charheader;byteflags;*charterminators)char;
-
- byte
- FORMHEADERS=0x01,
- FORMSKIP=0x02,
- FORMINPUT=0x04,
- FORMOUTPUT=0x08;
-