home *** CD-ROM | disk | FTP | other *** search
- <<* FMTDRIV.INC *>>
-
- <<procedure GenDriverPrg( fspec : string )>>
- <<begin>>
- SET TALK OFF
- SET BELL OFF
- SET STATUS OFF
- SET SCOREBOARD OFF
- * ---Open PROCEDURE file.
- SET PROCEDURE TO {fileprefix}_PROC
- * ---OPEN database file.
- SELECT A
- <<filespec( dbfnam,fpath,fname,fext )>>
- USE {fname}
- <<if ndxnam>>
- <<filespec( ndxnam,fpath,fname,fext )>>
- SET INDEX TO {fname}
- <<endif>>
- * ---Initialize memory variables.
- PRIVATE;
- ScreenAtr,StatusAtr,WindowAtr,PromptAtr,HiliteAtr,;
- pageno,PageMax,isedited,IsBlank,IsUnique,;
- choice,expr,Returnkey,PromptRow,PromptBar
- STORE .F. TO;
- ScreenAtr,StatusAtr,WindowAtr,PromptAtr,HiliteAtr,;
- pageno,PageMax,isedited,IsBlank,IsUnique,;
- choice,expr,Returnkey,PromptRow,PromptBar
- <<if ismultipage>>
- STORE 1 TO pageno
- STORE {pagtotal} TO PageMax
- <<endif>>
- STORE .F. TO isedited,IsBlank,IsUnique
- STORE " " TO choice,expr,Returnkey
- PromptRow = 23
- PromptBar = REPLICATE( CHR(196),80 )
- * ---SET COLOR TO values.
- ScreenAtr = {"}{ScreenColor}"
- StatusAtr = {"}{StatusColor}"
- WindowAtr = {"}{WindowColor}"
- PromptAtr = {"}{PromptColor}"
- HiliteAtr = {"}{HiliteColor}"
- <<#
- select all fields
- select fields on (fldtyp $ 'CDLN') and (fldals <> 'M') and fldget
- genln( '* ---Declare field memory variables.' )
- GenFldList( 'PRIVATE;' )
- GenFldList( 'STORE .F. TO;' )
- #>>
- * ---Process one record.
- * ---In this example, we process the TOP record.
- * ---(Assuming there is at least one record in the file!)
- GOTO TOP
- * ---Initialize memvars and display record.
- DO {fileprefix}_STOR
- DO {fileprefix}_FORM
- DO {fileprefix}_SAYS
- * ---Process record loop.
- DO WHILE .T.
- STORE "*" TO choice
- DO WHILE .NOT. (choice $ "EN"+Returnkey)
- choice = " "
- SET COLOR TO {PromptColor}
- <<if ismultipage>>
- @ 23,0 SAY "COMMAND: {E}dit {N}ext-page {Return}";
- <<else>>
- @ 23,0 SAY "COMMAND: {E}dit {Return}";
- <<endif>>
- GET choice PICTURE "!"
- READ
- ENDDO
- @ 23,0 CLEAR
- DO CASE
- CASE choice = Returnkey
- EXIT
- <<if ismultipage>>
- CASE choice = "N"
- STORE pageno + 1 TO pageno
- IF pageno > PageMax
- * ---Circular paging.
- STORE 1 TO pageno
- ENDIF
- DO {fileprefix}_FORM
- DO {fileprefix}_SAYS
- <<endif>>
- CASE choice = "E"
- isedited = .T.
- DO {fileprefix}_KEYS WITH expr,IsBlank,IsUnique
- DO {fileprefix}_GETS
- ENDCASE
- ENDDO
- IF isedited
- DO {fileprefix}_REPL
- ENDIF
- * ---Closing operations.
- SET COLOR TO {WindowColor}
- CLOSE DATABASE
- SET SCOREBOARD ON
- SET STATUS ON
- SET BELL ON
- SET TALK ON
- <<end>> <<*GenDriverPrg*>>
-
- <<* EOF: FMTDRIV.INC *>>