home *** CD-ROM | disk | FTP | other *** search
/ Asymetrix Demo / Asymetrix.iso / prg / mtb30 / samples / library.tbk (.txt) < prev    next >
Encoding:
Asymetrix ToolBook File  |  1994-07-11  |  245.4 KB  |  4,229 lines

  1. itemOffset()
  2. origPage
  3. original
  4. itemOffset()
  5. label
  6. itemOffset()G
  7. A fast way to find the offset of an item in a list.  For example, itemOffset("e","a,b,c,d,e,f,g") would return "5"
  8. Handlers:    itemOffset (<item>,<list>)
  9. Parameters:
  10. <item>:      The item whose offset you are looking for.
  11. <list>:       The list in which you are looking.
  12. Note: to find out if the item is in the list, check if itemOffset is greater than 0.....
  13. -- finds the offset of an item in a list. 
  14. to get itemOffset itm,lst
  15.     step i from 1 to itemcount(lst)
  16.         pop lst
  17.         if itm = it
  18.             return i
  19.         end
  20.     return 0
  21. enddddddddddddddturn 0
  22. Display 2-D array values
  23. request2Darray
  24. request2Darray x[][]
  25. Zretval
  26. dimensions(x)
  27. x[i][j] 
  28. origPage
  29. original
  30. Display 2-D array values
  31. label
  32. Display 2-D array values
  33. Often, when debugging a script using arrays, you may want to display the array at a certain point in your script.  This page has a handler for displaying the contents of two-dimensional arrays. 
  34. Note that this also displays a standard method for walking through a 2D array.
  35. The button to the right fills an array with the elements of the list in the field.
  36. Once filled, it passes the array to the request2Darray handler (in this page script), which displays the contents of the array..ray.
  37. arrayField
  38. d,4,4/1/06
  39. h,7,4/1/23
  40. j,5,3/1/29
  41. i,1,1/9/55
  42. g,6,7/7/64
  43. e,9,11/13/66
  44. f,0,7/4/76
  45. b,3,5/23/91
  46. c,2,3/11/92
  47. a,8,1/12/933
  48. Display
  49. krequest2DArray
  50. arrayField
  51. buttonClick
  52. buttonClick
  53. Zx[][]
  54.     fill x 
  55. "arrayField" 
  56. ] order
  57. request2DArray x
  58. Display
  59. Add number of days to date
  60. Add number of days to date
  61. This handler adds a specified number of days to a provided date. Note that a negative number of days can be supplied to subtract a number of days.
  62. Handler:    newDate (<original date>,<days to add>)
  63. Parameters:
  64. <original date>:    Base date to which you want to add days
  65. <days to add>:    Number of days you want to add to <original date>
  66. Returns the modified date.
  67. -- function: newDate(<original date>,<number of days to add>)
  68. -- Returns a date n days from a given date.  Pass it a date 
  69. -- for the first parameter, followed by an integer (positive 
  70. -- or negative) representing the number of days from that date
  71. -- Example:  to find out the date 10 days ago
  72. -- set x to newDate(sysdate,-10)
  73. to get newDate origdate, days
  74.     format date origdate as "seconds"
  75.     increment origdate by (days*24*60*60)
  76.     format date origdate as sysdateformat from "seconds"
  77.     return origdate
  78. endddddddddddddddddddddddddddddddddddddddddd
  79. origPage
  80. original
  81. Add number of days to date
  82. label
  83. Controlling volume of clips
  84. label
  85. Controlling volume of clips
  86. Clips have a property called mmVolume, which you can set before or during play of a clip. This example uses a dial widget to control the volume of a clip. The dial widget sends out a dialMove message, which the Play Clip button handles..with a no
  87. Choose a clip, then play it while turning the dial to control the volume.
  88. Play Clip
  89. Play Clip
  90. Clip to play
  91. Clip Chooser
  92. myStartAngle
  93. myendAngle
  94. myTallTicSpacing
  95. scaleDial
  96. tbk_wid_name
  97. dialPos
  98. dialMin
  99. dialMax
  100. startAngle
  101. endAngle
  102. numTics
  103. tallTicSpacing
  104. tbk_wid_props
  105. tbk_wid_values
  106. myNumTics
  107. mydialMin
  108. mydialMax
  109. #    lw@
  110. myRotation
  111. struct
  112. structInfo
  113. 40433333333333333
  114. 605.6666666666667
  115. 10099999999999999
  116. 950tK 
  117. 96199999999999999
  118. Display
  119. dialMove
  120. notifybefore dialMove pos
  121. 550639676273476528
  122. enterpage
  123. dialMove
  124. dialMove
  125. enddialMove
  126. clip "Asymetrix Logo"
  127. clip "bird1"
  128. clip "bird2"
  129. clip "bird3"
  130. clip "CD Audio"
  131. clip "Chirp"
  132. clip "lion"
  133. clip "No No No"
  134. clip "tiger"
  135. clip "toad"
  136. clip "Asymetrix Logo"
  137. CdresetContents
  138. enterpage
  139. CdresetContents
  140. clips
  141. whatClip
  142. resetContents
  143. notifyBefore 
  144. resetContents
  145. notifyAfter 
  146. [dropdownitems 
  147.     clips = resourceList(
  148. <> NULL
  149. whatClip
  150. &CRLF 
  151. r"&"E&
  152. dropDownItems 
  153. description only
  154. description and example
  155. topicName
  156. description and script
  157. Untitled
  158. enterpage
  159. pageName
  160. templateButtons
  161. label
  162. subtopicname
  163. topicName
  164. chosen
  165. cancel
  166. keychar
  167. cancel
  168. -- initialize dialog box
  169. "Untitled" 
  170. "topicName"
  171. B"description 
  172. buttonclick 
  173. -- sent 
  174. user presses OK
  175. pageName 
  176. chosen 
  177. "templateButtons"
  178.         -- 
  179. the specified 
  180. label 
  181. "subtopicname" 
  182.     close 
  183. -- handles OK 
  184. escape 
  185. keyEnter
  186. origPage
  187. original
  188. label
  189. in,false
  190. ThreeDeeRect
  191. bottomLine
  192. topLine
  193. Topic name:
  194. bottomLine
  195. topLine
  196. topicName
  197. Play clip on enter page
  198. templateButtons
  199. chosen
  200. templates
  201. buttonclick
  202. buttonclick
  203.     -- store selected 
  204. a property 
  205. chosen
  206. "templates"
  207. Description and Script
  208. chosen
  209. Description and Script
  210. Description and &Script
  211. Description Only
  212. Description &Only
  213. Description and Example
  214. Description and &Example
  215. Choose Template
  216. templates
  217. Description and script
  218. This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee.
  219. to handle buttonup
  220.     do this 
  221.         do that
  222. description only
  223. description and script
  224. This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee. I've had so many cups of it already that I can see through time. Maybe some decaf is in orderrican butt.
  225. Description and example
  226. This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee. I've had so many cups of it already that I can see through time. Maybe some decaf is in order
  227. to handle buttonup
  228.     do this 
  229.         do that
  230. buttonclick
  231. buttonclick
  232. cancel
  233. buttonclick
  234. buttonclick
  235. Cancel
  236. description and script
  237. Get number of days in month
  238. Get number of days in month
  239. This handler returns the number of days there are in a month of a given year. Note that this handler requires the isLeapYear() handler, supplied below.
  240. Handler:    daysInMonth (<month>,<year>)
  241. Parameters:
  242. <month>:    An integer representing the month
  243. <year>:        A four-digit year
  244. Returns the number of days in the supplied month for that year.
  245. -- function: daysInMonth(<month>,<four-digit year>)
  246. -- Returns the number of days in a month.   
  247. -- NOTE: this function requires 4 digits for the year.  
  248. -- This function calls the function leapYear() defined below.
  249. -- example: to find out how many days are in February, 1992 
  250. -- set x to daysInMonth(2,1992) 
  251. to get daysInMonth m,y 
  252.     if m <> 2 
  253.         return item m of "31,28,31,30,31,30,31,31,30,31,30,31" 
  254.     else 
  255.         if leapYear(y) 
  256.             return 29 
  257.         else 
  258.             return 28 
  259.         end
  260. -- Returns TRUE if y is a leap year, FALSE if not.
  261. -- NOTE: this fuction requires a four digit year.
  262. -- Example:  Find out if 1992 is a leap year.
  263. -- if leapYear(1992)
  264. to get isLeapYear y
  265.     if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0))
  266.         return TRUE
  267.     else
  268.         return FALSE
  269. origPage
  270. original
  271. Get number of days in month
  272. label
  273. Create Full-Text Search Index
  274. label
  275. Create Full-Text Search Indexndex
  276. Creates an index of the current book for full-text searches. The index will use the default settings file (found in the Multimedia ToolBook directory).
  277. The index will be created in the same directory and have the same name as the the current book.
  278. Example of use:
  279.     send buildIndexxxxxxxxxxxxxx
  280. -- this handler builds a basic full-text search index of the current book.
  281. to handle buildIndex
  282.     -- display an hourglass cursor... this can take a while.
  283.     sysCursor = 4
  284.     -- link the dlls required to build an index
  285.     linkDll "fts30mtb.dll"
  286.         STRING ftsRemoveIndex           ( STRING )
  287.         DWORD  ftsInitIndex             ( STRING, STRING, WORD )
  288.         LONG   ftsAddContext            ( DWORD, STRING )
  289.         STRING ftsAddPage               ( DWORD, STRING, STRING, STRING, LONG )
  290.         STRING ftsAddTextToSection      ( DWORD, STRING, STRING )
  291.         STRING ftsAddSectionsToPage     ( DWORD )
  292.         STRING ftsBuildIndex            ( DWORD )
  293.     -- get the name of the index to use    
  294.     indexName = name of this book
  295.     if indexName = NULL
  296.         request "You must save this book before building an index for it."
  297.         send cleanExit
  298.     while "." is in indexName
  299.         clear last char of indexName
  300.     -- remove any existing index of that name
  301.     get ftsRemoveIndex(indexName)
  302.     -- initialize the index
  303.     indexHandle = ftsInitIndex(indexName,sysToolbookDirectory&"default.sst",sysWindowHandle)
  304.     if it = 0
  305.         -- if there is an error stop this process
  306.         request "Error initializing index"
  307.         send cleanExit
  308.     -- step through the pages of this book
  309.     step i from 1 to pageCount of this book
  310.         pageRef = page i of this book
  311.         bgRef = parent of pageRef
  312.         -- if this background is different than the previous one
  313.         -- get a list of objects on this background
  314.         if bgRef <> curRef
  315.             curRef = bgRef
  316.             bgObs = getObjectList(bgRef,"field,recordField",FALSE)
  317.         end
  318.         -- get a title to associate with this page
  319.         title = name of pageRef
  320.         if title = NULL
  321.             title = pageRef
  322.         end
  323.         -- add the page to the index
  324.         get ftsAddPage(indexHandle,pageRef,title,"",1)
  325.         if it = NULL
  326.             request "Error Adding Page"
  327.             send cleanExit
  328.         end
  329.         -- step through the list of fields and recordFields on this background
  330.         -- and add their text to the default section of the index
  331.         step j from 1 to itemCount(bgObs)
  332.             curObj = item j of bgObs
  333.             if object of curObj = "recordField"
  334.                 -- to get the text of a recordField we have to refer to a page rather than the background
  335.                 -- words 1 to 4 of a recordField reference are:  "recordField id X of"
  336.                 curObj = words 1 to 4 of curObj && pageRef
  337.             end
  338.             textExp = "richText of"&&curObj
  339.             get ftsAddTextToSection(indexHandle,textExp,"")
  340.         end
  341.         -- get a list of fields on this page and add their text to the default section of the index
  342.         pgObs = getObjectList(pageRef,"field",FALSE)
  343.         step j from 1 to itemcount(pgObs)
  344.             curObj = item j of pgObs
  345.             textExp = "richText of"&&curObj
  346.             get ftsAddTextToSection(indexHandle,textExp,"")
  347.         end
  348.         -- add the text placed into sections to the index
  349.         get ftsAddSectionsToPage(indexHandle)
  350.     --build the index
  351.     get ftsBuildIndex(indexHandle)
  352.     if it = NULL
  353.         request "Failed to build index."
  354.     else
  355.         request "Index successfully built."
  356.     send cleanExit
  357. end buildIndex
  358. -- this process will exit the build process cleanly
  359. -- (removing the DLLs, etc.)
  360. to handle cleanExit
  361.     sysCursor = 1
  362.     unlinkDLL "fts30mtb.dll"
  363.     break to system
  364. end cleanExit
  365. {{{{{{{p{
  366. Perform Full-Text Search
  367. label
  368. Perform Full-Text Search
  369. -- this handler performs a basic search procedure on a full-text search index        
  370. to get searchIndex queryString
  371.     system lastQuery
  372.     system DWORD numHits, currentHit
  373.     local pageRef
  374.     if queryString <> NULL
  375.         sysCursor = 4
  376.         -- link the functions required for the search
  377.         linkDll "fts30mtb.dll"
  378.             DWORD  ftsOpenIndex             ( STRING )
  379.             STRING ftsCloseIndex            ( DWORD )
  380.             DWORD  ftsQuery                 ( DWORD, STRING, DWORD )
  381.             STRING ftsMatchRef              ( DWORD, DWORD, DWORD )
  382.         end
  383.         -- identify the index to search
  384.         indexName = name of this book
  385.         while "." is in indexName
  386.             clear last char of indexName
  387.         end
  388.         -- open the index
  389.         indexHandle = ftsOpenIndex(indexName)
  390.         if indexHandle = 0
  391.             request "Could not open index"
  392.             send cleanExit
  393.             return NULL
  394.         end
  395.         --make the query
  396.         numHits = ftsQuery(indexHandle,queryString,0)
  397.         if numHits > 0
  398.         -- there was at least one hit
  399.             if queryString = lastQuery
  400.             -- the user is searching for the same string as the last search
  401.                 increment currentHit
  402.                 if currentHit > numHits
  403.                     currentHit = 1
  404.                 end
  405.             else
  406.                 currentHit = 1
  407.                 lastQuery = queryString
  408.             end
  409.             -- get the page reference of the currentHit
  410.             pageRef = ftsMatchRef(indexHandle,currentHit,0)
  411.         end
  412.     -- close the index
  413.     get ftsCloseIndex(indexHandle)        
  414.     send cleanExit
  415.     return pageRef
  416. -- this handler exits the search process cleanly
  417. -- (unlinking DLLs etc.)
  418. to handle cleanExit
  419.     sysCursor = 1
  420.     unlinkDLL "fts30mtb.dll"
  421. enddddd
  422.     get ftsCloseIndex(indexHandle)        
  423.     send cleanExit
  424.     return pageRef
  425. -- this handler exits the search process cleanly
  426. -- (unlinking DLLs etc.)
  427. to handle cleanExit
  428.     sysCursor = 1
  429.     unlinkDLL "fts30mtb.dll"
  430. This handler performs a search using an existing full-text search index. The index is assumed to be in the same directory and have the same name as the current book.
  431. This handler takes one parameter - the text for which to search - and returns a page reference for the first page on which that text appears. Searching with the same string again will return subsequent pages on which the text appears.
  432. Example of use:
  433. to handle buttonClick
  434.     system lastQuery
  435.     ask "Search For:" with lastQuery
  436.     queryString = it
  437.     pageRef = searchIndex(queryString)
  438.     if isObject(pageRef)
  439.         go to pageRef
  440.     else
  441.         request queryString&&"not found."
  442. Playing MIDI Directly
  443. label
  444. Playing MIDI Directly
  445. The button below plays MIDI sounds by making calls directly to the Windows Multimedia System DLL (mmsystem.dll)
  446. Click and hold Play MIDI to play a MIDI sound.
  447. Changing the Note field changes the note of the sound to be played.
  448. Changing the Program field changes how the Note is played...
  449. playMidi
  450. Play MIDI
  451. integerUp
  452. ,!J'"
  453. program
  454. spinUp
  455. w%spinUp
  456. buttonDown
  457. w%spinUp
  458. buttonDoubleClick
  459. w%spinUp
  460. buttonStillDown
  461. spinUp
  462. "program" < 39
  463. integerDown
  464. program
  465. spinDown
  466. |spinDown
  467. buttonDown
  468. |spinDown
  469. buttonDoubleClick
  470. |spinDown
  471. buttonStillDown
  472. spinDown
  473. "program" > 0
  474. program
  475. integerUp
  476. spinUp
  477. w%spinUp
  478. buttonDown
  479. w%spinUp
  480. buttonDoubleClick
  481. w%spinUp
  482. buttonStillDown
  483. spinUp
  484. "note" < 127
  485. integerDown
  486. spinDown
  487. |spinDown
  488. buttonDown
  489. |spinDown
  490. buttonDoubleClick
  491. |spinDown
  492. buttonStillDown
  493. spinDown
  494. "note" > 40
  495. Program:
  496. Note:am:
  497. enterPage
  498. reader
  499. leavePage
  500. author
  501. Show all objects of page
  502. label
  503. Show all objects of page
  504. The script below displays all objects on the current page regardless of whether they are in groups.
  505. to handle showAll
  506.     show getObjectList(this page,null,false)
  507. Disabling task switching
  508. label
  509. Disabling task switching#
  510. The script below allows you to turn on or off task-switching. When task-switching is on the user may not change tasks by using Alt+Tab, Alt+Shift+Tab, or Ctrl+Esc. They may still activate other windows by clicking on them.
  511. To turn off task-switching:
  512.     set taskSwitching() to FALSE
  513. To turn task-switching back on:
  514.     set taskSwitching() to TRUE
  515. to set taskSwitching to LOGICAL mode
  516.     if mode
  517.         untranslateWindowMessage 0x0112 for sysWindowHandle
  518.     else
  519.         translateWindowMessage for sysWindowHandle
  520.             on 0x0112    send WM_SYSCOMMAND
  521.         end
  522. to handle WM_SYSCOMMAND    hWnd, wMsg, wp, lpLo, lpHi
  523.     if wp <> 0xF050 and wp <> 0xF040 and wp <> 0xF130
  524.       --SC_PREVWINDOW, SC_NEXTWINDOW, and SC_TASKLIST
  525.         forward to system
  526. Icon Resources
  527. Save Text to a File (ASCII or RT
  528. Search and replace in a string
  529. Remove given char from string
  530. Remove given char from stringg
  531. This handler removes all instances of the specified character from the specified string.
  532. Handler: stripChar(<character to strip>,<string to strip it from>)
  533. Parameters:
  534. <character to strip>:    any single character
  535. <string to strip it from>:    the string from which to strip the character
  536. Returns the stripped string...
  537. -- removes all instances of chr from strng
  538. to get stripChar chr,strng
  539.     set chrLoc to offset(chr,strng)
  540.     while chrLoc > 0
  541.         clear char chrLoc of strng
  542.         set chrLoc to offset(chr,strng)
  543.     return strng
  544. stripChar
  545. stripChar chr,strng
  546. chrLoc 
  547. origPage
  548. original
  549. Remove given char from string
  550. label
  551. Play clip on enter page
  552. label
  553. Play clip on enter page
  554. -- notifies for showing and closing clips
  555. notifyAfter enterPage
  556.     -- these scripts could go in any object 
  557.     -- on the page or background
  558.     -- clipRef of this page would 
  559.     -- already have the necessary reference
  560.     clipRef = clipRef of this page
  561.     if clipRef <> NULL
  562.         mmOpen clipRef wait
  563.         -- use this if the media is on a cd-rom
  564. --        mmCue clipRef wait
  565.         -- show the first frame
  566.         mmPlay clipRef in stage "myStage" of this background
  567. end enterPage
  568. notifyBefore leavePage
  569.     clipRef = clipRef of this page
  570.     if (clipRef <> null) and (mmIsOpen of clipRef)
  571.         mmClose clipRef
  572.     end if
  573. end leavePage
  574. These scripts play a clip upon entering a page and close it upon leaving the page. You could paste these scripts into any object. The clip to be played is identified by a user-property of the page and the clip is played in a stage object of the background.
  575. Chirp
  576. CD Audio
  577. bird1
  578. bird2
  579. bird3
  580. tiger
  581. No No No
  582. Asymetrix Logo
  583. chirp.wav
  584. animals.wav
  585. animals.wav
  586. animals.wav
  587. animals.wav
  588. animals.wav
  589. animals.wav
  590. animals.wav
  591. asym01.avi
  592.                                         
  593. bitamp
  594. sequencer
  595. overlay
  596. animation
  597. digitalVideo
  598. cdAudio
  599. photoCD
  600. videoDisk
  601. waveAudio
  602. Bring up the Command Window
  603. Bring up the Command Window
  604. This one line script brings up the Command Window without using the Command menu item or the Shift + F3 key.  Often you will want to remove menu items that you aren't using at Author level, but you still need the Command window while working.
  605. origPage
  606. to handle buttonClick
  607.    show commandWindow
  608. end buttonClick
  609. original
  610. Bring up the Command Window
  611. label
  612. Bring up the Command Window
  613. Get day of week from date
  614. Spin controls
  615. origPage
  616. original
  617. Spin controls
  618. label
  619. Spin controls
  620. Below are some standard spin controls for selecting an integer, date, or time. To use the date and time spinners, click on the segment of the date or time (e.g., month, minute) that you want to increment or decrement.
  621. Try out the spinners on the right. 
  622. To use the date and time spinners, first click on the segment of the date or time (e.g., month, minute) that you want to increment or decrement.
  623. integerUp
  624. integer
  625. spinUp
  626. w%spinUp
  627. buttonDown
  628. w%spinUp
  629. buttonDoubleClick
  630. w%spinUp
  631. buttonStillDown
  632. spinUp
  633. "integer"
  634. integerDown
  635. integer
  636. spinDown
  637. |spinDown
  638. buttonDown
  639. |spinDown
  640. buttonDoubleClick
  641. |spinDown
  642. buttonStillDown
  643. spinDown
  644. "integer"
  645. integer
  646. dateButtons
  647. decrement
  648. dateUp
  649. increment
  650. month
  651. month
  652. actionItem
  653. buttonDown
  654. buttondoubleclick
  655. buttonStillDown
  656. "dateUp"
  657. actionItem 
  658. selectedHotwords 
  659. "day"
  660. "month"
  661. "year"
  662. dateUp
  663. dateDown
  664. increment
  665. evaluate(day)
  666. 03 / 13 / 944
  667. month
  668. timeButtons
  669. decrement
  670. timeUp
  671. ;seconds
  672. increment
  673. seconds
  674. minute
  675. minute
  676. actionItem
  677. buttonDown
  678. buttondoubleclick
  679. buttonStillDown
  680. "timeUp"
  681. actionItem 
  682. selectedHotwords 
  683. "hour"
  684. "Time" 
  685. "minute"
  686. "AMPM"
  687. timeUp
  688. timeDown
  689. increment
  690. evaluate(day)
  691. 08 : 42 : 45 PMM
  692. minute
  693. seconds
  694. Limit Length of Entry String
  695. origPage
  696. original
  697. Limit Length of Entry String
  698. label
  699. Limit Length of Entry Stringr
  700. This handler is to be installed into the script of a field. When a key is pressed, it checks that the charCount of the text of the field is within the limits specified in the script.   
  701. This is a handler for a built-in ToolBook message that is sent to a field each time the user presses a key.  Along with the keyChar message, Toolbook passes a parameter containing the unique code for the key pressed.
  702. Handler:   keyChar keyPressedsseddddameters are:
  703.    keyPressed   the key pressed by the user
  704. -- does not allow entry of more than specified
  705. -- amount of characters. Place this hander in a field.
  706. to handle keyChar keyPressed
  707.     local INT maxCharAllowed
  708.     local INT currentCount
  709.     maxCharAllowed = 10
  710.     currentCount = charCount(my text)
  711.     if (currentCount >= maxCharAllowed) \
  712.      or (keyPressed = keyEnter and currentCount >= \
  713.      maxCharAllowed - 1)
  714.         beep 1
  715.     else
  716.         forward
  717. Limit Length of Entry String
  718. Cursor Resources
  719. Add number of days to date
  720. Check for Alpha Non-Numeric Data
  721. origPage
  722. original
  723. Check for Alpha Non-Numeric Data
  724. label
  725. Check for Alpha Non-Numeric Data
  726. This function checks each character to ensure that it is a letter from in the range of A-Z or a-z.  To allow additional values or characters, you will need to add them to the string held in the variable "alphabet."
  727. Handler:    isStringAlpha (<testString>)
  728. Parameters:
  729. <testString>    
  730. Returns true if the string contains only alpha characters or null.
  731. pha characters or null.
  732. true      testString contained only alpha  characters (A-Z or a-z)  or  NULL
  733.    false      testString contained at least  one non-alpha character
  734. -- tests each character of testString, returns TRUE
  735. -- if all are alpha (non-numeric)
  736. to get isStringAlpha testString
  737.     alphabet = "abcdefghijklmnopqrstuvwxyz"
  738.     step i from 1 to charcount(testString)
  739.         if char i of testString is not in alphabet
  740.             return FALSE
  741.         end
  742.     return TRUE
  743. Bring ToolBook Window to Front
  744. Bring ToolBook Window to Front
  745. This script uses DDE to get the sysWindowHandle of another instance  of ToolBook.  It then calls Windows to bring that window to the front of the desktop. If that application is not running, it runs it.
  746. Handler:    bringWindowToFront <application>
  747. Parameters:
  748. <application>:     the name of theToolBook file   
  749. to handle bringWindowToFront appNameToRun
  750.     linkDLL "user"  
  751.         --bringWindowToTop is a Windows function that
  752.         --puts the Window whose window handle is passed to it
  753.         --in front of all the other windows.
  754.         INT bringWindowToTop(WORD)
  755.     end linkDLL
  756.     --getRemote returns 9 separate items in sysError  
  757.     --item 1 is the status of the remote request
  758.    getRemote "sysWindowHandle" application  toolBook topic appNameToRun
  759.     if (item 1 of sysError) is "OK"
  760.         get bringWindowToTop(it)
  761.         --bringWindowToTop doesn't size to page or even 
  762.         --restore it
  763.         executeRemote "send SizeToPage" application toolbook \
  764.          topic appNameToRun
  765.     else
  766.         --the app isn't running, so we'll start it
  767.         run appNameToRun
  768.     end if
  769. end      
  770. Front     
  771. origPage
  772. original
  773. Bring ToolBook Window to Front
  774. label
  775. Bring ToolBook Window to Front
  776. Using windows pointers
  777. Resizing a polypoint object
  778. Initialize Excel Conversation
  779. Initialize Excel Conversation
  780. This function will run Excel if it is not running already.  If a filename is passed to this function it will tell Excel to load that file if it is not loaded already. 
  781. Handler:    InitializeExcel  (<fileName>)
  782. Parameters:
  783. <filename>    optional; makes sure the file is open in Excel
  784. Returns true if it successfully established conversation with Excel
  785.    false        couldn't load Excel or, if provided, the file name given
  786. SysError values are those of the command executeRemote  (see the OpenScript Encyclopedia).
  787.    OK                     Conversation was succesfully established
  788.    Failed:No Server    Excel is not running with the expected file
  789.    Failed: xxxxx        Excel is running, but something is wrong
  790. to get InitializeExcel fileNameToRun
  791.     --Get the current status of Excel
  792.     getRemote "Status" application "Excel" topic "System"
  793.     --If it failed because there is no server
  794.     --run excel
  795.     if item 1 of sysError = "Failed: No Server" 
  796.         run "excel.exe" && fileNameToRun
  797.         getRemote "Status" application "Excel" topic "System"
  798.   end
  799.   --getRemote status should return Ready
  800.     if it <> "Ready" 
  801.         return false
  802.     end if
  803.     --Make sure that it is not minimized
  804.     executeRemote "[App.Restore()]" application "excel"
  805.     --If no file has been specified then return successfully
  806.     if fileNameToRun = NULL 
  807.         return true
  808.     --Check to see if fFileName is open and, if so, 
  809.     --make it active
  810.     executeRemote "[Activate(""" & fileNameToRun & """)]" \
  811.      application "excel" topic fileNameToRun
  812.     --If it failed because there is no server then try 
  813.     --opening the file
  814.     if item 1 of sysError = "Failed: No Server" 
  815.         executeRemote "[Open(""" & fileNameToRun & """)]" \
  816.          application "excel"
  817.     --If sysError is OK then success
  818.     if item 1 of sysError = "OK" 
  819.         return true
  820.     return false
  821. origPage
  822. original
  823. Initialize Excel Conversation
  824. label
  825. Initialize Excel Conversation
  826. label
  827. to handle enterApplication
  828.     system s_backMessageSent
  829.     -- initialize system variable
  830.     s_backMessageSent = false
  831.     -- turn off syshistory
  832.     syshistoryrecord = false
  833.     clear syshistory
  834.     forward
  835. to handle leavepage
  836.     system s_backMessageSent
  837.     -- only puts page on syshistory if navigation is *not* initiated by BACK
  838.     if targetWindow is mainWindow
  839.         if s_backMessageSent is false
  840.             push this page onto syshistory
  841.         else
  842.             s_backMessageSent = false
  843.         end
  844.     forward
  845. to handle back
  846.     system s_backMessageSent
  847.     if itemcount(syshistory) > 0
  848.         s_backMessageSent = true
  849.         pop syshistory
  850.         in mainwindow
  851.             go to it
  852.         end
  853.     else
  854.         request "You are already all the way back."
  855. Changing the behavior of BACK
  856. Changing the behavior of BACK
  857. These handlers, when placed in the book script of a ToolBook application, will make the BACK message behave like back behaves in WinHelp. 
  858. Note: be sure you forward any leavePage handlers located in a page or background script.
  859. Handlers:
  860. EnterApplication
  861. LeavePage
  862. Spin controls
  863. Graphic slider control
  864. Check for Valid File Name
  865. Search Path for File
  866. Verbose
  867. Sorting a 1-D array
  868. label
  869. Sorting a 1-D array
  870. -- The next three handlers make up a Standard recursive 
  871. -- QuickSort.
  872. to handle quicksort fArray[] by reference
  873.     system s_noSwap
  874.     set s_noSwap to 0
  875.     send quicksrt fArray, 1, dimensions ( fArray )
  876. to handle quicksrt fArray[] by reference, lo, hi
  877.     system  s_noSwap
  878.     if hi > lo 
  879.         send swap  fArray, lo, ((lo+hi) div 2)
  880.         set lst to lo
  881.         step i from (lo+1) to hi
  882.             if fArray[i] < fArray[lo] as text
  883.                 increment lst
  884.                 send swap fArray, lst, i
  885.             else
  886.                 increment s_noswap
  887.             end
  888.         end 
  889.         send swap fArray,lo,lst 
  890.            send quicksrt fArray, lo, lst-1
  891.         send quicksrt fArray, lst+1,hi
  892.        end
  893. to handle swap fArray[] by reference, x, y
  894.     local temp
  895.     set temp to fArray[x]
  896.     set fArray[x] to fArray[y]
  897.     set fArray[y] to temp
  898. end fArray[x]
  899.     set fArray[x] to fArray[y]
  900.     set fArray[y] to temp
  901. This is an OpenScript implementation of the standard recursive quick sort.
  902. Handler:      quickSort <arrayRef>
  903. Parameter:    
  904. <arrayRef>:      A one-dimensional array.
  905. Example:
  906.   local fArray[]
  907.   fill fArray with my text in [textline] order
  908.   send quickSort fArray
  909. Search Path for File
  910. origPage
  911. Search Path for File
  912. This script links to the function getDosEnvironmentString in TB30DOS.DLL to get the DOS path and then determines if the file is in that path.
  913. Handler:      fileInPath (<fileName>)
  914. Parameters:
  915. <fileName>    file name to search for
  916. Returns null if file is not found, or the first directory in the path that contains the file if found.
  917.    NULL        file not found
  918.    currentPath    the first directory in the path that contains the file
  919.    Null parameter    no file name was passed to function
  920. name was passed to function
  921. to get FileInPath fileNameToCheck
  922.     --If fileNameToCheck is null then fail immediately
  923.     if fileNameToCheck is NULL then
  924.         return null
  925.     end if
  926.     --Link to the tb30dos dll
  927.     linkDLL "tb30dos.dll"
  928.         INT fileExists (STRING)
  929.         STRING getDOSEnvironmentString (STRING)
  930.     end linkDLL
  931.     --Get the path list 
  932.     set currentPathList to   getDOSEnvironmentString ("PATH")
  933.     --Clear the 'Path=' at the beginning of the path list
  934.     get offset("=",currentPathList)
  935.     if it > 0 then
  936.         clear chars 1 to it of currentPathList
  937.     end if
  938.     --Convert the path list to a list of items    
  939.     get offset(";",currentPathList)
  940.     while it > 0
  941.         set char it of currentPathList to ","
  942.         get offset(";",currentPathList)
  943.     end while
  944.     --Search through the list, one path at a time
  945.     while currentPathList is not NULL
  946.         pop currentPathList into checkPath
  947.         if last char of checkPath is not "\"
  948.             put "\" after checkPath
  949.         end if
  950.         if fileExists(checkPath & fileNameToCheck) = 1
  951.             return checkPath
  952.         end if
  953.     end while
  954.     --Unable to find file in the path
  955.     return null
  956. original
  957. Search Path for File
  958. label
  959. Get Current Path Setting
  960. origPage
  961. original
  962. Get Current Path Setting<
  963. This script links to the function getDosEnvironmentString in TB30DOS.DLL to get the current DOS path setting. This handler returns the path currently specified in your DOS environment.
  964. Handler:      findCurrentPath
  965. No parameters.
  966. RRath setting
  967. to get findCurrentPath
  968.    --Link to the tb30dos dll
  969.     linkDLL "tb30dos.dll"
  970.         STRING getDOSEnvironmentString (STRING)
  971.      end linkDLL
  972.    --Get the path list 
  973.       set currentPathSetting to  getDOSEnvironmentString ("PATH")
  974.       return currentPathSetting
  975. end findCurrentPath
  976. Get Current Path Setting
  977. label
  978. Get Current Path Setting
  979. Remove given char from string
  980. Convert textlines to list
  981. Insert/Overwrite field
  982. origPage
  983. Insert/Overwrite fieldA
  984. This field toggles between insert and overwrite mode when you press the insert key. All handlers are in the field.ndlers are in the field.
  985. Type in the field to the right. 
  986. Pressing the insert key toggles between insert and overwrite modes.
  987. overWriteFlag
  988. false
  989. keyDown
  990. overWriteFlag
  991. keyChar
  992. overWriteFlag
  993. enterpage
  994. 4logical overWriteFlag
  995. Y <> 
  996. notifybefore 
  997. notifyafter 
  998. Now is the time for all good men to come to the aid of their country..............................................wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
  999. terpage
  1000. enterpage
  1001. original
  1002. Insert/Overwrite field
  1003. label
  1004. Auto-scroll field
  1005. Converting to Binary, Hex, Octal
  1006. intro
  1007. <Introduction>
  1008. Dragging Objects
  1009. label
  1010. Dragging Objects
  1011. to handle buttondown loc
  1012.     local stack bnds,mouseOffset
  1013.     linkdll "user"
  1014.         int getsystemmetrics(int)
  1015.     -- check if the user has swapped mouse buttons.
  1016.     if getsystemmetrics(23) >0
  1017.         set leftMouseButton to keyRightButton
  1018.     else
  1019.         set leftMouseButton to keyLeftButton
  1020.     set bnds to bounds of target
  1021.     set mouseOffset to item 1 of loc - item 1 of bnds,\
  1022.       item 2 of loc - item 2 of bnds
  1023.     leftMouseButton=keyLeftButton
  1024.     while keystate(leftMouseButton)is down
  1025.         newloc = sysMousePosition
  1026.         if newLoc <> loc
  1027.             set position of target to \
  1028.               item 1 of newLoc-item 1 of mouseOffset,\
  1029.               item 2 of newLoc-item 2 of mouseOffset
  1030.             set loc to newLoc
  1031.         end
  1032. Put the script below in an object that you want to drag with the mouse. Note: if you want to drag a group, change the references from arget
  1033. Display 2-D array values
  1034. Testola
  1035. description only
  1036. subtopicname
  1037. in,ms
  1038. ThreeDeeRect
  1039. bottomLine
  1040. topLine
  1041. explanation
  1042. Converting to Binary, Hex, Octal
  1043. Converting to Binary, Hex, Octal
  1044. The Format command has been extended to allow conversion between Binary, Hex, and Octal number systems. The following are the new format strings
  1045.     Binary:            "@b"
  1046.     Octal:           "@o"
  1047.     Hex:            "@h"
  1048.     Decimal:       "@d"
  1049. These strings precede the normal number format string. So to convert a variable "n" from decimal to hexidecimal, you could use the following command:
  1050.     format number n as "@h0"
  1051. To convert it back to decimal, you'd do this:
  1052.     format number n as "@d0"
  1053. n convertTo is "Hexidecimal" 
  1054.             format number numberEntered as "@h#"
  1055.         else 
  1056.             format number numberEntered as "@o#"
  1057.    end conditions
  1058.       return numberEntered
  1059. end doConversion
  1060. origPage
  1061. original
  1062. Converting to Binary, Hex, Octal
  1063. label
  1064. Binary Insertion of Textline
  1065. origPage
  1066. original
  1067. Binary Insertion of Textline
  1068. label
  1069. Binary Insertion of Textline into Field
  1070. Inserts a textline into a string delimited by CRLFs, maintaining sorted order.
  1071. Handler:    InsertLine (<txt>,<newLine>)
  1072. Parameters:
  1073. <txt>            Text, sorted by textLine
  1074. <newLine>    The new line to insert.
  1075. Example of use:
  1076.   text of field "f" = insertLine(text of field "f",newLine)
  1077. -- use if inserting a single line. Will maintain sorted order
  1078. to get insertLine txt,newLine
  1079.     if txt is null
  1080.         return newLine
  1081.     set start to 1  -- first textline
  1082.     set tlc to textlinecount(txt)
  1083.     set ending to tlc -- last textline
  1084.     local insertSpot
  1085.     while start <= ending 
  1086.         set midPoint to (start+ending) div 2 
  1087.         set middleLine to textline midPoint of txt
  1088.         conditions
  1089.             when newLine < middleLine as text
  1090.                 -- start looking at values less than current midPoint
  1091.                 set ending to midPoint-1
  1092.                 set insertSpot to midPoint
  1093.             when newLine > middleLine as text
  1094.                 -- start looking at values greater than current midPoint
  1095.                 set start to midPoint+1
  1096.                 set insertSpot to midPoint+1
  1097.             else
  1098.                 -- the item already exists
  1099.                 set insertSpot to midPoint
  1100.                 break while
  1101.         end
  1102.     if insertSpot > tlc
  1103.         put newLine before textline insertSpot of txt
  1104.     else
  1105.         put newLine&crlf before textline insertSpot of txt
  1106.     return txt
  1107. label
  1108. Making mmSource-paths book relative
  1109. If you've saved your clips with fully qualified paths to their source files, you will probably want to change them so that they are  relative to the location of the book so that the clips can be easily found using the HDMediaPath or CDMediaPath when installed on another machine. This routine runs through your resources and makes them relative to the book path. For example:
  1110. If the book is "c:\toolbook\animals.tbk"
  1111. mmSource "c:\toolbook\howl.wav" becomes "howl.wav"
  1112. mmSource "c:\toolbook\wave\moo.wav"  becomes "wave\moo.wav"""""""av"
  1113. -- This handler is useful for eliminating fully qualified 
  1114. -- path names of the mmsource of clips. Instead, the path 
  1115. -- names will be relative to the book path.
  1116. -- For example:
  1117. -- if you had clips with the following paths specified as 
  1118. -- their mmSources
  1119. -- c:\mtb30\dog.wav
  1120. -- c:\mtb30\data\cat.wav
  1121. -- calling this function from a book in the "c:\mtb30" 
  1122. -- directory would change these to the following:
  1123. -- dog.wav
  1124. -- data\cat.wav
  1125. -- Once you've done this, you still need to set the 
  1126. -- hdMediaPath to the book path (on enterApplication, 
  1127. -- for example) to allow any clips located below the book 
  1128. -- path in the directory tree to be found.
  1129. to handle relateClipsToBookPath
  1130.     if name of this book is null
  1131.         break
  1132.     linkdll "tb30dos.dll"
  1133.         int setcurrentdirectory(string)
  1134.         int setCurrentDrive(string)
  1135.         string getCurrentDrive()
  1136.         string getcurrentDirectory(string)
  1137.     path = myPath()
  1138.     -- cache current drive and directory
  1139.     curDrive = getCurrentDrive()
  1140.     curdir = getCurrentDirectory(curDrive)
  1141.     -- attempt to change to specified path
  1142.     a = setcurrentdrive(first char of path)
  1143.     b = setcurrentdirectory(path)
  1144.     -- both functions above return 1 if successful, 
  1145.     -- or a negative number if not
  1146.     if a + b <> 2
  1147.         -- if either function failed
  1148.         request path && "is invalid."
  1149.     else
  1150.         -- add slash to end
  1151.         put "\" after path
  1152.         clipList = resourceList("clip",this book)
  1153.         -- walk through clips, checking if any are under path
  1154.         step i from 1 to itemcount(clipList)
  1155.             pop clipList into curClip
  1156.             src = mmsource of curClip
  1157.             if src contains path 
  1158.                 -- it is under path, so drop first part
  1159.                 clear chars 1 to charcount(path) of src
  1160.                 mmsource of curClip = src
  1161.                 mmSearchHD of curClip = true -- or mmSearchCD
  1162.             end
  1163.         end
  1164.     -- return current directory to original value
  1165.     get setcurrentdrive(curDrive)
  1166.     get setcurrentdirectory(curDir)
  1167. to get myPath
  1168.     get name of this book
  1169.     step i from charcount(it) to 1 by -1
  1170.         if char i of it is "\"
  1171.             return chars 1 to i-1 of it
  1172.         end
  1173.     return null -- happens only when the book is untitled
  1174. Making mmSource-paths book relative
  1175. wwwwp
  1176. wwwwp
  1177. wwwww
  1178. wwwwwp
  1179. TTTTP
  1180. EDEEP
  1181. TDDTP
  1182. Using windows pointers
  1183. windows m
  1184. origPage
  1185. original
  1186. Using windows pointers
  1187. The following functions are helpful if you need to allocate a pointer for calling a windows function.
  1188. getWinPointer ( <nsize> )
  1189. Use this to get a locked pointer.
  1190. Parameter:    <nsize>: the size in bytes to allocate
  1191. Return value:    Returns a reference to a locked pointer that you can pass
  1192.         to a windows function requiring a pointer.
  1193. freeWinPointer (<pointer Variable>)
  1194. Frees a locked pointer, recovering memory.
  1195. Parameter:    <pointer variable>: the variable returned from 
  1196.         getWinPointer()
  1197. Return value:    Returns 0 if successful, a positive integer if not.
  1198. linkMemFunctions
  1199. Links the functions necessary for the above handlers.
  1200. Parameters:    None.....rs:    None.
  1201. -- the link statements for needed functions below
  1202. to handle linkMemFunctions
  1203.     linkDLL "KERNEL"
  1204.         WORD     GlobalAlloc(WORD,DWORD)
  1205.         WORD     GlobalFree(WORD)
  1206.         WORD     GlobalHandle(WORD)
  1207.         POINTER GlobalLock(WORD)    
  1208.         WORD     GlobalUnlock(WORD)
  1209. to get getWinPointer nSize
  1210.     local word hMem
  1211.     local retValue
  1212.     hMem = GlobalAlloc(66,nSize)
  1213.     return GlobalLock(hMem)
  1214. to get freeWinPointer pMem
  1215.     local word hMem, retValue
  1216.     hMem = GlobalHandle(item 1 of pMem)
  1217.     retValue = GlobalUnlock(hMem)
  1218.     return GlobalFree(hMem)
  1219. enddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
  1220. Using windows pointers
  1221. label
  1222. Using a RECT structure
  1223. origPage
  1224. original
  1225. Using a RECT structure
  1226. label
  1227. Using a RECT structuref
  1228. The following functions are useful for dealing with windows functions that require or return a RECT structure.
  1229. setRect <vertices>,<pRect>
  1230. This sets the values of the RECT structure in pRect. Useful if you must pass a filled RECT structure to a Windows function.
  1231. Parameters:
  1232. <vertices>:    The vertices of the rectangle.
  1233. <pRect>:    The pointer to the RECT structure. (8 bytes)
  1234. getRect <pRect>
  1235. This extracts the vertices from a filled RECT structure. 
  1236. Parameter:    <pRect>: The pointer to a RECT structure. (8 bytes)
  1237. getWinPointer ( <nsize> )
  1238. Use this to get a locked pointer.
  1239. Parameter:    <nsize>: the size in bytes to allocate
  1240. Return value:    Returns a reference to a locked pointer that you can pass
  1241.         to a windows function requiring a pointer.
  1242. freeWinPointer (<pointer Variable>)
  1243. Frees a locked pointer, recovering memory.
  1244. Parameter:    <pointer variable>: the variable returned from 
  1245.         getWinPointer()
  1246. Return value:    Returns 0 if successful, a positive integer if not.
  1247. linkMemFunctions
  1248. Links the functions necessary for the above handlers.
  1249. Parameters:    None.....Functions
  1250. Links the functions necessary for the above handlers.
  1251. Parameters:    None...e.y for the above handlers.
  1252. Parameters:    None.
  1253. -- lst is a list of 4 integers
  1254. -- pRect is a locked pointer to 8 bytes
  1255. to handle setRect lst,pRect
  1256.     step i from 0 to 6 by 2
  1257.         pop lst
  1258.         get pointerInt(i,pRect,it)
  1259. -- pRect is a locked pointer to 8 bytes
  1260. to get getRect pRect
  1261.     local retval
  1262.     step i from 6 to 0 by -2
  1263.         push pointerInt(i,pRect) onto retval
  1264.     return retval
  1265. -- the link statements for needed functions below
  1266. to handle linkMemFunctions
  1267.     linkDLL "KERNEL"
  1268.         WORD     GlobalAlloc(WORD,DWORD)
  1269.         WORD     GlobalFree(WORD)
  1270.         WORD     GlobalHandle(WORD)
  1271.         POINTER GlobalLock(WORD)    
  1272.         WORD     GlobalUnlock(WORD)
  1273. to get getWinPointer nSize
  1274.     local word hMem
  1275.     local retValue
  1276.     hMem = GlobalAlloc(66,nSize)
  1277.     return GlobalLock(hMem)
  1278. to get freeWinPointer pMem
  1279.     local word hMem, retValue
  1280.     hMem = GlobalHandle(item 1 of pMem)
  1281.     retValue = GlobalUnlock(hMem)
  1282.     return GlobalFree(hMem)
  1283. enddddddddddddddddddd
  1284.     return GlobalFree(hMem)
  1285. Sorting a 2-D array
  1286. origPage
  1287. original
  1288. Sorting a 2-D array
  1289. label
  1290. Sorting a 2-D array
  1291. Think of a 2-D array as a table in which the first dimension refers to  rows and the second dimension refers to columns. This function sorts the "rows" of a two dimensional array by the values of one of its columns.
  1292. You pass it the array you want to sort, the column you want to sort by, and the "datatype" of the column you want to sort. (Either "text", "date", or "number")/
  1293. Click on the radio buttons to the right to sort the table by the associated column.
  1294. Note: the "table" to the right is a tab-delimited field with two vertical lines drawn over it. The handlers in the buttons load this text into a 2D array and pass it to a handler in this page, specifying the column and type for the sort.     rt.        
  1295. stwoDquickSort
  1296. sortField
  1297. buttonclick
  1298. buttonclick
  1299. Zretval
  1300. Zx[][]
  1301. fref 
  1302. "sortField"
  1303.     fill x 
  1304. g] order
  1305. calls the sorting routine. Note 
  1306. column
  1307. 'array 
  1308. specified, 
  1309. be sorted 
  1310. twoDquickSort x,1,"
  1311. part loads 
  1312. dimensions(x)
  1313. x[i][j] 
  1314. Number
  1315. stwoDquickSort
  1316. number
  1317. sortField
  1318. buttonclick
  1319. buttonclick
  1320. Zretval
  1321. Zx[][]
  1322. fref 
  1323. "sortField"
  1324.     fill x 
  1325. g] order
  1326. twoDquickSort x,2,"
  1327. dimensions(x)
  1328. x[i][j] 
  1329. Number
  1330. stwoDquickSort
  1331. sortField
  1332. buttonclick
  1333. buttonclick
  1334. Zretval
  1335. Zx[][]
  1336. fref 
  1337. "sortField"
  1338.     fill x 
  1339. g] order
  1340. twoDquickSort x,3,"
  1341. dimensions(x)
  1342. x[i][j] 
  1343. Sort by:
  1344. sortField
  1345. a    3    5/23/91
  1346. b    2    3/11/92
  1347. c    4    4/1/06
  1348. d    9    11/13/66
  1349. e    0    7/4/76
  1350. f    6    7/7/64
  1351. g    7    4/1/23
  1352. h    1    2/9/55
  1353. i    5    3/1/29
  1354. a    8    1/12/93
  1355. Using a RECT structure
  1356. isLeapYear()
  1357. Get number of days in month
  1358. Get path of current book
  1359. label
  1360. Get path of current book
  1361. to get myPath
  1362.     get name of this book
  1363.     step i from charcount(it) to 1 by -1
  1364.         if char i of it is "\"
  1365.             return chars 1 to i of it
  1366.         end
  1367.     return null -- happens only when the book is untitled
  1368. This function returns the path of the current book.
  1369. Example of calling this function in a book called c:\books\test.tbk:
  1370.     get myPath(this book)
  1371. Returns "c:\books\""
  1372. resize
  1373. Get Free Disk Space on a Drive
  1374. origPage
  1375. original
  1376. Get Free Disk Space on a DriveB
  1377. This script links to the function called getFreeDiskSpace in the tb30dos.dll to get the amount of disk space currently available on a particular drive.
  1378. Handler:    findDiskSpace (<drive>)
  1379. Parameters:
  1380. <drive>        the name of the drive to check
  1381. Returns the amount of space available on a  particular drive..ror
  1382.      
  1383.      
  1384. ve an error
  1385.      
  1386. to get findDiskSpace whatDrive
  1387.     local LONG diskSpaceAvailable
  1388.     --Link to the tb30dos dll
  1389.     linkDLL "tb30dos.dll"
  1390.         LONG getFreeDiskSpace(STRING)
  1391.     end linkDLL
  1392.     set diskSpaceAvailable to getFreeDiskSpace(whatDrive)
  1393.     return diskSpaceAvailable
  1394. Get Free Disk Space on a Drive
  1395. label
  1396. Get Free Disk Space on a Drive
  1397. Exit and restart windows
  1398. Insert/Overwrite field
  1399. Recording wave files from CD
  1400. label
  1401. Recording wave files from CDq
  1402. You can record clips from a CD to wave files using the utility below. Copy the object to a book with some clips, and then specify the channels, sample rate, bits per sample, and file name.
  1403. This group of objects will record an existing CDAudio clip to a wave file on the disk.
  1404. NOTE: must have your CD Player connected to your sound board for this to function to work.
  1405. Clip Chooser
  1406. D:\HOOKWORK\CLIPS.TBK
  1407. lookBook
  1408. Channels
  1409. Stereo                    2
  1410. Mono                    1
  1411. Stereo                    2
  1412. sample rate
  1413. 22 kHz                    22050
  1414. 11 kHz                    11025
  1415. 22 kHz                    22050
  1416. 44 kHz                    44100
  1417. bits/sample
  1418. 16z                    11025
  1419. 22 kHz                    22050
  1420. 44 kHz                    44100
  1421. Record Wavefile
  1422. Record Wavefile
  1423. CDAudio Clip to Record
  1424. Channels
  1425. Sample Rate
  1426. Bits/Sample
  1427. clip "CD Audio"
  1428. clip "CD Audio"
  1429. CdresetContents
  1430. enterpage
  1431. CdresetContents
  1432. clips
  1433. whatClip
  1434. CDAudio
  1435. resetContents
  1436. notifyBefore 
  1437. resetContents
  1438. notifyAfter 
  1439. [dropdownitems 
  1440.     clips = resourceList(
  1441. <> NULL
  1442. whatClip
  1443. mmSource 
  1444.  = "CDAudio"
  1445. 6&CRLF 
  1446. "&"E&
  1447. dropDownItems 
  1448. enterpage
  1449. Convert textlines to list
  1450. origPage
  1451. original
  1452. Convert textlines to list
  1453. label
  1454. Convert textlines to list
  1455. This handler converts a string delimited by CRLFs to a list.
  1456. Handler:    textLinesToList (<textLines>)
  1457. Parameters:
  1458. <textLines>    a string delimited by CRLFs
  1459. Returns a list, each item representing a textline.................
  1460. -- converts string delimited by CRLFs to a list
  1461. to get textLinesToList txt
  1462.     local stack lst
  1463.     step i from textlinecount(txt) to 1 by - 1
  1464.         push textline i of txt onto lst
  1465.     return lst
  1466. Exit and restart windows
  1467. Exit and restart windows
  1468. label
  1469. --When restart is true, Windows will exit and restart.  
  1470. --If if restart is null or false, Windows will just exit.
  1471. to handle exitWindows restart
  1472.     linkDLL "user"
  1473.         INT ExitWindows (DWORD, INT)
  1474.     end linkDLL
  1475.     if restart is true
  1476.             get ExitWindows (66, 0)
  1477.     else
  1478.             get ExitWindows (67, 0)
  1479.     end 
  1480.     end 
  1481. dows (66, 0)
  1482.     else
  1483.             get ExitWindows (67, 0)
  1484.     end 
  1485.     end 
  1486.     end 
  1487. end buttonUp
  1488. nd buttonUp
  1489. nd buttonUp
  1490. Calling this handler will cause Windows to exit. You can optionally specify that Windows restarts after exiting.
  1491. Handler:    exitWindows <restart>
  1492. Parameters:
  1493. <restart>    True if you want to restart Windows
  1494. n Windows will just Exit.
  1495. origPage
  1496. original
  1497. Exit and restart windows
  1498. Get day of week from date
  1499. Get day of week from date
  1500. label
  1501. -- returns the weekday of any day beyond 1/1/1700: 
  1502. -- note: requires full year. Example: get weekDay("1/1/1993")
  1503. -- also requires isLeapYear() function below
  1504. to get dayOfWeek pdate
  1505.     -- make a list out of the date
  1506.     format date pdate as "m,d,y" from "m/d/y"
  1507.     set m to item 1 of pdate 
  1508.     set d to item 2 of pdate 
  1509.     set y to item 3 of pdate 
  1510.     -- the following list (1 item for each month) contains the 
  1511.     -- number of days that have passed before first day of 
  1512.     -- each month.
  1513.     set days to "0,31,59,90,120,151,181,212,243,273,304,334" 
  1514.     -- set numdays to number of days elapsed since 1/1/1700 
  1515.     set numdays to (y-1700) div 4-(y-1700) div 100 +(y-1600) \
  1516.      div 400 + 365 * (y - 1700) + item m of days + d -1 
  1517.     if isLeapYear(y) and m <= 2 
  1518.         decrement numdays by 1 
  1519.     end 
  1520.     set n to  (numdays-2) mod 7 +1
  1521.     return item n of \
  1522.      "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" 
  1523. -- Returns TRUE if y is a leap year, FALSE if not.
  1524. -- NOTE: this fuction requires a four digit year.
  1525. -- Example:  Find out if 1992 is a leap year.
  1526. -- if leapYear(1992)
  1527. to get isLeapYear y
  1528.     if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0))
  1529.         return TRUE
  1530.     else
  1531.         return FALSE
  1532. urn TRUE
  1533.     else
  1534.         return FALSE
  1535. This handler returns the day of the week (Monday, Tuesday, etc) from any given date since 1/1/1700. Note that you must provide a four-digit year.
  1536. Note that this function requires the handler isLeapYear, included below.
  1537. Handler:    dayOfWeek(<date>)
  1538. Parameters:
  1539. <date>        A date in this format: "1/1/1994"
  1540.         (Note a four-digit year is required.)
  1541.  year is required.)
  1542. origPage
  1543. original
  1544. Get day of week from date
  1545. isLeapYear()
  1546. isLeapYear()
  1547. label
  1548. This function returns true if a given date is a leap year, false if not. Note that it requires a four digit year.
  1549. Handler:    isLeapYear (<year>)
  1550. Parameters:
  1551. <year>:        a four-digit number representing a year
  1552. -- Returns TRUE if y is a leap year, FALSE if not.
  1553. -- NOTE: this fuction requires a four digit year.
  1554. -- Example:  Find out if 1992 is a leap year.
  1555. -- if leapYear(1992)
  1556. to get isLeapYear y
  1557.     if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0))
  1558.         return TRUE
  1559.     else
  1560.         return FALSE
  1561. origPage
  1562. original
  1563. isLeapYear()
  1564. BitwiseAND, OR, and XOR
  1565. Notify Handler
  1566. Sorting a 2-D array
  1567. intro
  1568. SubtopicName
  1569. Simple Drop Down Field
  1570. Remove trailing spaces
  1571. <Introduction>
  1572. origPage
  1573. 10,14
  1574. selectChars
  1575. original
  1576. <Introduction>
  1577. label
  1578. Introduction
  1579. This book is a library of scripts useful in OpenScript programming. 
  1580.  To go to a given topic, click a topic in the list. 
  1581.  To view topics related to a given category, choose the desired category.
  1582.  Use the search button to search for a topic by key word.
  1583.  Use the splitter bar to resize the navigation panel to the left.
  1584. Note: you can add new topics to this book by pressing F3 (to enter author mode) and using the topic buttons that appear at the lower left...tons that appear at the lower left.
  1585. Yes, this is a button.
  1586. buttonclick
  1587. buttonclick
  1588. "Yes, 
  1589. Yes, this is a button.
  1590. buttonclick
  1591. buttonclick
  1592. "Yes, 
  1593. h%|%~
  1594. out,true
  1595. ThreeDeeRect
  1596. bottomLine
  1597. topLine
  1598. OpenScript
  1599. Libraryy Base
  1600. <About this book>
  1601. Binary Insertion of Textline
  1602. scriptChooserDialog
  1603. ButtonStillDown Page Navigation
  1604. ButtonStillDown Page Navigation
  1605. These simple scripts implement multiple page navigation when the mouse button is held down. 
  1606. Handlers:       
  1607. buttonDown
  1608. buttonStillDown
  1609. No parameters
  1610.     none
  1611. ering actions (ie - called XXbuttonDown rather than buttonDown)
  1612. Handlers in this script are:
  1613.    buttonDown
  1614. Parameters are:
  1615.     none
  1616. to handle buttonDown
  1617.    go to next page 
  1618. end buttonDown
  1619. to handle buttonStillDown
  1620.        send buttondown
  1621. end buttonStillDown
  1622. tonDown
  1623. to handle XXbuttonStillDown
  1624.        send buttondown
  1625. end XXbuttonStillDown
  1626. origPage
  1627. original
  1628. ButtonStillDown Page Navigation
  1629. label
  1630. Play clip in a loop
  1631. label
  1632. Play clip in a loop
  1633. If you want to have a wave or midi file constantly repeat in the background, use the scripts below.pts
  1634. Pressing the Play Clip button will play the specified clip continuously.uously.
  1635. Clip Chooser
  1636. CdresetContents
  1637. enterpage
  1638. CdresetContents
  1639. clips
  1640. whatClip
  1641. resetContents
  1642. Stop Clip
  1643. play clips
  1644. closed
  1645. jwhatClip
  1646. Play Clip
  1647. selectChange
  1648. notifyBefore 
  1649. resetContents
  1650. notifyAfter 
  1651. [dropdownitems 
  1652.     clips = resourceList(
  1653. <> NULL
  1654. whatClip
  1655. &CRLF 
  1656. r"&"E&
  1657. dropDownItems 
  1658. selectChange
  1659. B"play 
  1660. " = "Stop 
  1661. mmStatus 
  1662. ") <> "closed"
  1663.             mmClose (
  1664. " = "Play 
  1665. D:\HOOKWORK\CLIPS.TBK
  1666. lookBook
  1667. clip "bird1"rix Logo"
  1668. clip "Asymetrix Logo"
  1669. clip "bird1"
  1670. clip "bird2"
  1671. clip "bird3"
  1672. clip "CD Audio"
  1673. clip "Chirp"
  1674. clip "lion"
  1675. clip "No No No"
  1676. clip "tiger"
  1677. clip "toad"
  1678. Play Clips
  1679. clip "bird2"
  1680. whatClip
  1681. Play Clip
  1682. Clip to play continuously
  1683. enterpage
  1684. leavePage
  1685. Navigation
  1686. Check for State Abbreviation
  1687. Auto-scroll field
  1688. origPage
  1689. original
  1690. Auto-scroll field
  1691. label
  1692. Auto-scroll field
  1693. This field's scrollbar automatically appears when necessary.
  1694. Type in the field to the right.
  1695. When appropriate, scroll bars will automatically appear.
  1696. zashowOrHideScrollbar
  1697. enterPage
  1698. zashowOrHideScrollbar
  1699. leaveField
  1700. zashowOrHideScrollbar
  1701. keyUp
  1702. zashowOrHideScrollbar
  1703. paste
  1704. zashowOrHideScrollbar
  1705. zashowOrHideScrollbar
  1706. clear
  1707. showOrHideScrollbar
  1708. notifyBefore 
  1709. showOrHideScrollbar
  1710. notifyAfter 
  1711. Something for something, nothing for nothing.788sdf
  1712. enterPage
  1713. leaveField
  1714. keyUp
  1715. paste
  1716. clear
  1717. description and example
  1718. SubtopicName
  1719. in,ms
  1720. ThreeDeeRect
  1721. bottomLine
  1722. topLine
  1723. explanation
  1724. .&,    "
  1725. scrolling
  1726. rectangle
  1727. explanation
  1728. enterpage
  1729. notifyBefore 
  1730. fref 
  1731. "explanation" 
  1732. txtOver 
  1733. 8= 0 
  1734. Example:
  1735. in,sculpted
  1736. ThreeDeeRect
  1737. bottomLine
  1738. topLine
  1739. View Scripts
  1740. author
  1741. reader
  1742. author
  1743. rectangle
  1744. enterpage
  1745. notifybefore 
  1746. author
  1747. reader
  1748. author
  1749. dotted
  1750. enterpage
  1751. notifybefore 
  1752. buttonclick
  1753. buttonclick
  1754. Copy objects
  1755. author
  1756. reader
  1757. enterpage
  1758. Search and replace in a string
  1759. As Word
  1760. label
  1761. This page contains a function that searches text for all occurrences of one string and replaces them with another. You can specify that you only want to replace the searched string if it's a whole word.
  1762. handler: searchReplace(<txt>,<searchTxt>,<replaceTxt>,<asWord>)
  1763. Parameters:
  1764. <text>:        the string you'll be searching in
  1765. <searchTxt>:    the substring you're looking for
  1766. <replaceTxt>:    the substring you want to replace for 
  1767. <as word>:    "true" if you want to replace only whole words.
  1768. Returns modified text
  1769. odified text
  1770. ext>:        the string you'll be searching in
  1771. <searchString>:    the substring you're looking for
  1772. <replaceString>:    the substring you want to replace for <searchString>
  1773. <as word>:    "true" if you want to replace only whole words.
  1774. Returns modified text
  1775. elimit = " " & tab & crlf & "-+*/<>,()[];^=&.?':" & quote 
  1776.     while runningTotal <= totalChars
  1777.         set curTxt to chars runningTotal to totalChars of txt
  1778.         curOffset = offset(searchFor,curTxt)
  1779.         if curOffset = 0
  1780.             break while
  1781.         else
  1782.             startPos = (runningTotal+curOffset-1)
  1783.             endPos = (runningTotal+curOffset+searchLen-2)
  1784.             if asWord is true
  1785.                 -- test if this occurance is an isolated word:
  1786.                 if not ((startPos = 1 or char (startPos - 1) \
  1787.                  of txt is in wordDelimit) and\
  1788.                  (endPos = totalChars or char endPos + 1 \
  1789.                  of txt is in wordDelimit))
  1790.                      increment runningTotal by curOffset+searchLen-1
  1791.                     continue while
  1792.                 end
  1793.             end
  1794.             set chars startPos to endPos of txt to replaceWith
  1795.             increment runningTotal by curOffset+replaceLen-1
  1796.             increment totalChars by replaceLen - searchLen
  1797.         end        
  1798.     return txt
  1799. replaceLen - searchLen
  1800.         end        
  1801.     return txt
  1802. Search and replace in a string
  1803. The quick red fox jumped over the lumpy log. The fox, being inquisitive by nature and not really in any hurry, stopped to examine the underside of the log in an olfactory sort of way. "Those blasted dogs," he thought to himself. "Who do they think they are?" Seconds later he was ripped to shreds.hreds.
  1804. asWord
  1805. Search Textng
  1806. Replace Textng
  1807. Search and Replace
  1808. searchReplace
  1809. searchString
  1810. replaceString
  1811. asWord
  1812. searchReplace
  1813. searchString
  1814. /searchReplace
  1815. replaceString
  1816. buttonup
  1817. "searchReplace"
  1818. searchString 
  1819. replaceString 
  1820. asWord 
  1821. rabbit
  1822. Try searching and replacing various words in the paragraph to the right. 
  1823. Note: when the As Word button is checked, only strings that exist as whole words in the text will be substituted..............
  1824. searchAndReplace
  1825. origPage
  1826. original
  1827. Search and replace in a string
  1828. Playing random sounds
  1829. label
  1830. Playing random sounds
  1831. Here is an example of playing clips at random. This could be used if you wanted to create ambient background noises.
  1832. This button will randomly play the selected clips in the background.
  1833. Play Clips
  1834. FALSE
  1835. isPlaying
  1836. delay
  1837. 1,2,3,4,5,6
  1838. clipList
  1839.  clip "tiger"
  1840. whatClip
  1841. Play Clips
  1842. Select clips to play randomly
  1843. Clip Chooser
  1844. CdresetContents
  1845. enterpage
  1846. CdresetContents
  1847. .&+    +E
  1848. clips
  1849. whatClip
  1850. default
  1851. resetContents
  1852. notifyBefore 
  1853. resetContents
  1854. notifyAfter 
  1855. e= TRUE
  1856.     clips = resourceList(
  1857. <> NULL
  1858. whatClip
  1859. SPACE&
  1860. i"&"E&
  1861.         graphic 
  1862. = bitmap (mmMediaType 
  1863. CRLF 
  1864. e= FALSE
  1865. = default
  1866.  clip "Asymetrix Logo"
  1867.  clip "No No No"
  1868.  clip "toad"
  1869.  clip "tiger"
  1870.  clip "lion"
  1871.  clip "bird3"
  1872.  clip "bird2"
  1873.  clip "bird1"
  1874.  clip "CD Audio"
  1875.  clip "Chirp"
  1876. animation
  1877. digitalVideo
  1878. bitmap
  1879. cdAudio
  1880. sequencer
  1881. photoCD
  1882. videoDisk
  1883. waveAudio
  1884. overlay
  1885. RadioButtons
  1886. play clips
  1887. delay
  1888. buttonclick
  1889. buttonclick
  1890.     delay 
  1891. B"play clips" = 
  1892. Often
  1893. Normal
  1894. 20000
  1895. Rarely
  1896. How often
  1897. enterPage
  1898. leavePage
  1899. Remove trailing spaces
  1900. Remove trailing spaces
  1901. label
  1902. This function removes all trailing spaces, as well as other undesirable characters.
  1903. Handler:    trim(<string to trim>)
  1904. Parameters:
  1905. <string to trim>    The string from which you want to remove the trailing stuff.
  1906. Returns the modified string
  1907. -- removes trailing spaces, tabs, and crlf's
  1908. to get trim strng
  1909.     local charsToDrop
  1910.     set charsToDrop to space & crlf & tab
  1911.     while charcount(strng) > 0 and last char of strng is in charsToDrop
  1912.         clear last char of strng
  1913.     return strng
  1914. origPage
  1915. original
  1916. Remove trailing spaces
  1917. -- keep 
  1918. mind that arrays are passed 
  1919. Hreference, 
  1920. Hvalue
  1921. twoDquicksort fArray[][] 
  1922. 2sortColumn,dtype
  1923. 4stbk_noSwap
  1924. twoDquicksrt 
  1925. C, 1, 
  1926. dimensions(
  1927. lo, hi,
  1928. hi > lo 
  1929. , lo, ((lo+hi) 
  1930. (lo+1) 
  1931. test 
  1932. stbk_noswap
  1933. , lo, lst-1,
  1934. +1,hi,
  1935. Ztemp
  1936. farray[a][i]
  1937. b][i]
  1938. b][i] 
  1939. -- adds the 
  1940. navigation 
  1941. -- called on 
  1942. whenever 
  1943. 1combobox value 
  1944. -- Note: each 
  1945. will be 
  1946. like such:
  1947. -- <label 
  1948. zhangs out beyond 
  1949. edge 
  1950. used 
  1951. populate 
  1952. ZallTopics
  1953. X"tb30dlg.dll"
  1954. sortTextLines(
  1955. "All"
  1956.             -- walk every 
  1957. content backgrounds, 
  1958.             -- a list 
  1959. their labels.
  1960. bckgrnds 
  1961. "intro,description 
  1962. example,
  1963. only"
  1964. backRef 
  1965. pageRef 
  1966.             -- 
  1967. numbers 
  1968. category
  1969. trailing 
  1970.     -- update 
  1971.     -- adjust 
  1972. selectedTextlines 
  1973. U, navigate 
  1974. that 
  1975. extractID(
  1976. clicked.
  1977. buttonclick 
  1978. -- ToolBook sends 
  1979. message just 
  1980. 4displaying
  1981. -- the dropdown 
  1982. a comboBox
  1983. enterDropDown
  1984. updateDropDownList
  1985. -- puts 
  1986. Fcategories 
  1987. Tlist
  1988. ZmainStruct[][]
  1989. categoryStruct 
  1990. arraySize 
  1991. dimensions(
  1992. [i][1] 
  1993. odropDownItems 
  1994. "<All 
  1995. N>" & 
  1996. a combobox 
  1997. selectChange value
  1998.  selcted 
  1999.     -- navigation 
  2000. populate "
  2001. i][1]=
  2002. amainstruct[i][2] 
  2003. -- kill 
  2004. , so 
  2005. goes 
  2006. leaveDropDown
  2007. categories 
  2008. the "prompt" 
  2009. , selecting
  2010.  current 
  2011. Mbelongs 
  2012. that 
  2013. -- category. (
  2014. Ncan 
  2015. more than one 
  2016. myID 
  2017. myTopic 
  2018. label 
  2019. "Choose 
  2020. M" && 
  2021. ZmainStruct[][]
  2022. categoryStruct 
  2023. fref 
  2024. arraySize 
  2025. dimensions(
  2026. si][1] 
  2027.         -- 
  2028. o i, 
  2029.         -- 
  2030. selectedTextLine 
  2031. itemOffset(
  2032. i][2]) > 0
  2033.         -- 
  2034. kunless we are on 
  2035. selectedTextlines 
  2036. -- update 
  2037. compileCategories
  2038. selectedTextLines 
  2039.     -- walk through 
  2040.         -- 
  2041. ) > 0
  2042.             -- 
  2043. xalready assigned, 
  2044. i][2])=0
  2045. i][2]
  2046.             -- 
  2047.             -- exists
  2048. itemLoc 
  2049. i][2])
  2050. i][2]
  2051.  structure
  2052. -- returns the weekday 
  2053. beyond 1/1/1700: 
  2054. -- note: requires full year. Example: 
  2055. weekDay("1/1/1993")
  2056. -- also 
  2057. 8isLeapYear() function below
  2058. : pdate
  2059. aa list out 
  2060. %"m,d,y" 
  2061. "m/d/y"
  2062. following 
  2063. each month) 
  2064. days that have passed 
  2065. &o "0,31,59,90,120,151,181,212,243,273,304,334" 
  2066. numdays 
  2067. ielapsed since 1/1/1700 
  2068. (y-1700) 
  2069. y4-(y-1700) 
  2070. y100 +(y-1600) \
  2071. y400 + 365 * (y - 1700) + 
  2072. + d -1 
  2073. m <= 2 
  2074. k7 +1
  2075.      "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" 
  2076. -- Returns TRUE 
  2077. a leap 
  2078. , FALSE 
  2079. -- NOTE: 
  2080. fuction 
  2081. a four digit 
  2082.  Find 
  2083. 1992 
  2084. leapYear(1992)
  2085. k4 = 0 
  2086. k100 <> 0) 
  2087. k400 = 0))
  2088. function searches txt 
  2089. occurrences 
  2090. searchString 
  2091. replaces 
  2092. freplaceString.
  2093. -- If asWord 
  2094. Conly where 
  2095. Tappears 
  2096. -- (A 
  2097. defined 
  2098. that 
  2099. preceded 
  2100. followed 
  2101. -- either 
  2102.  beginning 
  2103. -- wordDelimit 
  2104. common punctuation 
  2105. mathematical operators.)
  2106. searchReplace txt,searchFor,replaceWith,
  2107.     runningTotal = 1
  2108.     totalChars=
  2109.     searchLen=
  2110.     replaceLen=
  2111. are legally adjacent
  2112. = " " & 
  2113. k& "-+*/<>,()[];^=&.?':" & 
  2114. curTxt 
  2115.         curOffset = 
  2116.             startPos = (
  2117.             endPos = (
  2118. -- test 
  2119. occurance 
  2120. isolated 
  2121. p- 1) \
  2122. + 1 \
  2123. "hour"
  2124. "Minute"
  2125. "AMPM"
  2126. minute 
  2127. value
  2128. #+ 1) 
  2129. %"00"
  2130. %"00"
  2131.  < 0 
  2132.  > 59
  2133. outside range 0 
  2134. %"00"
  2135. k12) + 1
  2136. %"00"
  2137. %"00"
  2138.  < 1 
  2139.  > 12
  2140. &&"out 
  2141. %"00"
  2142. + 1) 
  2143. %"00"
  2144. %"00"
  2145.  < 0 
  2146.  > 59
  2147. %"00"
  2148. initialize
  2149. 4OBJECT newHotwordID
  2150. %"hh : 
  2151. j: sec 
  2152. "month"
  2153. "day"
  2154. "year"
  2155. value
  2156. ZLONG days
  2157.  = daysInMonth()
  2158. 5) + 1
  2159. %"00"
  2160. %"00"
  2161.  < 1 
  2162. outside range 1 
  2163. %"00"
  2164. k12) + 1
  2165. %"00"
  2166. %"00"
  2167.  < 1 
  2168.  > 12
  2169. &&"out 
  2170. %"00"
  2171.  + 1) 
  2172. %"00"
  2173. %"00"
  2174.  < 0 
  2175.  > 99
  2176. %"00"
  2177. initialize
  2178. 4OBJECT newHotwordID
  2179. %"mm / dd / yy" 
  2180.     m = 
  2181. m <> 2
  2182. "31,28,31,30,31,30,31,31,30,31,30,31"
  2183.         y = 
  2184. k4 = 0 
  2185. k100 <> 0) 
  2186. k400 = 0)
  2187. -- change cursor 
  2188. resize 
  2189. entering
  2190. default 
  2191. leaving
  2192. handler resizes the 
  2193. splitter 
  2194. dragged
  2195. ZstartPos
  2196. X"user"
  2197. getsystemmetrics(
  2198. ( has swapped mouse buttons.
  2199. >23) >0
  2200. leftMouseButton 
  2201. width 
  2202. navigation 
  2203. minwidth 
  2204. maxwidth 
  2205. leftWindow 
  2206. rightWindow 
  2207. leftWindowWidth 
  2208. clientSize 
  2209. wholeWindowWidth 
  2210. clientsize 
  2211. leftMost 
  2212. minWidth
  2213. rightMost 
  2214. j(maxWidth,
  2215. splitterBounds 
  2216. DC's 
  2217. ;windows, since we'll be drawing 
  2218.     -- on 
  2219. hDCLeft 
  2220. getDC(clientHandle 
  2221. hDCright 
  2222. a pen
  2223. hPen 
  2224. createPen(0,2,0)
  2225. ! on 
  2226. ;DC's, storing old selected
  2227. hOldObjectleft 
  2228. selectObject(
  2229. hOldObjectMain 
  2230. modes 
  2231. oldROP2right 
  2232. setROP2(
  2233. oldROP2left 
  2234. windowRef 
  2235. curDC 
  2236. oldP 
  2237. mousePosition 
  2238. oldp <> 
  2239.             -- erase 
  2240. drawLine 
  2241. ,endPos
  2242. we need 
  2243. switch 
  2244. DC's, release them
  2245. deleteObject(
  2246. releaseDC(
  2247. hDCleft
  2248. RightBorder 
  2249. currentpage 
  2250. leftwindow 
  2251. syspageUnitsPerPixel
  2252. sizePage
  2253. -- draws a 
  2254. specified DC
  2255. endpos 
  2256. fromPoint 
  2257. PageUnitsToClient(
  2258. toPoint 
  2259. moveTo(
  2260. lineTo(
  2261.  Standard ToolBook messages 
  2262. enterApplication
  2263.     -- link needed dll's
  2264.     linkDLL "tb30win.
  2265. displayBitsPerPixel()
  2266.     -- these gdi calls are used 
  2267. drawing separator 
  2268. getDeviceCaps(
  2269. moveTo(
  2270. lineTo(
  2271. setROP2(
  2272. gcreatePen(
  2273. deleteObject(
  2274. gselectObject(
  2275. Xuser
  2276. ggetDC(
  2277. releaseDC(
  2278. e"Using 
  2279. &Template" alias "helpTemplate" 
  2280. fhelptext\
  2281.          "Displays 
  2282. 4 on 
  2283. template."
  2284. backcolor (a "
  2285. " handler, below) depending on
  2286.     -- the 
  2287. colors displayed.
  2288. numColors()
  2289. > 16 
  2290. darkerBlue()
  2291. lighterBlue()
  2292. "navigationBar"
  2293.         -- initialize combobox 
  2294. "categories" 
  2295. "<All 
  2296. populate "
  2297. "Topics"
  2298. hideControls
  2299. leaveApplication
  2300. buttons 
  2301. modifying 
  2302. showControls
  2303. "CategoryButtons" 
  2304. "Navigation"
  2305. 7 - 60
  2306. deleted, updates 
  2307. category array (struct[][]) userProperty 
  2308.     -- Each row 
  2309. Bhas 
  2310. a list
  2311. numbers 
  2312. belonging 
  2313. that 
  2314. }. This 
  2315.     -- walks through 
  2316. , finding every instance 
  2317. found, 
  2318. removes 
  2319. "description 
  2320. example,
  2321. only"
  2322. Zx[][]
  2323. categoryStruct 
  2324. pageID 
  2325. dimensions(x)
  2326. itemOffset(
  2327. 7,x[i][2])
  2328. x[i][2]
  2329. a content 
  2330.         -- 
  2331. ensure 
  2332. label property
  2333.         -- 
  2334.  holds 
  2335. each 
  2336. fref 
  2337. "subTopicName" 
  2338.         -- 
  2339. necessary
  2340. "explanation"
  2341.         -- 
  2342. scrollbars, 
  2343. txtOver 
  2344. ;= 0 
  2345.  Utility handlers 
  2346. -- returns 
  2347. extractName t
  2348. tabOffset 
  2349. following a 
  2350. extractID t
  2351. lastTabLoc 
  2352. U(t) 
  2353. instances 
  2354. stripChar chr,strng
  2355.     hdc = 
  2356. windowhandle 
  2357.     retval = 
  2358. %,24)
  2359. 212,79.1875,71.6875
  2360. 180,75.125,100
  2361. backColor 
  2362. value
  2363. bckgrnds 
  2364. "intro,
  2365. curBack 
  2366.  Handlers 
  2367. dealing 
  2368. structure 
  2369. during authoring 
  2370. debugging purposes)
  2371. showCategoryStruct
  2372. Zx[][]
  2373. x[i][1] 
  2374. 9& x[i][2] & 
  2375. handers 
  2376. twoDquicksort fArray[][],n,dtype
  2377. 4stbk_noSwap
  2378. twoDquicksrt 
  2379. 6, 1, 
  2380. E),n,
  2381. U l, r,n,
  2382. r > l 
  2383. x, l, ((l+r) 
  2384. (l+1) 
  2385. test 
  2386. i][n] < 
  2387. l][n] 
  2388. i][n] < 
  2389. l][n] 
  2390. i][n] < 
  2391. l][n] 
  2392. stbk_noswap
  2393. , l, 
  2394. -1,n,
  2395. , lst+1,r,n,
  2396.  a, b
  2397. farray[a][i]
  2398. b][i]
  2399. b][i] 
  2400.     mydir = 
  2401.     sen = sysErrorNumber
  2402.     se = 
  2403.     ss = 
  2404.     bref = 
  2405. u&"tmplhelp.tbk")
  2406. 1= ss
  2407. "Cannot 
  2408. 8TMPLHELP.TBK"
  2409.         vref = 
  2410. defaultpage 
  2411. "cbt4" 
  2412. r= se
  2413. notifyBefore 
  2414. resetContents 
  2415. notifyAfter 
  2416.     linkDLL "tb30dlg.dll"
  2417.         STRING     listToTextline    (
  2418.     linkdLL "tb30win.
  2419. 4    GetWinIniVar    (
  2420. [dropdownItems 
  2421.     soundList = getWinIniVar("sounds","")
  2422. -ds",
  2423. P&TAB&
  2424. ~&CRLF 
  2425.         selectedItem 
  2426.         whatWave = 
  2427. dropdownitems 
  2428. "filename" = 
  2429.     unlinkDLL function 
  2430. selectChange whatText
  2431. buttonclick loc, isShift
  2432.     linkdLL "tb30win.dll"
  2433.         STRING    SetWinIniVar    (
  2434. 8dlg.
  2435. +OpenFileDlg    (
  2436. C,INT)
  2437.     whatItem = 
  2438. combobox "clip chooser"
  2439.     path=pathFromFile(
  2440. "filename")
  2441.     newFile = 
  2442. ("Select wavefile 
  2443. ,fileFromPath(
  2444. [,"Wave,*.
  2445. .", 1)
  2446. ("sounds",
  2447. r&","&
  2448. resetContents 
  2449.     unlinkDLL function 
  2450. "tb30dlg.
  2451. Vi+1 
  2452. pointerObj
  2453. "hand" 
  2454. dialPos
  2455. angle 
  2456. rotation 
  2457. dialMin 
  2458. dialMax 
  2459. startAngle 
  2460. endAngle 
  2461. angleRange 
  2462. value
  2463. syssuspendMessages 
  2464. coords 
  2465. "face" 
  2466. +)/2,\
  2467. angleFromPoint 
  2468. (((Atan2(y-cy,x-cx)+2.5*
  2469. )/(2*
  2470. ))*360) 
  2471.     LOCAL INT outValue
  2472. dialMove 
  2473. endDialMove 
  2474. )/2,\
  2475. (ctr,
  2476. dstart 
  2477. +360))
  2478. dend 
  2479. 3> 180
  2480. k360 > 
  2481. k360)
  2482. notifyAfter 
  2483. enddialMove 
  2484. numTics 
  2485. syssuspendmessages 
  2486. )/2,\
  2487. radius 
  2488. ) - (
  2489. ))/2 
  2490. tallTicSpacing 
  2491. )/360 * (2 * PI) - (PI / 2)
  2492. <= 10
  2493. curField 
  2494. curfield 
  2495. 500,200
  2496. centerPosition 
  2497. + ((1+sz*2) * 
  2498. + ((1+sz*2) * 
  2499. )*(i/
  2500. )), \
  2501. + ((1+sz) * 
  2502. + ((1+sz) * 
  2503. myNumTics 
  2504. mydialMax 
  2505. dialmin 
  2506. mydialMin 
  2507. myTallTicSpacing 
  2508. numtics 
  2509. myStartAngle 
  2510. myendAngle 
  2511. -- General 
  2512. handler.
  2513. -- Supports 
  2514. single 
  2515. -- Joseph Brick, Oct 93.
  2516. -- Notes about 
  2517. routine:
  2518. -- ToolBook allows unrestricted values 
  2519. the following 
  2520. . This 
  2521. b fully 
  2522. -- rotates these 
  2523. }. All other 
  2524. }are oriented along a 90 degree 
  2525. -- axis. 
  2526.  just moves 
  2527. }around 
  2528. Owithout
  2529. -- rotating their 
  2530. -- A note on storing polar coordinates: 
  2531. order 
  2532.  converts 
  2533. Cartesian 
  2534. -- (stored 
  2535. %integers) 
  2536. g (manipulated 
  2537. %real numbers),
  2538. When converted 
  2539. acan suffer
  2540. rounding errors 
  2541. {may become more 
  2542. skewed each
  2543. Iyou 
  2544. To avoid 
  2545. routines 
  2546. -- change 
  2547. shape 
  2548. its distance 
  2549. running 
  2550. option, 
  2551. will have 
  2552. reset the
  2553. Hsending 
  2554. storePolar 
  2555. -- Parameters:
  2556. -- obj:
  2557. Object 
  2558. be rotated.
  2559. Can use 
  2560. toolbook 
  2561. {. Required.
  2562. -- ctr:
  2563. which 
  2564. O. Default 
  2565. structInfo[]
  2566. xangle,yangle,radians,cx,cy,radAngle,MouseAngle,longestH,storedAngle
  2567. x,y,fp
  2568. Zstack v,vtemp,loc
  2569. Zgraphic curObj
  2570. myRotation 
  2571.     -- If 
  2572. xprovided, base 
  2573. b + (
  2574. b + (
  2575. a list 
  2576. objlist 
  2577. total 
  2578. vCount 
  2579. objCount 
  2580.     -- loop goes once 
  2581. curObjType 
  2582.         -- If 
  2583.         -- 
  2584. kover:
  2585. objList
  2586.             -- 
  2587. fsetable 
  2588. maliable 
  2589. isArcOrPie 
  2590. b + (
  2591. b + (
  2592. curVCount 
  2593.             -- Add 
  2594. {reference 
  2595.             -- 
  2596.             -- walk through 
  2597. current 
  2598. y distances 
  2599. -- find length 
  2600. vector:
  2601. undefined 
  2602. )x=0,y=0:
  2603. dx=0 
  2604. (dx,dy)
  2605. +(dy,dx)- (rot/360)*(2*
  2606. [vcount+i][1] 
  2607.     array 
  2608. fa row 
  2609.     -- Each 
  2610. stores a 
  2611.  vertice.
  2612. ns,cx,cy,
  2613. x,y,fp
  2614. O     supplied 
  2615. /360) * 2*
  2616. b + (
  2617. b + (
  2618. they 
  2619. already 
  2620. propsStored 
  2621. uprops 
  2622. I,ctr
  2623. section 
  2624. resets 
  2625.  repetition specified:
  2626.             -- 
  2627.             -- adjust 
  2628. Hnewangle, 
  2629. x,y coorinates:
  2630. countV 
  2631. curIndex 
  2632. ][2]+
  2633. 0][1]
  2634. x(j = 1 
  2635. (rd)*h 
  2636. f(rd)*h 
  2637. cxObj 
  2638. cyObj 
  2639. (rd)*h 
  2640. f(rd)*h 
  2641. iterate 
  2642. sized
  2643. sysSuspendMessages 
  2644. b(sz),
  2645. b(sz)
  2646. buttonClick
  2647.     whatClip = 
  2648. combobox "clip chooser"
  2649. $NULL
  2650. "Please 
  2651. xmmPlayable 
  2652. "This 
  2653. Smay cannot be played 
  2654.     oldTimeFormat = mmTimeFormat 
  2655.     channels = 
  2656.     samples = 
  2657.  rate"
  2658.     bitsPer = 
  2659.     startSpot = mmBeginPoint 
  2660.     stopSpot = mmEndPoint 
  2661. callMCI("
  2662. qtype waveaudio alias waveFile buffer 5","")
  2663. " && 
  2664. 0samplespersec" && 
  2665. Qitspersample" && 
  2666. tinput","")
  2667. record 
  2668. ","")
  2669. ","")
  2670. cTRUE
  2671. ("Enter a file 
  2672. fileName 
  2673. FALSE
  2674. filename && "already exists.
  2675. Try a different 
  2676. f"&OK" 
  2677. "&Cancel"
  2678. && " 
  2679. f"&OK" 
  2680. " && 
  2681. "Would you like 
  2682. hear" && 
  2683. && "now?" 
  2684. f"OK" 
  2685. close 
  2686. default
  2687. -- Displays 
  2688. scripted 
  2689. }on the 
  2690. allowing users
  2691. their scrips
  2692. buttonclick
  2693. Zretval
  2694. sysRuntime = 
  2695. "Scripts cannot be viewed 
  2696. qruntime version 
  2697. Multimedia ToolBook."
  2698.         -- 
  2699. reference 
  2700. appear 
  2701. dlgPage 
  2702. "scriptChooserDialog"
  2703.         -- 
  2704. list 
  2705. getObjectList(
  2706. currentobject
  2707. nameRef(currentObject) & 
  2708. ) = 1
  2709. obref 
  2710. "scriptObjects" 
  2711. %modal
  2712. -- display "friendly 
  2713. obtype 
  2714. obname 
  2715. --    Charlie Hiestand    6/94
  2716. -- MIDI expects a 
  2717. code (status 
  2718. 2 data bytes
  2719. each MidiOutShortMsg(). Windows 
  2720. see these 
  2721. 5 packed 
  2722. a dWord
  2723. -- analogous 
  2724. $ way 
  2725. :packs colors.
  2726. wants 
  2727. M high nibble 
  2728. f channel 
  2729. F, depending on 
  2730. , one 
  2731. -- Table 
  2732. "Channel Voice Messages":
  2733. --             
  2734.         +    low 
  2735. -- 0x80 = note off,
  2736. ,         volume
  2737. -- 0x90 = 
  2738. 1,         
  2739.       N.B. 
  2740. ) = 0 == 
  2741. -- 0xA0 = poly key pressure 
  2742. value
  2743. -- 0xB0 = control change,     
  2744. -- 0xC0 = program 
  2745. -- 0xD0    = 
  2746. -- 0xE0 = pitch bend,        
  2747.             lsb 
  2748. ,    msb 
  2749. can take a 
  2750.  0 - 15; 
  2751. : 0 - 127; 
  2752. : 0 - 127; 
  2753. : 0 - 127
  2754. : 0 - 120; 
  2755. : 0 - 127
  2756. -- This 
  2757. only uses 0x80, 0x90, 
  2758. -- For more information, 
  2759. standard 
  2760. specification
  2761. {    loc, isShift, isCtrl
  2762. 4    INT s_hMidiOut, s_program, s_channel, s_note, s_volume 
  2763. ZSTACK objs
  2764.     -- initialize parameters
  2765. V" -- try changing 
  2766. 's great fun
  2767. w = 0 -- 
  2768. won't 
  2769. zmuch
  2770. " -- kind 
  2771. like, which 
  2772. on a piano
  2773. = 127 -- 
  2774. , how hard 
  2775.  -- panic 
  2776. openMIDI
  2777. device
  2778. playMIDI
  2779. stopMIDI
  2780.  the 
  2781. that 
  2782. comment 
  2783. your 
  2784.     -- packDword 
  2785. a function found later 
  2786. thing, 
  2787. message 
  2788. actually plays 
  2789. "Unable 
  2790. 4    s_device, 
  2791. Z    pMem
  2792. X"KERNEL"
  2793.         WORD     GlobalAlloc        (
  2794. ,DWORD)
  2795.         POINTER    GlobalLock        (
  2796. 7Handle        (
  2797. H    GlobalUnlock        (
  2798. _    GlobalFree        (
  2799. linkDLL
  2800. X"mmsystem.dll"
  2801.     midiOutOpen        (
  2802.     MidiOutReset        (
  2803.     MidiOutClose        (
  2804.     MidiOutGetNumDevs    ()
  2805. closeMIDI
  2806. %() <= 0
  2807. devices 
  2808.  = getWinPointer(32)
  2809. MidiOutOpen(
  2810. ,0,0,0,0)
  2811. freeWinPointer(
  2812.  <> NULL
  2813.  nSize
  2814.     hMem
  2815. Z            retValue
  2816. X = GlobalHandle(
  2817. packDWord a, b, c
  2818. a + (b * 256) + (c * 65536)
  2819. notifyAfter 
  2820. buttonClick
  2821.     whatClip = 
  2822. combobox "clip chooser" 
  2823. %<> NULL
  2824. (whatclip && "
  2825. 8" && 
  2826. & (whatBook 
  2827. =) & 
  2828. "Please 
  2829. xmmPlayable 
  2830. "The specified 
  2831. annot be played 
  2832. mmStatus 
  2833. "playing"
  2834.         mmStop 
  2835. X"tb30win.dll"
  2836.             INT mmYieldApp    ()
  2837.         mmVolume 
  2838. "display"*2
  2839. notify 
  2840. notifyAfter dialMove value
  2841. mmNotify
  2842. Xfunction "
  2843. notifyBefore 
  2844. buttonClick
  2845. selectedtextlines 
  2846. "clip chooser" = NULL
  2847. "Please 
  2848.     isPlaying 
  2849. = FALSE
  2850.  Clips"
  2851. = "Stop 
  2852. timerNotify 
  2853. timerId 
  2854. timerStop(
  2855.             timerID 
  2856. notifyBefore 
  2857.     mmClose 
  2858. mmnotify whatClip, whatCommand, whatStatus
  2859.  = "mmplay" 
  2860.  = "successful" 
  2861. = timerStart("single",
  2862. (delay 
  2863. ),500,
  2864. timernotify
  2865.     whatLines = 
  2866.     howMany = 
  2867.     whichOne = 
  2868. (howmany) 
  2869. mmPlayable 
  2870. &&"could 
  2871. xbe played."
  2872. buttonClick
  2873.     whatClip = 
  2874. combobox "clip chooser"
  2875. 1NULL
  2876. "Please 
  2877. xmmPlayable 
  2878. "The specified 
  2879. iannot be played 
  2880. = "Stop 
  2881. mmStatus 
  2882. ) = "p"
  2883.         mmStop (
  2884. "closed"
  2885.             mmOpen 
  2886. mmMediaType 
  2887. "cdAudio"
  2888. "waveAudio"
  2889. "sequencer"
  2890. mmplay 
  2891. notify 
  2892. hold 
  2893. mmnotify 
  2894. , whatCommand, whatStatus
  2895.  = "successful" 
  2896. notifyBefore 
  2897. <> CLOSED
  2898.         mmClose 
  2899. notifyAfter 
  2900. stbk_noSwap
  2901. |CtwoDquicksrt
  2902. twoDquicksort
  2903. stbk_noSwap
  2904. |CtwoDquicksrt
  2905. twoDquicksrt
  2906. .&,    #>
  2907. ,%H.%
  2908. .&,    #>
  2909. .&+    +
  2910. bckgrnds
  2911. extractID
  2912. tb30dlg.dll
  2913. intro,description and script,description and example,description only
  2914. pageRef
  2915. wsortTextLines
  2916. sortTextLines
  2917. backRef
  2918. label
  2919. populate
  2920. extractID
  2921. buttonclick
  2922. HHupdateDropDownList
  2923. enterDropDown
  2924. <All topics>
  2925. categoryStruct
  2926. updateDropDownList
  2927. topics
  2928. <All topics>
  2929. Tvpopulate
  2930. categoryStruct
  2931. selectChange
  2932. leaveDropDown
  2933. myTopic
  2934. itemOffset
  2935. prompt
  2936. categories
  2937. Choose categories for topic
  2938. categoryStruct
  2939. label
  2940. enterPage
  2941. itemOffset
  2942. categories
  2943. itemLoc
  2944. categoryStruct
  2945. categoryStruct
  2946. compileCategories
  2947. 0,31,59,90,120,151,181,212,243,273,304,334
  2948. m,d,y
  2949. isLeapYear
  2950. Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday
  2951. m/d/y
  2952. weekDay
  2953. ,!JdY
  2954. FALSE
  2955. isLeapYear
  2956. false
  2957. wordDelimit
  2958. curTxt
  2959. -+*/<>,()[];^=&.?':
  2960. searchReplace
  2961. hotword
  2962. seconds
  2963. Minute
  2964. buttonup
  2965. decrement
  2966. minute
  2967. increment
  2968. is outside range 0 to 59
  2969. minute
  2970. minute
  2971. minute
  2972. minute
  2973. decrement
  2974. increment
  2975. out of range 1 to 12
  2976. decrement
  2977. out of range 00 to 59
  2978. ;seconds
  2979. increment
  2980. seconds
  2981. seconds
  2982. seconds
  2983. seconds
  2984. hh : min : sec AMPM
  2985. seconds
  2986. minute
  2987. newHotwordID
  2988. initialize
  2989. hotword
  2990. newHotwordID
  2991. hotword
  2992. month
  2993. buttonup
  2994. .%,    #?
  2995. decrement
  2996. daysInMonth
  2997. is outside range 1 to
  2998. increment
  2999. decrement
  3000. month
  3001. increment
  3002. month
  3003. out of range 1 to 12
  3004. month
  3005. month
  3006. month
  3007. decrement
  3008. increment
  3009. out of range 00 to 99
  3010. month
  3011. mm / dd / yy
  3012. newHotwordID
  3013. initialize
  3014. 31,28,31,30,31,30,31,31,30,31,30,31
  3015. month
  3016. daysInMonth
  3017. hotword
  3018. newHotwordID
  3019. resize
  3020. mouseEnter
  3021. default
  3022. mouseLeave
  3023. selectObject
  3024. curDC
  3025. deleteObject
  3026. splitterBounds
  3027. endPos
  3028. getDC
  3029. hDCright
  3030. createPen
  3031. }releaseDC
  3032. splitter
  3033. hOldObjectleft
  3034. getsystemmetrics
  3035. leftWindow
  3036. oldROP2left
  3037. minwidth
  3038. rightWindow
  3039. gsizePage
  3040. -setROP2
  3041. getsystemmetrics
  3042. oldROP2right
  3043. windowRef
  3044. hOldObjectMain
  3045. hDCLeft
  3046. edrawLine
  3047. leftMost
  3048. maxwidth
  3049. wholeWindowWidth
  3050. rightMost
  3051. RightBorder
  3052. buttondown
  3053. lineTo
  3054. fromPoint
  3055. y!moveTo
  3056. toPoint
  3057. drawLine
  3058. "hideControls
  3059. helpTemplate
  3060. reader
  3061. displayBitsPerPixel
  3062. tb30win.dll
  3063. Using this &Template
  3064. false
  3065. Displays help on using this template.
  3066. categories
  3067. lighterBlue
  3068. getDC
  3069. releaseDC
  3070. Topics
  3071. numColors
  3072. darkerBlue
  3073. <All topics>
  3074. navigationBar
  3075. backcolor
  3076. Tvpopulate
  3077. getDeviceCaps
  3078. moveTo
  3079. lineTo
  3080. setROP2
  3081. ,"TkNo
  3082. createPen
  3083. deleteObject
  3084. selectObject
  3085. enterApplication
  3086. helpTemplate
  3087. leaveApplication
  3088. CshowControls
  3089. author
  3090. 1,!J<Y
  3091. topics
  3092. CategoryButtons
  3093. Navigation
  3094. showControls
  3095. "hideControls
  3096. reader
  3097. topics
  3098. CategoryButtons
  3099. Navigation
  3100. hideControls
  3101. itemOffset
  3102. description and script,description and example,description only
  3103. pageID
  3104. categoryStruct
  3105. categoryStruct
  3106. destroy
  3107. .&,    "
  3108. subTopicName
  3109. description and script,description and example,description only
  3110. scrolling
  3111. explanation
  3112. label
  3113. enterPage
  3114. subTopicName
  3115. description and script,description and example,description only
  3116. label
  3117. topic
  3118. label
  3119. leavePage
  3120. extractName
  3121. extractID
  3122. ,%H.%
  3123. itemOffset
  3124. stripChar
  3125. }releaseDC
  3126. 4getDeviceCaps
  3127. getDC
  3128. retval
  3129. numColors
  3130. Q@darkerBlue
  3131. R@lighterBlue
  3132. bckgrnds
  3133. intro,description and script,description and example,description only
  3134. curBack
  3135. backColor
  3136. categoryStruct
  3137. showCategoryStruct
  3138. stbk_noSwap
  3139. |CtwoDquicksrt
  3140. twoDquicksort
  3141. stbk_noSwap
  3142. |CtwoDquicksrt
  3143. twoDquicksrt
  3144. .&,    "
  3145. Cannot find book TMPLHELP.TBK
  3146. mydir
  3147. tmplhelp.tbk
  3148. helpTemplate
  3149. CdresetContents
  3150. enterpage
  3151. CdresetContents
  3152. 1,    #>
  3153. 1,    #>
  3154. ,%H.%
  3155. soundList
  3156. tb30win.dll
  3157. tb30dlg.dll
  3158. listToTextline
  3159. whatWave
  3160. GetWinIniVar
  3161. sounds
  3162. listToTextline
  3163. sound
  3164. GetWinIniVar
  3165. *getWinIniVar
  3166. filename
  3167. resetContents
  3168. filename
  3169. whatWave
  3170. selectChange
  3171. filename
  3172. tb30win.dll
  3173. Wave,*.wav
  3174. tb30dlg.dll
  3175. clip chooser
  3176. fileFromPath
  3177. SetWinIniVar
  3178. OpenFileDlg
  3179. sounds
  3180. Select wavefile for
  3181. newFile
  3182. OpenFileDlg
  3183. whatItem
  3184. 5SetWinIniVar
  3185. pathFromFile
  3186. CdresetContents
  3187. OpenFileDlg
  3188. SetWinIniVar
  3189. buttonclick
  3190. pathFromFile
  3191. fileFromPath
  3192. pointerObj
  3193. ={rotation
  3194. pointerObj
  3195. angle
  3196. dialMax
  3197. startAngle
  3198. endAngle
  3199. /dialMax
  3200. dialMin
  3201. QendAngle
  3202. startAngle
  3203. 1-dialMin
  3204. dialPos
  3205. pointerObj
  3206. angle
  3207. startAngle
  3208. dialMax
  3209. endAngle
  3210. /dialMax
  3211. dialMin
  3212. QendAngle
  3213. startAngle
  3214. coords
  3215. 1-dialMin
  3216. >{rotation
  3217. dialPos
  3218. angleFromPoint
  3219. pointerObj
  3220. endDialMove
  3221. angle
  3222. >9dialPos
  3223. |angleFromPoint
  3224. startAngle
  3225. dialMax
  3226. endAngle
  3227. /dialMax
  3228. 9adialMove
  3229. >{rotation
  3230. dialMin
  3231. QendAngle
  3232. startAngle
  3233. coords
  3234. 1-dialMin
  3235. Field
  3236. buttondown
  3237. dialMove
  3238. enddialMove
  3239. .&,    "
  3240. C333333
  3241. C333333
  3242. centerPosition
  3243. curField
  3244. startAngle
  3245. dialMax
  3246. endAngle
  3247. /dialMax
  3248. mtallTicSpacing
  3249. myNumTics
  3250. dialMin
  3251. QendAngle
  3252. startAngle
  3253. coords
  3254. 1-dialMin
  3255. numTics
  3256. centerPosition
  3257. LnumTics
  3258. mydialMax
  3259. LnumTics
  3260. dialMax
  3261. mydialMin
  3262. LnumTics
  3263. LnumTics
  3264. dialmin
  3265. mydialMax
  3266. dialMax
  3267. mydialMin
  3268. dialMin
  3269. myTallTicSpacing
  3270. Lnumtics
  3271. Lnumtics
  3272. tallTicSpacing
  3273. .myStartAngle
  3274. Lnumtics
  3275. Lnumtics
  3276. startAngle
  3277. Lnumtics
  3278. myendAngle
  3279. Lnumtics
  3280. endAngle
  3281. myNumTics
  3282. numTics
  3283. .myStartAngle
  3284. startAngle
  3285. myendAngle
  3286. endAngle
  3287. myTallTicSpacing
  3288. tallTicSpacing
  3289. Q+struct
  3290. objlist
  3291. group
  3292. myRotation
  3293. structInfo
  3294. myRotation
  3295. curObjType
  3296. arc,pie
  3297. line,curve,angledline,polygon,irregularPolygon,pie,arc
  3298. storePolar
  3299. myRotation
  3300. rotation
  3301. false
  3302. propsStored
  3303. group
  3304. uprops
  3305. myRotation
  3306. objlist
  3307. structInfo
  3308. maliable
  3309. Q+struct
  3310. storePolar
  3311. structInfo
  3312. curObjType
  3313. struct
  3314. P+struct
  3315. arc,pie
  3316. rotation
  3317. pointerObj
  3318. Lnumtics
  3319. structInfo
  3320. Q+struct
  3321. Lnumtics
  3322. sized
  3323. .&+    +E
  3324. .&+    +E
  3325. cancel
  3326. samples
  3327. Enter a file name for this wave file.
  3328. Cancel
  3329. sample rate
  3330. &Cancel
  3331. record waveFile
  3332. Please choose a clip first.
  3333.  Try a different name?
  3334. save waveFile
  3335. oldTimeFormat
  3336. clip chooser
  3337. This clip may cannot be played at this time.
  3338. stopSpot
  3339. Would you like to hear
  3340. whatClip
  3341. already exists.  Try a different name?
  3342. set waveFile channels
  3343. bitsPer
  3344. channels
  3345. close waveFile
  3346. bits/sample
  3347. play waveFile from 0 wait
  3348. set waveFile bitspersample
  3349. set waveFile samplespersec
  3350. open new type waveaudio alias waveFile buffer 5
  3351. stop waveFile
  3352. startSpot
  3353. cue waveFile input
  3354. default
  3355. fileName
  3356. buttonClick
  3357. obref
  3358. dlgPage
  3359. -nameRef
  3360. Scripts cannot be viewed when using the runtime version of Multimedia ToolBook.
  3361. scriptObjects
  3362. scriptChooserDialog
  3363. currentobject
  3364. buttonclick
  3365. obtype
  3366. obname
  3367. nameRef
  3368. $b7    d
  3369. copenMIDI
  3370. program
  3371. s_note
  3372. hplayMIDI
  3373. s_channel
  3374. s_program
  3375. s_hMidiOut
  3376. s_volume
  3377. buttonDown
  3378. tstopMIDI
  3379. buttonUp
  3380. +",!Y
  3381. +",!Y
  3382. packDword
  3383. s_channel
  3384. s_note
  3385. Unable to play MIDI device
  3386. MidiOutShortMsg
  3387. s_program
  3388. s_hMidiOut
  3389. s_volume
  3390. playMIDI
  3391. +",!Y
  3392. packDword
  3393. s_channel
  3394. s_note
  3395. Unable to stop MIDI device
  3396. MidiOutShortMsg
  3397. s_hMidiOut
  3398. s_volume
  3399. stopMIDI
  3400. freeWinPointer
  3401. $bgetWinPointer
  3402. midiOutOpen
  3403. MidiOutShortMsg
  3404. MidiOutReset
  3405. MidiOutClose
  3406. MidiOutGetNumDevs
  3407. MidiOutOpen
  3408. GlobalAlloc
  3409. GlobalLock
  3410. GlobalHandle
  3411. GlobalUnlock
  3412. GlobalFree
  3413. mmsystem.dll
  3414. KERNEL
  3415. closeMIDI
  3416. s_hMidiOut
  3417. Unable to open MIDI device
  3418. MidiOutGetNumDevs
  3419. No MIDI devices found
  3420. openMIDI
  3421. s_device
  3422. B%MidiOutClose
  3423. s_hMidiOut
  3424. u0MidiOutReset
  3425. closeMIDI
  3426. GlobalAlloc
  3427. GlobalLock
  3428. getWinPointer
  3429. GlobalUnlock
  3430. GlobalFree
  3431. GlobalHandle
  3432. freeWinPointer
  3433. packDWord
  3434. copenMIDI
  3435. enterPage
  3436. copenMIDI
  3437. reader
  3438. closeMIDI
  3439. leavePage
  3440. closeMIDI
  3441. author
  3442. w,    #>
  3443. mmYieldApp
  3444. of book
  3445. tb30win.dll
  3446. Please choose a clip first.
  3447. Stop Clip
  3448. clip chooser
  3449. bmwhatBook
  3450. whatClip
  3451. whatClip
  3452. The specified clip cannot be played at this time.
  3453. playing
  3454. display
  3455. Play Clip
  3456. buttonClick
  3457. mmYieldApp
  3458. clip chooser
  3459. whatClip
  3460. playing
  3461. dialMove
  3462. tb30win.dll
  3463. mmYieldApp
  3464. Play Clip
  3465. mmNotify
  3466. Play Clip
  3467. enterPage
  3468. FALSE
  3469. Please choose a clip first.
  3470. Play Clips
  3471. clip chooser
  3472. Stop Clips
  3473. isPlaying
  3474.     timerNotify
  3475. :timerId
  3476. :timerID
  3477. buttonClick
  3478. Play Clips
  3479. enterPage
  3480. Play Clips
  3481. leavePage
  3482. w,$"[
  3483. delay
  3484. Stop Clips
  3485. successful
  3486. single
  3487. :timerID
  3488. mmplay
  3489. mmnotify
  3490. whatLines
  3491. Play Clips
  3492. clip chooser
  3493. whatClip
  3494. could not be played.
  3495. :timerId
  3496. :timerID
  3497. timernotify
  3498. waveAudio
  3499. Stop Clip
  3500. Please choose a clip first.
  3501. cdAudio
  3502. sequencer
  3503. clip chooser
  3504. jwhatClip
  3505. whatClip
  3506. The specified clip cannot be played at this time.
  3507. closed
  3508. jwhatClip
  3509. Play Clip
  3510. buttonClick
  3511. waveAudio
  3512. Stop Clip
  3513. cdAudio
  3514. successful
  3515. sequencer
  3516. mmplay
  3517. mmnotify
  3518. CLOSED
  3519. whatClip
  3520. jwhatClip
  3521. Play Clip
  3522. leavePage
  3523. Play Clip
  3524. enterPage
  3525. jwhatClip
  3526. Using system sounds
  3527. label
  3528. Using system sounds
  3529. This example shows you how you can add and change your Windows system sounds using openscript.
  3530. The combobox on the right allows you to choose from your Windows system sounds. The field below it shows the file associated with the selected sound.
  3531. To change the file associated with a sound, press the button at the end of the field.
  3532. To test the sound, press the Play Sound button.
  3533. clip chooser
  3534. Asterisk                    ,C:\MMFILES\SOUND\FX\BLOCKS.WAV                    ,SystemAsteriskmation
  3535. Asterisk                    ,C:\MMFILES\SOUND\FX\BLOCKS.WAV                    ,SystemAsterisk
  3536. Critical Stop                    ,c:\mmfiles\sound\fx\blast.wav                    ,SystemHand
  3537. Default Beep                    ,c:\mmfiles\sound\fx\pop.wav                    ,SystemDefault
  3538. Exclamation                    ,c:\mmfiles\sound\fx\doorbell.wav                    ,SystemExclamation
  3539. Incoming Call                    ,c:\mmfiles\sound\fx\bikehrn1.wav                    ,RingIn
  3540. MailBeep                    ,c:\mmfiles\sound\fx\bikehrn1.wav                    ,MailBeep
  3541. Outgoing Call                    ,c:\windows\ringout.wav                    ,RingOut
  3542. Question                    ,c:\windows\ding.wav                    ,SystemQuestion
  3543. Windows Exit                    ,C:\MMFILES\SOUND\SHUTDOWN\DROPIMP2.WAV                    ,SystemExit
  3544. Windows Start                    ,C:\MMFILES\SOUND\STARTUP\CARSTART.WAV                    ,SystemStart
  3545. Play Clips
  3546. filename
  3547. buttonClick
  3548. buttonClick
  3549. playSound(
  3550. "filename")
  3551. clip "bird2"
  3552. whatClip
  3553. Play Sound
  3554. System Sounds
  3555. filename
  3556. filename
  3557. C:\MMFILES\SOUND\FX\BLOCKS.WAV
  3558. Associated wave file
  3559. enterpage
  3560. Check for State Abbreviation
  3561. origPage
  3562. original
  3563. Check for State Abbreviation
  3564. label
  3565. Check for State Abbreviationr
  3566. This function tests a string to determine if it contains a valid U.S. state abbreviation.
  3567. Handler:  isState (<state>)
  3568. Parameters:
  3569. <state>: the string to check
  3570. Returns true if state is a valid abbreviation, false if not.
  3571.    true    string is a valid state abbreviation
  3572.    false    string is not a valid state abbreviationnnnnnnnnn
  3573. to get isState stateToCheck
  3574.     --The bars serve as item separators and to ensure that 
  3575.     --string is correct length, in this case two characters.
  3576.     get "|" & stateToCheck & "|"
  3577.     if it is in "|AL|AK|AZ|AR|CA|CO|CT|DE|DC|FL|GA|HI|ID|IL|"&\
  3578.      "IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|"&\
  3579.      "NY|NC|ND|OH|OK|" & \
  3580.      "OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY|" 
  3581.         return true
  3582.     else
  3583.         return false
  3584. scriptChooserDialog
  3585. .&+    +
  3586. scriptObjects
  3587. enterpage
  3588. cancel
  3589. keychar
  3590. scriptObjects
  3591. cancel
  3592. selectedtextlines 
  3593. "scriptObjects" 
  3594. keyEnter
  3595. editscript 
  3596.     close 
  3597. origPage
  3598. original
  3599. scriptChooserDialog
  3600. label
  3601. &View the Selected Script:
  3602. bottomLine
  3603. topLine
  3604. scriptObjects
  3605. editScript
  3606. buttondoubleclick
  3607. editScript
  3608. selectedTextLines 
  3609.         -- the full 
  3610. {reference 
  3611. hiding 
  3612.         -- 
  3613. each 
  3614. 9,t)+1 
  3615. U(t) 
  3616. Field "Display"    Field id 83 of Page id 163
  3617. Group "Dial"    Group id 84 of Page id 163
  3618. ComboBox "Clip Chooser"    ComboBox id 85 of Page id 163
  3619. Button "Play Clip"    Button id 2 of Page id 16360oup "timeButtons"    Group id 22 of Page id 139
  3620. Field "Time"    Field id 24 of Page id 139ld id 23 of Page id 139
  3621. Field "Time"    Field id 24 of Page id 139
  3622. buttonclick
  3623. buttonclick
  3624. View Script
  3625. cancel
  3626. buttonclick
  3627. buttonclick
  3628. Cancel
  3629. .&+    +
  3630. categories
  3631. categoryStruct
  3632. enterPage
  3633. ,%H.%
  3634. extractName
  3635. frefText
  3636. extractID
  3637. categories
  3638. stwoDQuickSort
  3639. categoryStruct
  3640. updateCategories
  3641. categories 
  3642. the "
  3643. ZmainStruct[][]
  3644. categoryStruct 
  3645. fref 
  3646. arraySize 
  3647. dimensions(
  3648. ni][1] 
  3649. i][2] 
  3650. selectedTextlines 
  3651. -- recreates structure 
  3652. updateCategories
  3653. frefText 
  3654. i][1] 
  3655. extractName(t)
  3656. i][2] 
  3657. extractID(t)
  3658. twoDQuickSort 
  3659. origPage
  3660. original
  3661. label
  3662. bottomLine
  3663. topLine
  3664. Categories
  3665. Arrays    150,127,126
  3666. Calling Windows Functions    133,113,112
  3667. Conversion help    128
  3668. Data Validation    76,74,28
  3669. Date functions    137,136,135,134
  3670. DDE    78,103,77
  3671. Debugging    126
  3672. DOS Utilities    85,83
  3673. File Maintenance    82
  3674. Navigation    149,91
  3675. Sorting and Searching    150,127,130,82,109
  3676. String Manipulation    132,131,130,129
  3677. Useful Functions    155,132,129,115
  3678. Widgets    141,140,139
  3679. Multimedia    163,161,160,157,158,154ects    
  3680. Useful Objects    95,96
  3681. Date functions    
  3682. cancel
  3683. categories
  3684. Untitled
  3685. Enter new category
  3686. buttonclick
  3687. -- prompts 
  3688. qcategory
  3689. buttonclick
  3690. ("Enter 
  3691. f"Untitled"
  3692. "categories" 
  3693. &New...
  3694. ,%H.%
  3695. cancel
  3696. extractName
  3697. frefText
  3698. You already have another topic with this name.
  3699. false
  3700. categories
  3701. Enter new name for this category.
  3702. found
  3703. buttonclick
  3704. -- allows user 
  3705. rename a category
  3706. buttonclick
  3707. fref 
  3708. "categories"
  3709. frefText 
  3710. selectedTextLines 
  3711. tabLoc 
  3712. ("Enter 
  3713. tabloc-1 
  3714. found 
  3715.             -- 
  3716. asure 
  3717. xalready used.
  3718. i <> 
  3719. extractName(
  3720. "You 
  3721. rhave another 
  3722.         -- update 
  3723. &Rename...
  3724. w,    #>
  3725. Cancel
  3726. extractName
  3727. Delete category
  3728. categories
  3729. buttonclick
  3730. a category
  3731. buttonclick
  3732. fref 
  3733. "categories"
  3734. selectedTextlines 
  3735. "Delete 
  3736. n" && 
  3737. & extractName(t) & 
  3738. & "?" 
  3739. f"OK" 
  3740. "Cancel"
  3741. &Delete
  3742. updateCategories
  3743. buttonclick
  3744. buttonclick
  3745. updateCategories
  3746.     close 
  3747. buttonclick
  3748. -- closes dialog box
  3749. buttonclick
  3750. &Cancel
  3751. Modify the selected category.
  3752. MS Sans Serif
  3753. Mammals
  3754. House Pets
  3755. Smell Bad
  3756. categories
  3757. 4,5,0
  3758. 4,5,0
  3759. 4,6,7,0
  3760. 4,5,0
  3761. Farm Animals
  3762. Household Pets
  3763. Stinky Animals
  3764. categoryStruct
  3765. topicsPerCategory
  3766. Data Valadation
  3767. 10,9,4,5,6,0,7
  3768. 13,12,11
  3769. DOS Utilities
  3770. File Maintenance
  3771. 16,15,14
  3772. Functions
  3773. Menus
  3774. Navigation
  3775. Programming Aids
  3776. Resources
  3777. Sorting and Searching
  3778. Useful Objects
  3779. Courier New
  3780. g"g#%~k
  3781. V-g"[
  3782. Data Valadation
  3783. 76,75,80,74,71,28,73,72
  3784. 78,79,103,77
  3785. DOS Utilities
  3786. 84,85,81,83,86
  3787. File Maintenance
  3788. 100,82,99
  3789. Functions
  3790. 108,88,87
  3791. Menus
  3792. Navigation
  3793. Programming Aids
  3794. 98,106,97
  3795. Resources
  3796. 92,94,93
  3797. Sorting and Searching
  3798. 82,107,109
  3799. Useful Objects
  3800. 95,96
  3801. MS Sans Serif
  3802. '&%~k
  3803. Arial
  3804. 6O*K~k
  3805. Courier New
  3806. 6O*K~k
  3807. Arial
  3808. Arial
  3809. Courier New
  3810. SubtopicName
  3811. script
  3812. SubtopicName
  3813. script
  3814. Menus
  3815. Navigation
  3816. Sorting and Searching
  3817. 130,82,109
  3818. String Manipulation
  3819. 132,131,130,129
  3820. Useful Functions
  3821. 132,129,115
  3822. Widgets
  3823. 141,140,139,138
  3824. Useful Objects
  3825. 95,96
  3826. MS Sans Serif
  3827. System
  3828.  Sans Serif
  3829. MS Sans Serif
  3830. Arial
  3831. r]g"=
  3832. Arial
  3833. r]g"=
  3834. Arial
  3835. System
  3836. Arial
  3837. w#7?@
  3838. <BookPath>
  3839. D:\HOOKWORK\,<BookPath>
  3840. Arrays
  3841. 150,127,126
  3842. Calling Windows Functions
  3843. 171,166,133,113,112
  3844. Conversion help
  3845. Data Validation
  3846. 76,74,28
  3847. Date functions
  3848. 137,136,135,134
  3849. 78,103,77
  3850. Debugging
  3851. DOS Utilities
  3852. 85,83
  3853. File Maintenance
  3854. Navigation
  3855. 149,91
  3856. Sorting and Searching
  3857. 165,164,150,127,130,82,109
  3858. String Manipulation
  3859. 132,131,130,129
  3860. Useful Functions
  3861. 155,132,129,115
  3862. Widgets
  3863. 166,141,140,139
  3864. Multimedia
  3865. 172,166,163,161,160,157,158,154
  3866. unctions
  3867. 133,113,112
  3868. Conversion help
  3869. Data Validation
  3870. 76,74,28
  3871. Date functions
  3872. 137,136,135,134
  3873. 78,103,77
  3874. Debugging
  3875. DOS Utilities
  3876. 85,83
  3877. File Maintenance
  3878. Navigation
  3879. 149,91
  3880. Sorting and Searching
  3881. 150,127,130,82,109
  3882. String Manipulation
  3883. 132,131,130,129
  3884. Useful Functions
  3885. 132,129,115
  3886. Widgets
  3887. 141,140,139
  3888. Multimedia
  3889. Arial
  3890. C:\HOOK\SAMPLES\
  3891. :HDMEDIAPATH
  3892. Arrays
  3893. 150,127,126
  3894. Calling Windows Functions
  3895. 171,166,133,113,112
  3896. Conversion help
  3897. Data Validation
  3898. 76,74,28
  3899. Date functions
  3900. 137,136,135,134
  3901. 78,103,77
  3902. Debugging
  3903. DOS Utilities
  3904. 85,83
  3905. File Maintenance
  3906. Navigation
  3907. 149,91
  3908. Sorting and Searching
  3909. 165,164,150,127,130,82,109
  3910. String Manipulation
  3911. 132,131,130,129
  3912. Useful Functions
  3913. 155,132,129,115
  3914. Widgets
  3915. 166,141,140,139
  3916. Multimedia
  3917. 172,166,163,161,160,157,158,154
  3918. Page id 143
  3919. D array"
  3920. navigationBar
  3921. Page id 1
  3922. categoryPicker
  3923. Page id 3
  3924. categoryMaintenance
  3925. Page id 8
  3926. Category Maintenance
  3927. newTopic
  3928. Page id 121
  3929. New Topic
  3930. scriptChooserDialog
  3931. OpenScript Library
  3932. Topic Categories
  3933. description and script
  3934. tline
  3935. SubtopicName
  3936. in,ms
  3937. ThreeDeeRect
  3938. bottomLine
  3939. topLine
  3940. script
  3941. false
  3942. keydown
  3943. .&,    "
  3944. script
  3945. scrolling
  3946. rectangle
  3947. enterpage
  3948. key,isShift,isCtrl
  3949. caretLocation
  3950. notifyBefore 
  3951. fref 
  3952. txtOver 
  3953. 8= 0 
  3954. Script:
  3955. script
  3956. buttonclick
  3957. -- puts the contents 
  3958. lipboard
  3959. buttonclick
  3960. fref 
  3961. Copy Script
  3962. in,ms
  3963. ThreeDeeRect
  3964. bottomLine
  3965. topLine
  3966. explanation
  3967. .&,    "
  3968. scrolling
  3969. rectangle
  3970. explanation
  3971. enterpage
  3972. notifyBefore 
  3973. fref 
  3974. "explanation" 
  3975. txtOver 
  3976. 8= 0 
  3977. enterpage
  3978. Check for Alpha Non-Numeric Data
  3979. ButtonStillDown Page Navigation
  3980. Scrollbar Group Scripts
  3981. itemOffset()
  3982. &File
  3983. &Open...    Ctrl+O
  3984. &Save    Ctrl+S
  3985. Save &As...
  3986. saveas
  3987. &Run...
  3988. E&xit    Alt+F4
  3989. &Edit
  3990. &Undo    Ctrl+Z
  3991. Cu&t    Ctrl+X
  3992. &Copy    Ctrl+C
  3993. &Paste    Ctrl+V
  3994. paste
  3995. A&uthor    F3
  3996. author
  3997. &Help
  3998. &Contents    F1
  3999. index
  4000. Navigation
  4001. rightBounds
  4002. sizeStuff
  4003. splitter
  4004. sizePage
  4005. sizePage
  4006. xpix 
  4007. sysPageUnitsPerPixel
  4008. rightBounds 
  4009. B"splitter" 
  4010. "sizeStuff" 
  4011. -- keep 
  4012. focuswindow 
  4013. origPage
  4014. original
  4015. Navigation
  4016. label
  4017. Choose a category:
  4018. Topics of this category:::
  4019. sizeStuff
  4020. categories
  4021. Multimedias>nss Functions
  4022. <All topics>
  4023. Arrays
  4024. Calling Windows Functions
  4025. Conversion help
  4026. Data Validation
  4027. Date functions
  4028. Debugging
  4029. DOS Utilities
  4030. File Maintenance
  4031. Multimedia
  4032. Navigation
  4033. Sorting and Searching
  4034. String Manipulation
  4035. Useful Functions
  4036. Widgetstsful Objectsns
  4037. Useful Objects
  4038. navButtons
  4039. .&+    +
  4040. extractID
  4041. topics
  4042. tcount
  4043. buttonclick
  4044. buttonclick
  4045. fref 
  4046. asure 
  4047. isn't empty
  4048. tcount 
  4049. selectedTextLines 
  4050. beginning
  4051.         -- 
  4052.         -- navigate
  4053. extractID(
  4054. , so focuswindow reverts 
  4055. previous
  4056. .&+    +
  4057. extractID
  4058. topics
  4059. buttonclick
  4060. -- navigates 
  4061. buttonclick
  4062. fref 
  4063. asure there 
  4064. selectedTextLines 
  4065. going 
  4066.         -- 
  4067.         -- 
  4068. extractID(
  4069. y, so focusWindow reverts 
  4070. search
  4071. ,%H.%
  4072. cancel
  4073. bckgrnds
  4074. description and script,description and example,description only
  4075. searchPhrase
  4076. <Custom search>
  4077. No instances of
  4078. categories
  4079. found.
  4080. topics
  4081. Enter key word to search for.
  4082. explanation
  4083. backRef
  4084. Tvpopulate
  4085. buttonclick
  4086. buttonclick
  4087. Zfoundlist
  4088. ("Enter key 
  4089. searchPhrase 
  4090. ZallTopics
  4091. bckgrnds 
  4092. "description 
  4093. example,
  4094. only"
  4095. backRef 
  4096. pref 
  4097. "explanation" 
  4098. ) = 0
  4099. "No instances 
  4100. " && 
  4101. populate 
  4102. combobox "categories" 
  4103. "<Custom 
  4104. topics
  4105. Controlling volume of clips    163
  4106. Making mmSource-paths book relative    154
  4107. Play clip in a loop    158
  4108. Play clip on enter page    172
  4109. Playing MIDI Directly    166
  4110. Playing random sounds    160
  4111. Recording wave files from CD    157
  4112. Using system sounds    161ACK    149
  4113. Check for Alpha Non-Numeric Data    28
  4114. Check for State Abbreviation    74
  4115. Controlling volume of clips    163
  4116. Convert textlines to list    132
  4117. Converting to Binary, Hex, Octal    128
  4118. Create Full-Text Search Index    164
  4119. Disabling task switching    171
  4120. Display 2-D array values    126
  4121. Dragging Objects    151
  4122. Exit and restart windows    133
  4123. Get Current Path Setting    83
  4124. Get day of week from date    134
  4125. Get Free Disk Space on a Drive    85
  4126. Get number of days in month    137
  4127. Get path of current book    155
  4128. Initialize Excel Conversation    78
  4129. Insert/Overwrite field    140
  4130. isLeapYear()    135
  4131. itemOffset()    115
  4132. Limit Length of Entry String    76
  4133. Making mmSource-paths book relative    154
  4134. Perform Full-Text Search    165
  4135. Play clip in a loop    158
  4136. Play clip on enter page    172
  4137. Playing MIDI Directly    166
  4138. Playing random sounds    160
  4139. Recording wave files from CD    157
  4140. Remove given char from string    129
  4141. Remove trailing spaces    131
  4142. Search and replace in a string    130
  4143. Search Path for File    82
  4144. Show all objects of page    170
  4145. Sorting a 1-D array    150
  4146. Sorting a 2-D array    127
  4147. Spin controls    139
  4148. Using a RECT structure    113
  4149. Using system sounds    161
  4150. Using windows pointers    112
  4151. categoryButtons
  4152. CategorySetup
  4153. categoryPicker
  4154. buttonclick
  4155. buttonclick
  4156. "categoryPicker" 
  4157. %modal
  4158. Topic Categories
  4159. CategoryMaintenance
  4160. categoryMaintenance
  4161. buttonclick
  4162. buttonclick
  4163. "categoryMaintenance" 
  4164. %modal
  4165. Category Maintenance
  4166. newTopic
  4167. buttonup
  4168. newTopic 
  4169. %modal
  4170. &New topic
  4171. w,    #>
  4172. .&,    "
  4173. Cancel
  4174. categories
  4175. Cannot delete the last page of this background.
  4176. label
  4177. Delete topic
  4178. buttonclick
  4179. buttonclick
  4180. "Delete 
  4181. M" && 
  4182. & label 
  4183. & "?" 
  4184. f"OK" 
  4185. "Cancel"
  4186. "Cannot delete the 
  4187. selectchange 
  4188. combobox "categories" 
  4189. &Delete topic
  4190. splitter
  4191. origPage
  4192. original
  4193. label
  4194. origPage
  4195. original
  4196. label
  4197. bottomLine
  4198. topLine
  4199. categories
  4200. Arrays
  4201. Calling Windows Functions
  4202. Conversion help
  4203. Data Validation
  4204. Date functions
  4205. Debugging
  4206. DOS Utilities
  4207. File Maintenance
  4208. Navigation
  4209. Sorting and Searching
  4210. String Manipulation
  4211. Useful Functions
  4212. Widgets
  4213. Multimediatsful Objectsns
  4214. Useful Objects
  4215. prompt
  4216. Choose categories for topic "Play clip on enter page""page"dex"e"
  4217. compileCategories
  4218. buttonclick
  4219. buttonclick
  4220. compileCategories
  4221.     close 
  4222. buttonclick
  4223. -- dismiss dialog box
  4224. buttonclick
  4225.     close 
  4226. &Cancel
  4227. Scripts examples in library.tbk.
  4228. Scripts examples in library.tbk. Page 
  4229.