home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / s / s9302.zip / SMITH.ZIP / START.SC < prev    next >
Text File  |  1992-11-22  |  3KB  |  126 lines

  1. ;  ------------------------------------------------------------------
  2.  
  3. ;  Start-up script for the sample programs.
  4. ;  Play this "START" script to run everything else.
  5.  
  6. Proc Start_Up()
  7.  
  8. Private
  9.    do_script,           ;the script to perform
  10.    is_event_trace       ;whether to trace events in a canvas window
  11.  
  12. ;  Initialization
  13.  
  14. AltSpace {DeskTop} {Empty}
  15. Clear
  16.  
  17. Init_Demo()
  18. Release Procs Init_Demo
  19.  
  20. ;  Initialize the event-trace window
  21.  
  22. If is_event_trace then
  23.    Play "WaitEv"
  24.    Wait_Trace_Init()
  25.    Release Procs Wait_Trace_Init
  26. Endif
  27.  
  28. ;  Display the menu - Ask the user what to do
  29.  
  30. Main_Menu()
  31.  
  32. ;  Perform the procedure requested by the user
  33.  
  34. If do_script="Quit"then
  35.    Quit "All Done"
  36. Endif
  37.  
  38. Play do_script
  39.  
  40. EndProc
  41.  
  42. ;  ------------------------------------------------------------------
  43.  
  44. Proc Init_Demo()
  45.  
  46. ;  Initializes the demonstration.
  47. ;  Validates the environment and gets parameters.
  48.  
  49. Private
  50.    bv,                  ;button value
  51.    many_line_screen,    ;whether it's a many-line (compressed) screen
  52.    sb,                  ;SYSINFO dynamic array
  53.    sh                   ;screen height
  54.  
  55. ;  Test the version
  56.  
  57. If version()<4.0 then
  58.    Beep Quit "This program requires version 4.0 of Paradox to run!"
  59. Endif
  60.  
  61. ;  Initialize the [Shift-F10] key
  62.  
  63. SetKey "F20" Play "Start"
  64.  
  65. ;  Get the screen parameters
  66.  
  67. SysInfo to sb                   ;get system information
  68. sh = sb["ScreenHeight"]         ;screen height
  69.  
  70. ;  Present parameters in a dialog box for the user
  71.  
  72. many_line_screen = (sh>25)
  73. is_event_trace   = True
  74.  
  75. ShowDialog "Program Parameters"
  76.    @ 2,17 Height 8 Width 47
  77.    CheckBoxes @ 1,5 Height 2 Width 40 Tag "CheckBoxes"
  78.       "Compressed Screen (>25 lines)" to many_line_screen,
  79.       "Event Trace Window" to is_event_trace
  80.    PushButton @ 4,10 Width 10
  81.       "OK" OK Default Value "OK" Tag "OK" To bv
  82.    PushButton @ 4,24 Width 10
  83.       "Cancel" Cancel Value "Cancel" Tag "Cancel" To bv
  84. EndDialog
  85.  
  86. If not retval then
  87.    Quit "Program canceled"
  88. Endif
  89.  
  90. ;  Set the screen display
  91.  
  92. Switch
  93.    Case many_line_screen and sh<=25:
  94.       AltSpace {Video} "D"
  95.    Case not many_line_screen and sh>25:
  96.       AltSpace {Video} "C"
  97. EndSwitch
  98.  
  99. EndProc
  100.  
  101. ;  ------------------------------------------------------------------
  102.  
  103. Proc Main_Menu()
  104.  
  105. ;  Displays a menu of sample programs to the user,
  106. ;  and asks which one to perform
  107.  
  108. Message "Which program do you want to run?"
  109.  
  110. ShowPullDown
  111.    "ManyWindow": "Program with a WAIT command and many windows":  "ManyWin",
  112.    "Quit":       "All done":                                      "Quit"
  113. EndMenu
  114.  
  115. GetMenuSelection to do_script
  116.  
  117. ClearPullDown
  118.  
  119. EndProc
  120.  
  121. ;  ------------------------------------------------------------------
  122.  
  123. Start_Up()
  124.  
  125. ;  ------------------------------------------------------------------
  126.