home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / tools / codeit / demow2.bas < prev    next >
BASIC Source File  |  1992-05-27  |  5KB  |  158 lines

  1. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. 'DEMOW2.BAS Copyright (C) 1991-1992, Clear Software. ALL RIGHTS RESERVED.
  3. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4.  
  5. '$INCLUDE: 'CITOOLS.BI'
  6. '$INCLUDE: 'CIWIND2.BI'
  7. '$INCLUDE: 'CIMOUSE.BI'
  8.  
  9. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10.  
  11. DEFINT A-Z
  12.  
  13. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  14.  
  15. CONST TRUE = -1, FALSE = 0
  16.  
  17. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  18.  
  19. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  20. 'Dimention the arrays and initialize the mouse. Notice the base of 1 (1 TO n).
  21. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  22.  
  23.     DIM AletText$(1 TO 2)
  24.     DIM TextText$(1 TO 5)
  25.     DIM scrlText$(1 TO 40)
  26.     DIM scrlTag(1 TO 40)
  27.     DIM TagText$(1 TO 2)
  28.     
  29.     MouseInit
  30.     
  31. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  32. 'Set the array member contents of the string and integer arrays.
  33. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  34.  
  35.     AlertText$(1) = " Be Bop Aluah She's My Baby...... "
  36.     
  37.     TextText$(1) = " Be Bop Aluah Don't Mean Maybe|"
  38.     TextText$(2) = "="
  39.     TextText$(3) = " Press any key to go to the mountains "
  40.  
  41.     scrlText$(1) = "Pine Trees"
  42.     scrlText$(2) = "Ferns"
  43.     scrlText$(3) = "Mountains"
  44.     scrlText$(4) = "Rivers"
  45.     scrlText$(5) = "Lakes"
  46.     scrlText$(6) = "Valleys"
  47.     scrlText$(7) = "Water Falls"
  48.     scrlText$(8) = "Deer"
  49.     scrlText$(9) = "Fish"
  50.     scrlText$(10) = "Bear"
  51.     scrlText$(11) = "Ponds"
  52.     scrlText$(12) = "Rabbits"
  53.     scrlText$(13) = "Leaves"
  54.     scrlText$(14) = "Medows"
  55.     scrlText$(15) = "Vines"
  56.     scrlText$(16) = "Oak Trees"
  57.     scrlText$(17) = "Log Cabins"
  58.     scrlText$(18) = "Blue Sky"
  59.     scrlText$(19) = "Streems"
  60.     scrlText$(20) = "Birds"
  61.     scrlText$(21) = "Big Pine Trees"
  62.     scrlText$(22) = "Green Ferns"
  63.     scrlText$(23) = "High Mountains"
  64.     scrlText$(24) = "Rapid  Rivers"
  65.     scrlText$(25) = "Clear Lakes"
  66.     scrlText$(26) = "Green Valleys"
  67.     scrlText$(27) = "Cascading Water Falls"
  68.     scrlText$(28) = "Hiding Deer"
  69.     scrlText$(29) = "Jumpin' Fish"
  70.     scrlText$(30) = "Grissly Bear"
  71.     scrlText$(31) = "Wide Ponds"
  72.     scrlText$(32) = "Fast Rabbits"
  73.     scrlText$(33) = "Lots of Leaves"
  74.     scrlText$(34) = "Green Medows"
  75.     scrlText$(35) = "Hanging Vines"
  76.     scrlText$(36) = "Large Oak Trees"
  77.     scrlText$(37) = "Cozy Log Cabins"
  78.     scrlText$(38) = "Clear Blue Sky"
  79.     scrlText$(39) = "Trickling Streems"
  80.     scrlText$(40) = "Singing Birds"
  81.  
  82.     scrlTag(4) = 1
  83.     scrlTag(5) = 1
  84.     scrlTag(20) = 1
  85.     scrlTag(30) = 1
  86.     scrlTag(35) = 1
  87.     scrlTag(36) = 1
  88.  
  89.     TagText$(1) = " Use the SPACE BAR to tag or un-tag items "
  90.  
  91. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  92. 'Sort the scrlText$() array.
  93. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  94.  
  95.     SWAPIT = TRUE
  96.  
  97.     WHILE SWAPIT
  98.  
  99.         SWAPIT = FALSE
  100.  
  101.         FOR a = 2 TO UBOUND(scrlText$)
  102.             IF scrlText$(a - 1) > scrlText$(a) THEN
  103.                 SWAP scrlText$(a - 1), scrlText$(a)
  104.                 SWAPIT = TRUE
  105.             END IF
  106.         NEXT
  107.     WEND
  108.  
  109. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  110. 'Clear the screen and paint the background.
  111. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  112.     
  113.     CLS
  114.     COLOR 0, 1
  115.     ScreenPaint 2, 79, 2, 23, ""
  116.     DrawBox 1, 80, 1, 23, 2
  117.  
  118. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  119. 'Show the mouse and display the alert window.
  120. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  121.  
  122.     MouseShow
  123.  
  124.     x = AlertWindow(6, 25, AlertText$(), " Show Your Age ", 1, 2, "OK", "Continue", "", 0, 3, 15)
  125.  
  126. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  127. 'Display the text window.
  128. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  129.  
  130.     TextWindow 2, 4, TextText$(), "", 1, 2, 1, 15, 5
  131.  
  132. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  133. 'Make the scroll window active.
  134. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  135.  
  136.     x = ScrollWindow(10, 38, 4, 20, scrlText$(), " Scroll Me ", 1, 2, 15, 6, 0, 7)
  137.  
  138. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  139. 'Display a text window and a tag window. Notice the 0 in the saveFlag
  140. 'parameter. This puts the window on the screen but does not save the screen
  141. 'area or wait for a user keypress like the first text window example above.
  142. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  143.  
  144.     TextWindow 10, 2, TagText$(), "", 1, 2, 0, 15, 2
  145.  
  146.     x = TagWindow(49, 77, 4, 20, scrlText$(), " Tag, Your It ", 1, 2, 15, 2, 0, 7, scrlTag(), "*")
  147.  
  148. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  149. 'Hide the mouse and clean up the screen.
  150. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  151.     
  152.     MouseHide
  153.  
  154.     COLOR 7, 0
  155.     CLS
  156.     END
  157.  
  158.