home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a087 / 5.ddi / IDLEREAD.PR_ / IDLEREAD.bin
Encoding:
Text File  |  1994-02-02  |  4.7 KB  |  218 lines

  1. *
  2. * Initialize variable, prepare for environment setup.
  3. *
  4. SET PROCEDURE TO utility
  5. ON ERROR DO errorhandler WITH MESSAGE(), LINENO()
  6. CLEAR PROGRAM
  7. CLEAR GETS
  8.  
  9. IF SET("TALK") = "ON"
  10.     SET TALK OFF
  11.     m.talkstat = "ON"
  12. ELSE
  13.     m.talkstat = "OFF"
  14. ENDIF
  15.  
  16. mdevice  = ""
  17. m.area   = 0
  18. m.exact  = ""
  19. m.safety = ""
  20. m.deci   = 0
  21. m.escap  = ""
  22. m.noti   = ""
  23. m.deli   = ""
  24. m.memow  = 0
  25. m.oldhelp = SET("HELP",1)
  26. m.helpset = SET("HELP")
  27. m.resoset = SET("RESOURCE")
  28. m.oldreso = SET("RESOURCE",1)
  29.  
  30. IF TYPE("m.hidecomm") = "U"
  31.     m.hidecomm = WVISIBLE("command")
  32. ENDIF
  33.  
  34. m.macrosave = "savmacro.fky"
  35. m.idlequit = .F.
  36. m.module   = LOWER(stripext(strippath(SYS(16))))
  37. m.tobedone = m.module + ".spr"
  38.  
  39.  
  40. IF rdlevel() = 0
  41.     oldtitle = wtitle('screen')
  42.     oldfont = wfont(1,oldtitle)
  43.     oldsize = wfont(2,oldtitle)
  44.     oldstyle = wfont(3,oldtitle)
  45.     modify window screen font "MS Sans Serif",8
  46.     clear
  47.     fromrow = wlrow()
  48.     fromcol = wlcol()
  49.     torow = wrows()
  50.     tocol = wcols()
  51.  
  52.     if wrows() <  32.538
  53.         modify window screen at 0,0 size 32.538,wcols()
  54.     endif
  55.     if wcols() < 120
  56.         modify window screen at 0,0 size wrows(),120
  57.     endif
  58.     MOVE WINDOW SCREEN CENTER
  59.  
  60.     SET TALK OFF
  61.     progpath = SYS(16)
  62.     npath = SUBSTR(progpath,1,RAT('\',progpath)-1)
  63.  
  64.     conv1 = '"' + npath + "\convert.app" + '"'
  65.     rest1 = '"' + npath + "\restaurs.app" + '"'
  66.     clie1 = '"' + npath + "\clients.app" + '"'
  67.     fami1 = '"' + npath + "\family.app" + '"'
  68.     cred1 = '"' + npath + "\credit.app" + '"'
  69.     cred1 = '"' + npath + "\credit.app" + '"'
  70.     accn1 = '"' + npath + "\accnts.app" + '"'
  71.     tran1 = '"' + npath + "\trans.app" + '"'
  72.  
  73.     opath = SET("PATH")
  74.     rootpath = npath
  75.     npath = npath + "\REPORTS"
  76.     IF AT(npath+";",opath)=0 AND ;
  77.         RAT(rootpath,opath)+LEN(npath)-1-LEN(opath)<>0
  78.         opath =    npath + IIF(EMPTY(opath),"",";") + opath
  79.     ENDIF
  80.     npath =    rootpath + "\DBFS"
  81.     IF AT(npath+";",opath)=0 AND ;
  82.         RAT(rootpath,opath)+LEN(npath)-1-LEN(opath)<>0
  83.         opath =    npath + IIF(EMPTY(opath),"",";") + opath
  84.     ENDIF
  85.     IF AT(rootpath+";",opath)=0 AND ;
  86.         RAT(rootpath,opath)+LEN(rootpath)-1-LEN(opath)<>0
  87.         opath =    rootpath + IIF(EMPTY(opath),"",";") + opath
  88.     ENDIF
  89.     SET PATH TO &opath
  90.     m.moldhelp = SET("HELP",1)
  91.     m.mhelpset = SET("HELP")
  92.     SET HELP TO "orghelp.dbf"
  93.     SET HELP ON
  94. ENDIF
  95.  
  96. DO setup
  97.  
  98. PUSH MENU _msysmenu
  99. RELEASE POPUPS organizer, moneymanag
  100.  
  101. DO mainmenu.mpr
  102.  
  103. *
  104. * Launch the GET-LESS READ.
  105. *
  106. READ WHEN dofirstapp() ;
  107.     VALID idleloop()
  108.  
  109. *
  110. * Cleanup and reset the environment.
  111. *
  112.  
  113. POP MENU _msysmenu
  114. *CLEAR WINDOW ALL
  115.  
  116. DO cleanup
  117. DO closdbfs
  118. SET COLOR OF SCHEME 1 TO
  119. IF RDLEVEL() = 0
  120.     SET PROCEDURE TO
  121.     IF NOT EMPTY(m.moldhelp)
  122.         RELEASE WINDOW 'HELP'
  123.         SET HELP TO LOCFILE(m.moldhelp, "DBF", "Where is "+m.moldhelp+" help file?")
  124.         IF m.mhelpset = "ON"
  125.             SET HELP ON
  126.         ELSE
  127.             SET HELP OFF
  128.         ENDIF
  129.     ELSE
  130.         SET HELP OFF
  131.     ENDIF
  132.     modify window screen at fromrow,fromcol size torow,tocol
  133.     modify window screen font oldfont,oldsize style oldstyle
  134.  
  135.     ?sys(2017)
  136. ENDIF
  137.  
  138. *!*********************************************************************
  139. *!
  140. *!       Function: DOFIRSTAPP()
  141. *!
  142. *!      Called by: IDLEREAD.PRG                  
  143. *!
  144. *!*********************************************************************
  145. *
  146. * DOFIRSTAPP - Trigger the first application by forcing the FOUNDATION
  147. *                READ to evaluate its VALID clause.
  148. *
  149. FUNCTION dofirstapp
  150. CLEAR READ
  151.  
  152. *!*********************************************************************
  153. *!
  154. *!       Function: IDLELOOP()
  155. *!
  156. *!      Called by: IDLEREAD.PRG                  
  157. *!
  158. *!*********************************************************************
  159. *
  160. * IDLELOOP - Processing in the idle loop.
  161. *
  162. FUNCTION idleloop
  163. PRIVATE m.temp, m.ontop
  164.  
  165. IF m.idlequit
  166.     RETURN .T.
  167. ENDIF
  168.  
  169. IF LEN(m.tobedone) > 0
  170.     m.temp = m.tobedone
  171.     m.tobedone = ""
  172.     DO (m.temp)
  173.     RETURN .F.
  174. ENDIF
  175.  
  176. m.ontop = LOWER(WONTOP())
  177.  
  178. DO CASE
  179. CASE m.ontop = "convert"
  180.     DO (m.ontop+".app")
  181. CASE m.ontop = "family" OR m.ontop = "restaurs" OR ;
  182.         m.ontop = "credit" OR m.ontop = "accnts" OR ;
  183.         m.ontop = "trans"
  184.     SHOW WINDOW controls TOP
  185.     IF m.ontop = "accnts"
  186.         SHOW WINDOW 'Details' TOP
  187.     ENDIF
  188.     DO (m.ontop+".spr")
  189. CASE m.ontop = "details" OR m.ontop = "details.service"
  190.     m.temp = "accnts.spr"
  191.     SHOW WINDOW "Details" TOP
  192.     SHOW WINDOW controls TOP
  193.     DO (m.temp)
  194. CASE m.ontop = "controls"
  195.     m.temp = ""
  196.     DO CASE
  197.     CASE WVISIBLE("family")
  198.         m.temp = "family.spr"
  199.     CASE WVISIBLE("restaurs")
  200.         m.temp = "restaurs.spr"
  201.     CASE WVISIBLE("credit")
  202.         m.temp = "credit.spr"
  203.     CASE WVISIBLE("trans")
  204.         m.temp = "trans.spr"
  205.     CASE WVISIBLE("accnts")
  206.         m.temp = "accnts.spr"
  207.         SHOW WINDOW "Details" TOP
  208.     ENDCASE
  209.     IF NOT EMPTY(m.temp)
  210.         SHOW WINDOW controls TOP
  211.         DO (m.temp)
  212.     ENDIF
  213. ENDCASE
  214.  
  215. RETURN .F.
  216.  
  217. *: EOF: IDLEREAD.PRG
  218.