home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / PROGRAMM / BUILDER.ZIP / LSHELL1.BLD < prev    next >
Text File  |  1992-11-17  |  2KB  |  86 lines

  1. ' LSHELL1.BLD
  2. '
  3. ' Template for a middle-of-the-screen lightbar menu program.  Just plug
  4. ' in your own values for each ITEM, then place the appropriate code below
  5. '  each ITEM.
  6. '
  7. ' To use it, enter this at the DOS command line:
  8. '
  9. '   LSHELL1
  10. '
  11. ' X & Y position the menu.
  12. integer x,y,xsay,ysay
  13.  
  14. ' IsColor is set to 1 if the screen is color-capable, or 0 if not.
  15. integer IsColor
  16.  
  17. ' All-purpose string variable
  18. string s
  19.  
  20. ' Get the video mode & force screen to 80x25.
  21. s := Adaptor
  22.  
  23. if s is "Mono"
  24.   ' Force 80 x 25 mono.
  25.   run mode mono
  26.   ' Remember that it's not a color system.
  27.   Put 0 into IsColor
  28.   ' Set colors for a mono system.
  29.   Menu Style White,Black,Bright White,Black,Black,White,White,Black,0,1,2,1
  30. end else
  31.   ' Force 80 x 25 color
  32.   run mode co80
  33.   ' Remember that it is a color system.
  34.   Put 1 into IsColor
  35.   ' Set colors for a non-mono system.
  36.   Menu Style Blue,White,Red,White,White,Black,Black,White,0,1,1,1
  37. end
  38.  
  39. ' Initialize position of menu.
  40. x:=30
  41. y:=7
  42. Cls black on cyan   'Clear the screen and set default colors to black on cyan
  43.  
  44. ' Keep displaying the menu until the user presses {Esc}.
  45. While not cancelled
  46.   ' Run the subroutine Main.
  47.   Main
  48. End
  49.  
  50. '==================================================================
  51. ' SUB Main
  52. '
  53. ' What it does:
  54. '   Displays the main menu, and directs program control according
  55. '   to the user's choice.
  56. '
  57. ' Globals affected:
  58. '   INTEGER X, Y
  59. '
  60. ' Other routines used:
  61. '   None
  62. '
  63. '==================================================================
  64.  
  65. sub Main
  66.   LightBar @ y,x
  67.     Item "Item 1"
  68.       ' Any lines of text from the ITEM above, down to but not
  69.       ' including the next ITEM, will be executed when "Item 1"
  70.       ' is chosen.
  71.       Say @ y + 6, x "Item 1 chosen"
  72.     Item "Item 2"
  73.       ' Any lines of text from the ITEM above, down to but not
  74.       ' including the next ITEM, will be executed when "Item 2"
  75.       ' is chosen.
  76.       Say @ y + 6, x "Item 2 chosen"
  77.     Item "Quit"
  78.       ' Any lines of text from the ITEM above, down to but not
  79.       ' including the next ITEM, will be executed when "Quit"
  80.       ' is chosen.
  81.       Say @ y + 6, x "Item Quit chosen"
  82.       ' Return to DOS.
  83.       exit 0
  84.   end
  85. end
  86.