home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a070 / 3.ddi / FOXPRO / TEMPLGEN / SIMPROC.INC < prev    next >
Encoding:
Text File  |  1988-02-11  |  1.7 KB  |  85 lines

  1. <<* SIMPROC.INC *>>
  2.  
  3. <<procedure ProcedureBody>>
  4. <<string prgname,fpath,fname,fext>>
  5. <<begin>>
  6. <<filespec( program,fpath,fname,fext )>>
  7. <<prgname := fname + '.' + fext>>
  8. * Program.: {prgname}
  9. * Author..: {Author}
  10. * Date....: {date}
  11. * Notice..: Copyright (c) 1987, {Copyright}, All Rights Reserved
  12. * Notes...: Procedures for simple database application.
  13. *
  14.  
  15. PROCEDURE DispForm
  16.    CLEAR
  17.    SET COLOR TO {StatusColor}
  18.    @ 0, 0 SAY SPACE(80)
  19.    @ 0,72 SAY DATE()
  20.    SET COLOR TO {WindowColor}
  21.    <<DisplayFormat>>
  22. RETURN
  23.  
  24.  
  25. PROCEDURE DispRec
  26.    SET COLOR TO {StatusColor}
  27.    @ 0, 0 SAY "Record: "+SUBSTR(STR(RECNO()+1000000,7),2)
  28.    IF DELETED()
  29.       @ 0,50 SAY "*DELETED*"
  30.    ELSE
  31.       @ 0,50 SAY "         "
  32.    ENDIF
  33.    SET COLOR TO {WindowColor}
  34.    <<DisplayRecord>>
  35.    CLEAR GETS
  36. RETURN
  37.  
  38.  
  39. PROCEDURE EditRec
  40.   <<EditRecord( false )>>
  41.    READ
  42. RETURN
  43.  
  44.  
  45. PROCEDURE BlankRec
  46.   <<BlankRecord>>
  47. RETURN
  48.  
  49.  
  50. PROCEDURE ReplRec
  51.   <<forall fldget and (fldtyp $ 'CDLN')>>
  52.    REPLACE {fldnam} WITH m{fldnam}
  53.   <<endfor>>
  54. RETURN
  55.  
  56.  
  57. PROCEDURE AddRec
  58.    * ---Initialize memvars.
  59.    DO BlankRec
  60.    @ 24,0
  61.    @ 24,0 SAY "Press {Ctrl-W} to Exit"
  62.    * ---Read into memvars.
  63.    SET COLOR TO {WindowColor}
  64.    <<EditRecord( true )>>
  65.    READ
  66.    * ---Confirm that user wants to append this record.
  67.    choice = " "
  68.    SET COLOR TO {PromptColor}
  69.    @ 24,0
  70.    @ 24,0 SAY "SELECT:  {A}ccept  {I}gnore";
  71.           GET choice PICTURE "!" VALID( choice $ "AI" )
  72.    READ
  73.    IF choice = "A"
  74.       * ---Add the new record.
  75.       APPEND BLANK
  76.       * ---Replace from memvars.
  77.       DO ReplRec
  78.    ENDIF
  79. RETURN
  80.  
  81. * EOF: {prgname}
  82. <<end>> <<*ProcedureBody*>>
  83.  
  84. <<* SIMPROC.INC *>>
  85.