home *** CD-ROM | disk | FTP | other *** search
- ; Script: STOCKS.SC
- ; Version: 3.5
- ; Date: 23 March 1990
- ;
- ; This is the main script for the STOCKS application. This script
- ; controls the Main menu for the application. Note that each Main
- ; menu item calls a single procedure when chosen. The source code
- ; for each procedure is stored in a script file with the name of
- ; the Main menu command that calls it. Before the application starts,
- ; all of the procedures are written to the PARADOX.LIB library, which
- ; is then assigned to Autolib to make it the autoload library for
- ; the application.
-
- PROC DoActivity()
- Private Y
- CANVAS OFF
- CLEARALL
- CLEAR ; Clear all tables on canvas and workspaces
- PAINTCANVAS ATTRIBUTE 31 0, 0, 24, 79
- STYLE ATTRIBUTE 30
- @ 4, 0
- TEXT
- ╔══════════════════════════════════════════════════════════════════════════════╗
- ║ ░░░░ STOCKS APPLICATION ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ MAIN MENU ░░░░░░░░░░░ ║
- ╟────────────────╥─────────────────────────────────────────────────────────────╢
- ║ Board ║ The table of stocks shown with real-time updates. ║
- ╠════════════════╬═════════════════════════════════════════════════════════════╣
- ║ Portfolio ║ Stock market activity in real time for a portfolio. ║
- ╠════════════════╬═════════════════════════════════════════════════════════════╣
- ║ Holdings ║ Watches stock market activity in all your portfolio. ║
- ╠════════════════╬═════════════════════════════════════════════════════════════╣
- ║ TickerTape ║ Ticker tape showing the latest prices for all the stocks. ║
- ╠════════════════╬═════════════════════════════════════════════════════════════╣
- ║ Graphs ║ Watch real-time graphs of your portfolio. ║
- ╠════════════════╬═════════════════════════════════════════════════════════════╣
- ║ Exit ║ Exit Stocks application and return to Paradox. ║
- ╚════════════════╩═════════════════════════════════════════════════════════════╝
- ENDTEXT
- PAINTCANVAS ATTRIBUTE 78 5, 7, 5, 24 ; paint "STOCKS APPLICATION"
- PAINTCANVAS ATTRIBUTE 14 5, 57, 5, 65 ; paint "MAIN MENU"
- CANVAS ON
-
- STYLE
- SHOWMENU
- "Board" : "See real-time price feed.",
- "Portfolio" : "Track progress of a specific portfolio.",
- "Holdings" : "Track aggregate holdings.",
- "TickerTape" : "Watch the ticker tape.",
- "Graphs" : "See real-time graph of your portfolio.",
- "Exit" : "Leave portfolio management system."
- TO Activity
- SWITCH
- CASE (Activity = "Exit" or Activity = "Esc"):
- RETURN FALSE ; stop execution of the main loop
- CASE (Activity = "Board"):
- SeeBoard()
- CASE (Activity = "Portfolio"):
- Specificport()
- CASE (Activity = "TickerTape"):
- DoTicker()
- CASE (Activity = "Holdings"):
- PortAggr()
- CASE (Activity = "Graphs"):
- DoGraph()
- ENDSWITCH
- WHILE (CHARWAITING()) ; get all extra characters that were press
- Y = GETCHAR() ; before returning to selection menu
- ENDWHILE
- RETURN TRUE ; show the Main menu again
- ENDPROC ; DoActivity
-
- ; Since DoActivity has been made into a procedure, and all procedures
- ; are in the AUTOLIB procedure library, the entire script
- ; to play the application consists of the following lines.
-
- Autolib = "Paradox"
-
- IF (NOT ISFILE("PARADOX.LIB"))
- THEN RETURN "Please play the MKLIB script to create the application library"
- ENDIF
-
- DoActivity()
- WHILE (Retval) ; repeat until DoActivity() returns False
- DoActivity()
- ENDWHILE
- RELEASE VARS ALL ; release all global variables
-