home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 18 / CD_ASCQ_18_111294_W.iso / dos / prg / pas / pscrn55 / basic.exe / DEMO.BAS < prev    next >
BASIC Source File  |  1994-10-09  |  3KB  |  75 lines

  1. DEFINT A-Z
  2.  
  3. '$INCLUDE: 'PScreen.Inc'            '... Declare functions in PScreen.Obj
  4.                                     '    For Microsoft Basics only.
  5.                                     '    Requires:  P-Screen.Obj
  6.                                     '               LoadScr?.Obj
  7. '===================================================
  8. '   POWERBASIC USERS:  'un-REM the next few lines
  9. '===================================================
  10. ''$INCLUDE "PScreen.Inc"    '...declare routines
  11. ''$Link  "PScreen.Obj"      '...essential "screen restore" routines
  12. ''$Link  "LoadScrn.PBU"     '...link our "load screen" routines
  13. ''
  14. '===================================================
  15. '   END:  POWERBASIC USERS
  16. '===================================================
  17.  
  18. '============================================================== Demo.Bas
  19. '
  20. '  Purpose:    A universal but simple "presentation" program.
  21. '
  22. '              Turns ANY P-Screen screen library into a mini presentation!
  23. '
  24. '  Copyright:  1994, Rob W. Smetana  A P-Screen support module.
  25. '
  26. '  Syntax:     Demo LibraryName <cr>
  27. '
  28. '              Where:     "LibraryName" is the name of a P-Screen screen
  29. '                         library -- WITH path and extension!
  30. '
  31. '              Example:   demo c:\p-screen\lessons.psl  <cr>
  32. '
  33. ' Improvements:     - Add option to let users back up as well as move
  34. '                     forward through screens.
  35. '                   - Improve error trapping; add more messages to
  36. '                     better explain what happened.
  37. '============================================================== Demo.Bas
  38.  
  39.    COLOR 7, 1: CLS
  40.  
  41.    Call psInitialize:Cls            '...for SHAREWARE versions ONLY
  42.  
  43.    LibName$ = COMMAND$        '...use which library?
  44.  
  45.    IF LEN(LibName$) THEN      '...did they pass anything?
  46.       NumScrns = NumScreensInLib(LibName$)  '...how many screens?
  47.    END IF
  48.  
  49.    IF NumScrns < 1 THEN       '...-999 means "library not found"
  50.       PRINT "P-Screen screen library ["; LibName$; "] wasn't found, or it was invalid."
  51.       PRINT "Sorry.  Ending."
  52.       PRINT
  53.       PRINT "Syntax:        demo drive:\directory\LibraryName <cr>."
  54.       END
  55.    END IF
  56.  
  57.    FOR Scrn = 1 TO NumScrns   '...display each screen and pause
  58.  
  59.        ErrCode = DisplayScreen(LibName$, "", Scrn)
  60.  
  61.        IF ErrCode < -1 THEN   '...exit with error message
  62.  
  63.           CLS : PRINT "Sorry, an error occurred.  Ending.": END
  64.        ELSE
  65.                               '...pause for them to press a key
  66.           DO: Ky$ = INKEY$: LOOP UNTIL Ky$ > ""
  67.                               '...exit if they press Escape
  68.           IF Ky$ = CHR$(27) THEN CLS : END
  69.        END IF
  70.  
  71.    NEXT
  72.  
  73.    CLS : PRINT "that's all . . ."
  74.  
  75.