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 >
Wrap
Text File
|
1992-11-22
|
3KB
|
126 lines
; ------------------------------------------------------------------
; Start-up script for the sample programs.
; Play this "START" script to run everything else.
Proc Start_Up()
Private
do_script, ;the script to perform
is_event_trace ;whether to trace events in a canvas window
; Initialization
AltSpace {DeskTop} {Empty}
Clear
Init_Demo()
Release Procs Init_Demo
; Initialize the event-trace window
If is_event_trace then
Play "WaitEv"
Wait_Trace_Init()
Release Procs Wait_Trace_Init
Endif
; Display the menu - Ask the user what to do
Main_Menu()
; Perform the procedure requested by the user
If do_script="Quit"then
Quit "All Done"
Endif
Play do_script
EndProc
; ------------------------------------------------------------------
Proc Init_Demo()
; Initializes the demonstration.
; Validates the environment and gets parameters.
Private
bv, ;button value
many_line_screen, ;whether it's a many-line (compressed) screen
sb, ;SYSINFO dynamic array
sh ;screen height
; Test the version
If version()<4.0 then
Beep Quit "This program requires version 4.0 of Paradox to run!"
Endif
; Initialize the [Shift-F10] key
SetKey "F20" Play "Start"
; Get the screen parameters
SysInfo to sb ;get system information
sh = sb["ScreenHeight"] ;screen height
; Present parameters in a dialog box for the user
many_line_screen = (sh>25)
is_event_trace = True
ShowDialog "Program Parameters"
@ 2,17 Height 8 Width 47
CheckBoxes @ 1,5 Height 2 Width 40 Tag "CheckBoxes"
"Compressed Screen (>25 lines)" to many_line_screen,
"Event Trace Window" to is_event_trace
PushButton @ 4,10 Width 10
"OK" OK Default Value "OK" Tag "OK" To bv
PushButton @ 4,24 Width 10
"Cancel" Cancel Value "Cancel" Tag "Cancel" To bv
EndDialog
If not retval then
Quit "Program canceled"
Endif
; Set the screen display
Switch
Case many_line_screen and sh<=25:
AltSpace {Video} "D"
Case not many_line_screen and sh>25:
AltSpace {Video} "C"
EndSwitch
EndProc
; ------------------------------------------------------------------
Proc Main_Menu()
; Displays a menu of sample programs to the user,
; and asks which one to perform
Message "Which program do you want to run?"
ShowPullDown
"ManyWindow": "Program with a WAIT command and many windows": "ManyWin",
"Quit": "All done": "Quit"
EndMenu
GetMenuSelection to do_script
ClearPullDown
EndProc
; ------------------------------------------------------------------
Start_Up()
; ------------------------------------------------------------------