home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-02-22 | 3.8 KB | 144 lines | [TEXT/ttxt] |
- 1 ' PCDemo, a demonstration program for PCBASIC
-
- 10 ' Set up Feature menu items as vectors
-
- KEY(1) ON : ON KEY(1) GOSUB IntlText
- KEY(2) ON : ON KEY(2) GOSUB IBMText
- KEY(3) ON : ON KEY(3) GOSUB FKeyText
- KEY(4) ON : ON KEY(4) GOSUB DLogText
- KEY(5) ON : ON KEY(5) GOSUB MouseText
- KEY(6) ON : ON KEY(6) GOSUB BigText
- KEY(7) ON : ON KEY(7) GOSUB StrongText
-
- 20 ' Set up Order menu vector
- FILES MENU ON : ON FILES MENU GOSUB 800
-
- ' Let Apple-period start Debugger
- BREAK ON : ON BREAK GOSUB Debugger
-
- ' Show intro and wait for operator
- GOSUB IntroText
-
- 50 ' Wait for a function key
- 55 GOTO 50
-
- IntlText ' Text for International
- RESTORE #501 ' Point to text in resource file
- GOTO 1000 ' Display text on the screen
- IBMText ' Text for IBM Compatible
- RESTORE #502 : GOTO 1000
- FKeyText ' Text for Menus and Function Keys
- RESTORE #503 : GOTO 1000
- DlogText ' Text for Dialog and Alert Boxes
- RESTORE #504 : GOTO 1000
- MouseText ' Text for Mouse and Editing
- RESTORE #505 : GOTO 1000
- BigText ' Text for Large Programs and Data
- RESTORE #506 : GOTO 1000
- StrongText ' Text for Industrial Strength
- RESTORE #507 : GOTO 1000
- IntroText ' Text for Introduction
- RESTORE #508 : GOTO 1000
-
- 800 ' Order menu subroutine
- LOCATE ,,2 ' Initialize cursor to an arrow
- Item%= FILES(0) ' Which item in order menu ?
- IF Item%=0 THEN RETURN ' All done ?
- IF Item%=3 THEN 9999 ' Quit program
-
- IF ITEM%=4 THEN 5000
- ' Start order dialog
- DIALOG(501,8+Item%)=1 ' Preset Buy or Information button
- ' Let operator press a button
- GOSUB 810
- ' Close the dialog
- CLOSE #501 ' Close the dialog
- GOTO 800
-
- 810 ' Print, Save or Cancel ?
-
- IF DIALOG(501,11) THEN 830 ' PRINT ?
- IF DIALOG(501,12) THEN 820 ' SAVE ?
- IF DIALOG(501,13) THEN RETURN ' CANCEL ?
-
- GOTO 810
-
- 820 ' Save
- OPEN "Mail List" FOR APPEND AS 1
- FOR I%=2 TO 6
- Item$=DIALOG$(501,I%) ' Read text from dialog box
- PRINT #1, Item$
- NEXT
-
- ' Get system and order buttons from dialog box
- IF DIALOG(501,7)=1 THEN PRINT#1, "StandAlone " ;
- IF DIALOG(501,8)=1 THEN PRINT#1, "MPW " ;
- IF DIALOG(501,9)=1 THEN PRINT#1, "Manual " ELSE PRINT#1, "Disk "
- CLOSE #1 ' Close the file
- RETURN
-
- 830 ' Print
-
- OPEN "LPT2:" AS #2
- PRINT #2, "Pterodactyl Software"
- PRINT #2, "200 Davey Glen Rd #416"
- PRINT #2, "Belmont CA 94002"
- PRINT #2, " "
- PRINT #2, " Please send a ";
- IF DIALOG(501,9)=1 THEN PRINT#2, "manual. Enclosed is $50." ELSE PRINT#2,"disk."
- PRINT #2, " "
- FOR I%=2 TO 6
- Item$=DIALOG$(501,I%) ' Read text from dialog box
- PRINT #2, Item$
- NEXT
- PRINT#2,CHR$(12); ' Form Feed
- CLOSE #2 ' Close the Printer
- RETURN
-
- 1000 ' Display text on screen
- LOCATE #132 ' Show Watch cursor
- CLS
- READ OneLine$
- WHILE OneLine$ <> "END"
- 1010 ? OneLine$
- READ OneLine$
- WEND
- LOCATE #300 ' Show custom cursor
- RETURN
-
- 9999 ' Exit the PCDemo Program
- END
- '
- DEBUGGER
- '
- 5000 ' Break
- BreakPoint$ = STR$(BreakPoint%)
- DIALOG$(650,6) = BreakPoint$
- DIALOG(650,6) = LEN(BreakPoint$)
- DIALOG$(650,7) = "Current Line ="+STR$(TRON(0))
- DIALOG$(650,8) = "OneLine$="+OneLine$
- DIALOG$(650,9) = "Item%="+STR$(Item%)
- 5005 ' Wait for a button
- DebugChoice% = DIALOG #650
- BreakPoint% = VAL%(DIALOG$(650,6))
- ON DebugChoice% GOTO 5010,5020,5030
- GOTO 5005
- 5010 ' Step
- DIALOG(650,1) = 0
- ON TRON GOSUB 5000
- TRON
- RETURN
- 5020 ' Go till break
- ON TRON GOSUB 5050
- CLOSE 650
- TRON
- RETURN
- 5030 ' Quit Debugger
- ON TRON GOSUB 0
- CLOSE 650
- TROFF
- RETURN
- 5050 ' Check for break
- IF BreakPoint%<>TRON(0) THEN TRON : RETURN ELSE 5000
-
-