home *** CD-ROM | disk | FTP | other *** search
- 100 ' ** This is an example program that demonstrates how a screen,
- 110 ' built with "EASY SCREENS", can be read into and displayed
- 120 ' by a Basic program.
- 130 '
- 140 WIDTH 40 'change screen width to 40
- 150 SCREEN ,,0,0:CLS 'set active and visual page to 0, clear screen
- 155 SCREEN ,,1,0:CLS 'set active page to 1 and clear
- 160 COLOR 2,0,0 'set color to green on black, boarder to black
- 170 LOCATE 1,1,,31 'start at line 1, column 1; make cursor invisible
- 180 PRINT "This is an example program that demon- "
- 190 PRINT "strates how a screen, built with `EASY "
- 200 PRINT "SCREENS', can be read and displayed by "
- 210 PRINT "a Basic program. For this program to "
- 220 PRINT "work properly, your `EASY SCREENS' "
- 230 PRINT "master floppy diskette must be in drive"
- 240 PRINT "A:."
- 250 PRINT " "
- 260 PRINT "This example program loads and displays"
- 270 PRINT "the `EASY SCREENS' instruction screens."
- 280 PRINT " ":COLOR 10
- 290 PRINT "Enter page number of the instruction "
- 300 PRINT "screen you want to have displayed. A "
- 310 PRINT "zero will cause the instructions table "
- 320 PRINT "of contents to be displayed. If you "
- 330 PRINT "want to quit now, enter 99. Once the "
- 340 PRINT "instruction screen is displayed, push "
- 350 PRINT "<RETURN> to return to this screen. "
- 360 PRINT " ":COLOR 9
- 370 PRINT "Enter page number (or 99 to quit):"
- 380 LOCATE 22,1,7,7:COLOR 1 'answer on line 22, in blue
- 390 SCREEN ,,1,1 'change active and visual page to 1
- 400 LOCATE ,,7,7 'make cursor visible
- 405 BEEP 'make a beep
- 410 INPUT A 'input page number
- 420 IF A=99 THEN 990 'quit if 99 was entered
- 430 IF A<>INT(A) THEN 700 'invalid if not a whole number
- 440 IF A<0 THEN 700 'invalid if less than zero
- 450 IF A>99 THEN 700 'invalid if greater than 99
- 460 FS$="a:instrc**.scn" 'initialize file spec
- 470 T$=STR$(A) 'convert answer to a string
- 480 IF LEN(T$)=3 THEN 520 'answer is two digits
- 490 MID$(T$,1,1)="0" 'set leading space to a zero
- 500 MID$(FS$,9,2)=T$ 'put number into file spec
- 510 GOTO 540
- 520 MID$(FS$,9,2)=MID$(T$,2,2) 'put number into file spec
- 540 DEF SEG=&HB800 'define screen memory segment
- 550 WIDTH 80 'change screen width to 80
- 560 SCREEN ,,1,1 'set active and visual page to 1
- 570 LOCATE ,,,31 'make cursor invisible
- 580 ON ERROR GOTO 800 'if error on read, goto 800
- 590 BLOAD FS$,0 'Binary load screen into page 0
- 600 ' of screen memory.
- 610 ON ERROR GOTO 0 'clear error path
- 620 SCREEN ,,1,0 'set visual page to page 2
- 630 INPUT W$ 'wait for any input from keyboard
- 640 GOTO 140 'start over
- 650 '
- 700 LOCATE 24,1,,31 'print error message on line 24
- 710 COLOR 12 'print message in bright red
- 720 PRINT "Not a valid page number, please re-enter"
- 730 LOCATE 22,1 'clear answer line
- 740 PRINT " "
- 750 GOTO 380 'try again
- 800 LOCATE 7,1,,31 'print error message on line 7
- 810 COLOR 12 'print message in bright red
- 820 PRINT "File Spec ";FS$;" not found on"
- 830 PRINT "on drive A. Please try again. Push "
- 840 PRINT "<RETURN> when ready."
- 850 PRINT " "
- 855 INPUT W$
- 860 RESUME 140
- 990 WIDTH 80 'reset width to 80
- 991 COLOR 2,0,0 'set color to green on black
- 992 LOCATE ,,7,7 'make cursor visible
- 999 END 'end program