home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a114 / 1.img / SAMPAPP / SAMPAPP.ZIP / STOCKS.SC < prev    next >
Encoding:
Text File  |  1990-08-25  |  3.7 KB  |  87 lines

  1. ; Script:     STOCKS.SC
  2. ; Version:    3.5
  3. ; Date:       23 March 1990
  4. ;
  5. ; This is the main script for the STOCKS application. This script
  6. ; controls the Main menu for the application. Note that each Main
  7. ; menu item calls a single procedure when chosen. The source code
  8. ; for each procedure is stored in a script file with the name of
  9. ; the Main menu command that calls it. Before the application starts,
  10. ; all of the procedures are written to the PARADOX.LIB library, which
  11. ; is then assigned to Autolib to make it the autoload library for
  12. ; the application.
  13.  
  14. PROC DoActivity()
  15.   Private Y
  16.   CANVAS OFF
  17.   CLEARALL
  18.   CLEAR                                 ; Clear all tables on canvas and workspaces
  19.   PAINTCANVAS ATTRIBUTE 31 0, 0, 24, 79
  20.   STYLE ATTRIBUTE 30
  21.   @ 4, 0
  22.   TEXT
  23. ╔══════════════════════════════════════════════════════════════════════════════╗
  24. ║ ░░░░ STOCKS APPLICATION ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ MAIN MENU ░░░░░░░░░░░ ║
  25. ╟────────────────╥─────────────────────────────────────────────────────────────╢
  26. ║  Board         ║   The table of stocks shown with real-time updates.         ║
  27. ╠════════════════╬═════════════════════════════════════════════════════════════╣
  28. ║  Portfolio     ║   Stock market activity in real time for a portfolio.       ║
  29. ╠════════════════╬═════════════════════════════════════════════════════════════╣
  30. ║  Holdings      ║   Watches stock market activity in all your portfolio.      ║
  31. ╠════════════════╬═════════════════════════════════════════════════════════════╣
  32. ║  TickerTape    ║   Ticker tape showing the latest prices for all the stocks. ║
  33. ╠════════════════╬═════════════════════════════════════════════════════════════╣
  34. ║  Graphs        ║   Watch real-time graphs of your portfolio.                 ║
  35. ╠════════════════╬═════════════════════════════════════════════════════════════╣
  36. ║  Exit          ║   Exit Stocks application and return to Paradox.            ║
  37. ╚════════════════╩═════════════════════════════════════════════════════════════╝
  38.   ENDTEXT
  39.   PAINTCANVAS ATTRIBUTE 78 5, 7, 5, 24  ; paint "STOCKS APPLICATION"
  40.   PAINTCANVAS ATTRIBUTE 14 5, 57, 5, 65 ; paint "MAIN MENU"
  41.   CANVAS ON
  42.  
  43.   STYLE
  44.   SHOWMENU
  45.     "Board"      : "See real-time price feed.",
  46.     "Portfolio"  : "Track progress of a specific portfolio.",
  47.     "Holdings"   : "Track aggregate holdings.",
  48.     "TickerTape" : "Watch the ticker tape.",
  49.     "Graphs"     : "See real-time graph of your portfolio.",
  50.     "Exit"       : "Leave portfolio management system."
  51.     TO Activity
  52.   SWITCH
  53.     CASE (Activity = "Exit" or Activity = "Esc"):
  54.       RETURN FALSE                      ; stop execution of the main loop
  55.     CASE (Activity = "Board"):
  56.       SeeBoard()
  57.     CASE (Activity = "Portfolio"):
  58.       Specificport()
  59.     CASE (Activity = "TickerTape"):
  60.       DoTicker()
  61.     CASE (Activity = "Holdings"):
  62.       PortAggr()
  63.     CASE (Activity = "Graphs"):
  64.       DoGraph()
  65.   ENDSWITCH
  66.   WHILE (CHARWAITING())                 ; get all extra characters that were press
  67.     Y = GETCHAR()                       ; before returning to selection menu
  68.   ENDWHILE
  69.   RETURN TRUE                           ; show the Main menu again
  70. ENDPROC ;  DoActivity
  71.  
  72. ; Since DoActivity has been made into a procedure, and all procedures
  73. ; are in the AUTOLIB procedure library, the entire script
  74. ; to play the application consists of the following lines.
  75.  
  76. Autolib = "Paradox"
  77.  
  78. IF (NOT ISFILE("PARADOX.LIB"))
  79.   THEN RETURN "Please play the MKLIB script to create the application library"
  80. ENDIF
  81.  
  82. DoActivity()
  83. WHILE (Retval)                          ; repeat until DoActivity() returns False
  84.   DoActivity()
  85. ENDWHILE
  86. RELEASE VARS ALL                        ; release all global variables
  87.