home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / clipper / code_1.arc / TEM_MAIN.PRG < prev    next >
Text File  |  1988-12-15  |  8KB  |  171 lines

  1. * ________.PRG
  2. * ________________ SYSTEM MAIN MENU module written by:  ____________
  3. *     created: __/__/__
  4. * last update: __/__/__
  5. *
  6. **********************************************************************
  7. * NOTE:  This system utilizes functions from a number of libraries:  *
  8. *                                                                    *
  9. *              CLIPPER  -  Clipper Summer '87 Main Library           *
  10. *              EXTEND   -  Clipper Summer '87 Extended Library       *
  11. *                                                                    *
  12. *        If multi-user or single-user security requirements includ-  *
  13. *        log on/off information, include the following libraries:    *
  14. *                                                                    *
  15. *              NL187    -  Communication Horizon's Network Library   *
  16. *              NLEXT87     for CLIPPER SUMMER '87                    *
  17. *                                                                    *
  18. * If the multi-user or security options are not required, strip out  *
  19. * the appropriate code lines from this program and the ___INIT.PRG   *
  20. * modules.                                                           *
  21. *                                                                    *
  22. *                                                                    *
  23. * The appropriate libraries and/or functions must be present during  *
  24. * the LINKing process or an "UNDEFINED SYMBOL" error will occur.     *
  25. *                                                                    *
  26. * Further note that this application is written in the CLIPPER       *
  27. * complier SUMMER '87 version and as such must have that version of  *
  28. * the above named libraries linked for proper operation.             *
  29. *                                                                    *
  30. **********************************************************************
  31. *                                                                    *
  32. **********************************************************************
  33. * UDFs:                                                              *
  34. *                                                                    *
  35. * Custom written UDFs are in the TEM_UDFS.PRG program file.  These   *
  36. * functions can be implemented in a couple of ways:                  *
  37. *                                                                    *
  38. * -  Functions that are to be used in the target application can be  *
  39. *    inserted into the bottom of this file individually.  This saves *
  40. *    space because only the required functions are used.  The draw-  *
  41. *    back is some UDFs call other UDFs which means thorough testing  *
  42. *    must be done to prevent "UNDEFINED SYMBOL" errors.              *
  43. * -  The TEM_UDFS.PRG file can be compiled and linked into the tar-  *
  44. *    get application as a whole.  The drawback here is more space    *
  45. *    will be allocated for the .EXE and/or .OVL file(s).             *
  46. *                                                                    *
  47. * Choose either option but be aware of the consequences of each.     *
  48. **********************************************************************
  49. *                                                                    *
  50. **********************************************************************
  51. * About Color:                                                       *
  52. *                                                                    *
  53. * The system color assignments are set below and in the ___INIT.PRG  *
  54. * file using the sys_color, c_scrl_box,c_goto_box,c_scrl_con, and    *
  55. * c_scrl_bar memory variables.                                       *
  56. **********************************************************************
  57. *
  58. ***************************************
  59. * Establish the operating environment *
  60. ***************************************
  61. CLEAR ALL
  62. CLOSE ALL
  63. SET BELL       OFF
  64. SET CONFIRM    ON
  65. SET CURSOR     OFF
  66. SET DELETED    ON
  67. SET DELIMITER  OFF
  68. SET ECHO       OFF
  69. SET EXACT      OFF
  70. SET EXCLUSIVE  ON
  71. SET INTENSITY  ON
  72. SET MESSAGE TO 2
  73. SET SAFETY     OFF
  74. SET SCOREBOARD OFF
  75. SET TALK       OFF
  76. SET WRAP       ON
  77. *
  78. *******************************************************
  79. * Include the following statement if system requires  *
  80. * multi-user capabilities or single-user security is  *
  81. * to be included.                                     *
  82. *******************************************************   
  83. *  N_READY()               && UDF from NETLIB. Readies application for Network use
  84. *
  85. **************************************
  86. * Establish System Control Variables *
  87. **************************************
  88. PUBLIC sys_color,sys_prn,sys_srv,menu_opt,user_name,user_level
  89. PUBLIC c_scrl_box,c_goto_box,c_scrl_con,c_scrl_bar
  90. PUBLIC CLIPPER,FOXBASE,is_found,key_pos,recnum,ALTERED,VER21,ok_to_srch,USE_DBF   && Required by dBDSCRL 5.5
  91. *
  92. STORE "" TO sys_comm,sys_user,sys_color,sys_prn,sys_srv
  93. STORE "" TO c_scrl_box,c_goto_box,c_scrl_con,c_scrl_bar
  94. STORE "" TO user_name,user_level,sys_dkey     
  95. *
  96. DO ____INIT               && Variable initialization, opening screen display
  97. *
  98. DO WHILE .T.
  99.    menu_opt=1
  100.    CLEAR
  101.    @ 03,00 SAY REPLICATE(CHR(196),79)               && Single Top Border Line
  102.    @ 23,00 SAY REPLICATE(CHR(196),79)               && Block Bottom Border Line
  103.    @ 24,00 SAY sys_comm
  104.    @ 01,00      PROMPT "_____"     MESSAGE "________________________"
  105.    @ 01,COL()+2 PROMPT "_____"     MESSAGE "________________________"
  106.    @ 01,COL()+2 PROMPT "_____"     MESSAGE "________________________"
  107.    @ 01,COL()+2 PROMPT "Utilities" MESSAGE "Archiving Data, Printing, Reindexing, Security Options"
  108.    @ 24,00 SAY sys_comm
  109.    MENU TO menu_opt
  110.    DO CASE
  111.       CASE menu_opt=0
  112.          @ 01,00
  113.          @ 02,00
  114.          @ 01,00      PROMPT "NO " MESSAGE "Do Not Exit System"
  115.          @ 01,COL()+2 PROMPT "YES" MESSAGE "Exit System"
  116.          menu_opt=1
  117.          MENU TO menu_opt
  118.          IF menu_opt=2
  119.             EXIT
  120.          ENDIF
  121.          *
  122.       CASE menu_opt=1
  123.          DO ________  
  124.          *
  125.       CASE menu_opt=2
  126.          DO ________  
  127.          *
  128.       CASE menu_opt=3
  129.          DO ________  
  130.          *
  131.       CASE menu_opt=4
  132.          DO ____UTIL
  133.          *
  134.    ENDCASE
  135.    *
  136.    ***********************************************************
  137.    * Clear memory. As CLIPPER assigns memory to variables as *
  138.    * they are called, and those variables are released when  *
  139.    * RETURNing from the program that created them, "holes"   *
  140.    * or non-contiguous blocks memory are eventually formed.  *
  141.    * To refresh memory into contigous blocks, the following  *
  142.    * routine has been implemented.  This is a routine sug-   *
  143.    * gested by that ol' CLIPPER guru Stephen Straley and it  *
  144.    * works just fine.                                        *
  145.    *                         Gary L. Cota November 12, 1988  *
  146.    ***********************************************************
  147.    SAVE TO TEMPFILE
  148.    CLEAR ALL
  149.    RESTORE FROM TEMPFILE
  150.    ERASE TEMPFILE.MEM
  151.    *
  152. ENDDO
  153. USE ____WTFO
  154. LOCATE FOR c_ENCRYPT(user_name,sys_dkey)=F08
  155. REPLACE F03 WITH DATE(),F02 WITH TIME(),F01 WITH .T.
  156. CLEAR
  157. @ 02,01      SAY TRIM(user_name)+" logged out from the system"
  158. @ ROW()+1,01 SAY "Login  Time:  "+DTOC(F05)+"  "+F04
  159. @ ROW()+1,01 SAY "Logout Time:  "+DTOC(F03)+"  "+F02
  160. CLOSE DATABASES
  161. SET CURSOR ON
  162. @ 22,0
  163. QUIT
  164. *
  165. *
  166. ****************************
  167. * UDFs to be inserted here *
  168. ****************************
  169. *
  170. *
  171.