home *** CD-ROM | disk | FTP | other *** search
/ Wacky Windows Stuff... / WACKY.iso / toolbook / learnos.tbk (.txt) < prev    next >
Asymetrix ToolBook File  |  1990-09-26  |  92KB  |  1,322 lines

  1. Parameters
  2. Parts
  3. Special Terms
  4. Messages
  5. Literals
  6. Expressions
  7. Value References
  8. Constants
  9. Properties
  10. Variables
  11. Command Window
  12. Functions
  13. Operators
  14. 4stack_var
  15. "show_stack"
  16. :" && 
  17. itemcnt
  18. enterPage
  19. enterPage
  20. show_stack
  21.  itemCount:
  22. itemcnt
  23. stack_var
  24. show_stack
  25. 9170,6501,6335,8468,42798468,42255,1479,5725
  26.  Variable stk:
  27. "show_it"
  28. buttonup
  29. buttonup
  30. show_it
  31. New it
  32. 4stack_var
  33. "show_it" 
  34. "show_stack"
  35. :" && 
  36. itemcnt
  37. buttonUp
  38. buttonUp
  39. show_it
  40. show_stack
  41.  itemCount:
  42. itemcnt
  43. stack_var
  44. 4stack_var
  45. "show_it"
  46. "show_stack"
  47. :" && 
  48. itemcnt
  49. buttonUp
  50. buttonUp
  51. show_it
  52. show_stack
  53.  itemCount:
  54. itemcnt
  55. stack_var
  56. show_it
  57. 5725 text
  58.   It:ble stk:
  59. 4stack_var
  60. "some 
  61. "show_stack"
  62. :" && 
  63. itemcnt
  64. buttonUp
  65. buttonUp
  66. some text
  67. show_stack
  68.  itemCount:
  69. itemcnt
  70. stack_var
  71. What???
  72. itemcnt
  73.  itemCount: 5654 itemCount: 6 
  74. 4stack_var
  75. "XXX" 
  76. "show_stack"
  77. :" && 
  78. itemcnt
  79. buttonUp
  80. buttonUp
  81. show_stack
  82.  itemCount:
  83. itemcnt
  84. stack_var
  85. put "XXX" into item 3 of stk
  86. key,isShift, isCtrl
  87. " && 
  88. showit
  89.  > 0 
  90.  " && 
  91. | && 
  92. d > 0 
  93. " && 
  94.  > 0 
  95. ansitoChar(key) 
  96. keyUp
  97. keyChar
  98. keyDown
  99. enterPage
  100. keyDown
  101. keyDown
  102. showit
  103. isCtrl
  104. isShift
  105. keyUp
  106. keyUp  
  107. showit
  108. isCtrl
  109. isShift
  110. keyChar
  111. keyChar
  112. showit
  113. isCtrl
  114. isShift
  115. enterPage
  116. showit
  117. showit
  118. Messages
  119. Parameters
  120. Expressions
  121. Special Terms
  122. Object References
  123. Messages
  124. Messages in detail
  125. Examples of special terms
  126. get the third item of sysHistory
  127. go to last page of book "catalog.tbk"
  128. put "shirts" after text of field "laundry"
  129. draw a roundedRectangle from \
  130.     1000,1000 to 3000,3000
  131. Navigation commands
  132. flip, flip all
  133. fxDissolve, fxWipe, fxZoom
  134. search, search again
  135. Script control commands
  136. break, break to system
  137. continue, continue step
  138. edit script of
  139. execute
  140. forward, forward to system
  141. pause
  142. restore system
  143. Variable declaration commands
  144. local
  145. system
  146. User interface control commands
  147. ask, ask password
  148. magnify
  149. request
  150. Menu control commands
  151. add menu, remove menu
  152. add menuItem, remove menuItem
  153. check menuItem, uncheck menuItem
  154. activate menuItem, deactivate menuItem
  155. restore menuBar
  156. File and printing commandssssssssss
  157. save as, save changes
  158. print, print eject
  159. createFile
  160. openFile, closeFile
  161. readFile, writeFileee
  162. Data exchange commands
  163. import, export
  164. executeRemote, respondRemote
  165. getRemote, setRemote
  166. unlinkDLL
  167. Examples of commands
  168. fxDissolve slow to next page
  169. move group "cat" to 1000,1000
  170. add menu "Categories" at Reader
  171. set the fillcolor of group "cow" to \
  172. magenta
  173. Script
  174. Handlers
  175. Control Structures
  176. Object References
  177. Commands
  178. Containers
  179. String Specifiers
  180. Handlers
  181. Control Structures
  182. Script
  183. Handlers
  184. Statements
  185. Commands
  186. Parameters
  187. Responding to messages with message handlers
  188. Control Structures
  189. Control Structures
  190. Parameters
  191. Script
  192. Handlers
  193. Statements
  194. Commands
  195. Controlling order
  196. of processing with control structures
  197. Commands
  198. Control Structures
  199. Parameters
  200. Script
  201. Handlers
  202. Statements
  203. Commands
  204. Using OpenScript commands
  205. Expressions
  206. Expressions
  207. Expressing values
  208. in OpenScript
  209. Value References
  210. Literals
  211. Constants
  212. Containers
  213. Object References
  214. Parameters
  215. Expressions
  216. Special Terms
  217. Object References
  218. Messages
  219. Referring to objects
  220. Special Terms
  221. Parameters
  222. Expressions
  223. Special Terms
  224. Object References
  225. Messages
  226. Using special termsrs with special terms
  227. Using step, push, and pop
  228. *    Use step  to iterate through the items
  229.     in a list
  230. *    Use push  to add an item to a list
  231. *    Use pop  to put an item from a list
  232.     into It  or into another variable 
  233. Watch out for typos! 
  234. *    When setting properties, spell the 
  235.     property name correctly, otherwise:
  236.     -    You may define a data property
  237.         instead of a built-in one by mistake
  238.     -    You may define a data property
  239.         with a different name than you
  240.         intendede        wrong name
  241. Properties
  242. Containers
  243. Variables
  244. Properties
  245. Command Window
  246. Getting and setting
  247. properties
  248. Expressions
  249. Functions
  250. Operators
  251. String Specifiers
  252. Other ways of expressing values in OpenScript
  253. Command Window
  254. Containers
  255. Variables
  256. Properties
  257. Command Window
  258. Using the Command
  259. window in a script
  260. Functions
  261. Expressions
  262. Functions
  263. Operators
  264. String Specifiers
  265. Using functions to calculate values
  266. Operators
  267. Expressions
  268. Functions
  269. Operators
  270. String Specifiers
  271. Using operators to calculate values
  272. String Specifiers
  273. Expressions
  274. Functions
  275. Operators
  276. String Specifiers
  277. Referring to parts
  278. of a stringg
  279. Other considerations
  280. *    Put the handler for a message
  281.     no lower than the level of the object
  282.     that receives the message
  283. *    Be on the lookout for "unique" scripts
  284.     that can be generalized, to reduce
  285.     book size and script maintenancelized, to reduce
  286.     book size and script maintenance
  287. showit 
  288. leavePage
  289. leavePage
  290. showit
  291. }" & 
  292. showit
  293.  > 0 
  294. {" & 
  295. A > 0 
  296. x > 0 
  297.  > 0 
  298. |" & 
  299.  > 0 
  300. rightbuttonUp
  301.  > 0 
  302. rightbuttonDown location
  303. " && 
  304.  > 0 
  305. z" & 
  306.  > 0 
  307. rightbuttonDoubleClick
  308. Q" & 
  309.  > 0 
  310. mouseLeave
  311. buttonDown
  312. buttonStillDown
  313. buttonUp
  314. rightbuttonUp
  315. rightbuttonDown
  316. mouseEnter
  317. buttonDoubleClick
  318. rightbuttonDoubleClick
  319. buttonUp
  320. buttonUp
  321. showit
  322. buttonDown
  323. buttonDown
  324. showit
  325. mouseEnter
  326. mouseEnter
  327. showit
  328. mouseLeave
  329. mouseLeave
  330. showit
  331. buttonStillDown
  332. buttonStillDown
  333. showit
  334. rightbuttonUp
  335. rightbuttonUp
  336. showit
  337. rightbuttonDown
  338. rightbuttonDown
  339. showit
  340. location
  341. buttonDoubleClick
  342. buttonDoubleClick
  343. showit
  344. rightbuttonDoubleClick
  345. rightButtonDoubleClick
  346. showit
  347. Button
  348. showit
  349. Containers - briefly
  350. *    A container is anything that can
  351.     hold a value
  352. *    You refer to a container to work with
  353.     its valuetable property
  354.         -    The Command window
  355. Containers - in detail
  356. *    A container can be:
  357.         -    A variable
  358.         -    A settable property, including the
  359.             text of a field
  360.         -    The Command window
  361. Variables
  362. *    Use a variable to store information
  363.     you don't want to appear on the page
  364. *    OpenScript has three kinds of 
  365.     variables:
  366.         -    Local
  367.         -    System
  368.         -    Special
  369. Special variableses
  370. *    The variable It  is automatically 
  371.     declared and is used by commands
  372.     such as get  to store data
  373. *    The variables argCount  and argList
  374.     contain the number of arguments and
  375.     the actual arguments passed to
  376.     a handler
  377. Local variables
  378. *    A local variable persists for the
  379.     execution of the handler it's in and is
  380.     available only within that handler
  381. *    local varname
  382. *    If you don't use the local  command,
  383.     the variable is autodeclared with its
  384.     first use useclared with its
  385.     first use
  386. Variable names and initial values
  387. *    A variable name must be unique
  388.     and cannot be an OpenScript
  389.     keyword
  390. *    When you declare a variable its
  391.     initial value is null
  392. *    You set the value of a variable with
  393.     the set  command
  394. System variables
  395. *    A system variable persists for the
  396.     ToolBook session
  397. *    system varname
  398. *    A system variable is available to
  399.     any handlermmand
  400. *    A system variable is available to
  401.     any handlererle is autodeclared with its
  402.     first useiable is autodeclared with its
  403.     first usee
  404. Properties
  405. *    All objects have properties
  406. *    ToolBook (the system) has
  407.     properties
  408. *    All properties are gettable, and most
  409.     are settable
  410. *    You can define your own properties
  411. Property settings
  412. *    Many properties are limited to a
  413.     predefined set of acceptable settings
  414.         -    borderStyle
  415.         -    fillColor, strokeColor
  416.         -    captionShown
  417. ou want
  418. More property settings
  419. *    Other properties can contain a string
  420.     of any content and sometimes of
  421.     considerable length
  422.         -    script
  423.         -    text of a field
  424.         -    caption of a book or button
  425. Setting an object's property
  426. *    Use the set  command to set the 
  427.     property to a value or container:
  428.         -    set the caption of button "hint" \
  429.             to "Need a Hint?"
  430.         - set the borderStyle of field "this" \
  431.             to the borderStyle of field "that"
  432. Getting the value of a property
  433. *    Use put   to put the value into a
  434.     container
  435. *    Use get  to put the value into the
  436.     special variable It
  437.     -    put vertices of selection into rickrack
  438.     -    get bounds of ellipse "cookie" 
  439. Defining your own properties
  440. *    You can define two kinds of
  441.     properties:
  442.         -    Properties that contain data
  443.             about an object
  444.         -    Properties that control behavior
  445.             of an object
  446. Defining a data property
  447. *    Use a data property when you want
  448.     to store information about an object
  449.     between ToolBook sessions
  450. *    set myproperty of objectref \
  451.     to mysetting
  452. *    The userProperties  property contains
  453.     a list of user-defined data properties
  454. Defining a behavior property
  455. *    Define a behavior property when
  456.     you want to restrict a property to
  457.     certain settings or cause actions to
  458.     happen when a setting changes
  459. *    For details, see Chapter 6,
  460.     "Beyond the Basics" in Using
  461.     OpenScriptkok
  462. Command window
  463. *    Use put  without a destination to
  464.     display data in the Command window
  465. *    If the Command window is not
  466.     already displayed, ToolBook will
  467.     display it
  468. A function's to get  handler
  469.     to get myfunction varname
  470.             statements
  471.             return expression
  472.     end myfunction
  473. *    Return  must be the last statement
  474. *    Expression specifies the result to
  475.     be calculated using the value passed
  476.     in varname
  477. Using a user-defined function
  478.     myfunction(varname)
  479. *    Supply the appropriate value for
  480.     varname
  481. *    Same as for messages, if the to get
  482.     handler for the function is lower in
  483.     the hierarchy, use a direct reference:
  484.     myfunction(varname) of button "foo"
  485. Operators in OpenScript
  486. *    Arithmetic: *  +  -  /  ^  div  mod
  487. *    Logical: <  <=  <>  =  >  >= 
  488.                         contains, is, is not, is in,
  489.                         is not in, not, and, or
  490. *    String: &  &&
  491. *    Special: argument
  492. String specifiers
  493. *    Use string specifiers to refer to part
  494.     of a string
  495. *    You can use string specifiers on any
  496.     string: a string in a variable, an
  497.     object property, or the text of a field
  498. The string specifiers 
  499.     character                        textline
  500.     characters                    textlines
  501.     char
  502.     chars                                item
  503.                                                 items
  504.     word
  505.     words
  506. Specifying characters
  507. *    You can refer to any character in
  508.     a string, including spaces and
  509.     special characters
  510. *    Characters are counted from the
  511.     beginning of the string
  512. *    A carriage return and line feed at the
  513.     end of a paragraph is TWO characters
  514. Specifying words
  515. *    A word in OpenScript is any group
  516.     of characters not separated by
  517.     "white space"
  518. *    "White space" is one or more spaces,
  519.     tab characters, or CRLFs.
  520. Specifying textlines
  521. *    A textline is zero or more characters
  522.     up to but not including a CRLF
  523. *    Think of a textline as a paragraph
  524.     rather than a line of text, because
  525.     lines of text in a field may result
  526.     from word wrap rather than CRLFs
  527. Examples of specifying characters
  528.     characters 3 to 5 of text of field "zip"
  529.     character 1 of lastname
  530.     chars 1 to 10 of text of recordfield \
  531.     "animal" of this page
  532. Examples of specifying words
  533.     word 1 of namevar
  534.     word 3 of script of button "Next"
  535.     words 1 to 3 of text of field "preamble" 
  536. Examples of specifying textlines
  537.     textline 3 of text of field "address"
  538.     textlines 1 to 3 of agreement
  539.     textlines 1 to 5 of script of this book
  540. Specifying items
  541. *    An item is zero or more characters
  542.     separated by commas
  543. *    An item can include any other 
  544.     characters, including CRLFs
  545. *    A string that contains more than one
  546.     item is commonly called a list
  547. More about lists
  548. *    Lists are heavily used in OpenScript
  549. *    Many properties of objects are lists:
  550.         -    position, bounds, or vertices
  551.         -    fillcolor, strokecolor
  552.         -    objects of a page or a group
  553. Examples of specifying items
  554.     item 2 of objects of group "globe"
  555.     item 5 of textline 3 of chessboard
  556.     items 1 to 3 of text of field "laundry"                    
  557. Determining the limits of a string
  558. *    If you don't know the upper limit of
  559.     a range, use one of these functions:
  560.         -    charCount
  561.         -    wordCount
  562.         -    textLineCount
  563.         -    itemCountt
  564. Examples of string limitsunctions
  565.     put chars 1 to charCount(ssn)
  566.     set last to item itemCount(Entrants)
  567.     step i from 1 to wordCount(giftlist)
  568.     put textLineCount(text of field "dogs")
  569. Messages in detailf the language
  570. *    You specify a message in a handler
  571.     to identify the message to be handled
  572. *    You specify a message as a 
  573.     parameter to the send  or forward  
  574.     command to send that message 
  575.     explicitly    
  576. Keyboard messages
  577.     keyChar
  578.     keyDown
  579.     keyUp
  580.     Parameters: key, isShift, isCtrl
  581.     For keyChar, key is ANSI value
  582.     For keyDown and keyUp, key is
  583.     a key constant
  584. Book, page, background navigation
  585.     enterBook
  586.     leaveBook
  587.     enterPage
  588.     leavePage
  589.     enterBackground
  590.     leaveBackground
  591.     enterSystem
  592.     leaveSystem
  593.     activateInstance
  594. Field and button navigation
  595.     enterButton
  596.     leaveButton
  597.     enterField
  598.     leaveField
  599.     enterRecordField
  600.     leaveRecordField
  601. Menu command messages
  602. *    A menu command message is
  603.     identical to its corresponding item
  604.     on the menu except that spaces and
  605.     ellipses are eliminated
  606. *    Selected-object Properties commands
  607.     and commands on the Control menu
  608.     have no corresponding messages
  609. Object creation and deletion, etc.
  610.     make                                remoteCommand
  611.     destroy                            remoteGet
  612.                                                 remoteSet
  613.     idle
  614.     doHelp
  615.     toggleStatus
  616. Message names own messagess
  617. *    A message name should be unique
  618.     and should not be an OpenScript
  619.     keyword
  620. *    The name should include only
  621.     letters, numbers, and the underscore
  622. Defining your own messages
  623. *    Decide on the message name
  624. *    Write a handler for the message
  625. *    Use the send  or forward  command
  626.     to send the message so the handler
  627.     can handle it
  628. Examples of valid message nameses
  629.     restore
  630.     makeItBlue
  631.     123Hike
  632.                                                     
  633. Values in OpenScriptriefly6
  634. *    A value is any piece of data
  635. *    Values are not explicitly typed
  636. *    ToolBook converts a value to the
  637.     type needed for the current context
  638. Value References
  639. Simple references to values
  640. *    A simple reference to a value can be:
  641.         -    A literal such as the number 27
  642.         -    A constant such as null  or blue
  643.         -    A container such as a variable,
  644. Functions
  645. *    A function takes arguments and
  646.     returns a value
  647. *    OpenScript has many of the functions
  648.     found in other languages plus some
  649.     unique functions of its own
  650. *    You can define your own functions
  651. Function syntax
  652.     functionname(arg1, arg2, ...argN)
  653.     Examples:
  654.         -    average(5,6,7,8)
  655.         -    sum(purchases)
  656. Arithmetic functions
  657. *    Standard arithmetic, trig, log, and
  658.     statistical functions
  659. *    Financial functions annuityFactor
  660.     and compoundFactor
  661. String and special functions
  662.     ansiToChar                    itemCount
  663.     charCount                        keyState
  664.     charToAnsi                        menuState
  665.     lowercase                        objectFromPoint
  666.     offset                                    textFromPoint
  667.     textLineCount
  668.     uppercase
  669.     wordCountt
  670. Defining your own function`
  671. *    Write a to get  handler for the function
  672. *    Put the handler in the script of a book 
  673.     or system book
  674. *    Use your function in expressions
  675.     just like a built-in function.                
  676. Parts
  677. whereto 
  678. buttonUp
  679. buttonUp
  680. whereto
  681. "A-list" 
  682. buttonUp
  683. buttonDown
  684. rightButtonDown
  685. rightButtonUp
  686. buttonDown
  687. A-list
  688. buttonUp
  689. A-list
  690. rightButtonDown
  691. B-list
  692. rightButtonUp
  693. B-list
  694. Parts of the 
  695. OpenScript language
  696. Parameters
  697. Parameters
  698. Statements
  699. Statements
  700. Commands
  701. Commands
  702. Expressions
  703. Expressions
  704. B-list
  705. Control Structures
  706. Control Structures
  707. Special Terms
  708. Special Terms
  709. Functions
  710. Functions
  711. Operators
  712. Operators
  713. Literals
  714. Literals
  715. Constants
  716. Constants
  717. A-list
  718. Script
  719. Script
  720. Handlers
  721. Handlers
  722. Object References
  723. Object References
  724. Messages
  725. Messages
  726. Value References
  727. Value References
  728. String Specifiers
  729. String Specifiers
  730. Containers
  731. Containers
  732. Variables
  733. Variables
  734. Properties
  735. Properties
  736. Command Window
  737. Command Window
  738. buttonUp
  739. buttonUp
  740. Dividing Line
  741. m"Dividing Line"
  742. buttonDown
  743. buttonUp
  744. buttonDown
  745. Dividing Line
  746. buttonUp
  747. Dividing Line
  748. Names you give to objects
  749. *    You assign a name to an object
  750.     by using a Properties menu command
  751.     or by setting its name  property
  752. *    If a name includes spaces or special
  753.     characters other than underscores,
  754.     quotes are required; in other names
  755.     quotes are optional but help script
  756.     readability              
  757. An object's "unique name"
  758. *    A book's uniqueName  property
  759.     contains book  plus the book's
  760.     file name
  761. *    Any other object's uniqueName
  762.     property contains the object type
  763.     plus the object's ID
  764. *    ToolBook's unique name is system
  765. Objects on pages and backgrounds
  766. *    If the object you're referring to is
  767.     on the current page, you don't need
  768.     to specify a location
  769. *    If the object is on another page, 
  770.     specify the page:
  771.         -    button "Next" of page ID 5
  772.         -    group "Caribou" of page "Alaska"
  773. Objects on backgrounds
  774. *    If the object is on a background, 
  775.     you must specify its location even if 
  776.     it's on the background of the current 
  777.     page or you're working    on the 
  778.     background:
  779.         -    button "Hint" of this background
  780.         -    group "Car" of background "Park"
  781. Objects in other books
  782. *    If the object is in another book, 
  783.     add the book's name to the reference
  784. *    If the book is in the current directory,
  785.     you can omit its drive and directory:
  786.         - page 5 of book "MAMMALS.TBK""""""""""""""""""""""""
  787. Examples of unique names
  788.         -    button ID 5
  789.         -    background ID 0
  790.         -    book "c:\books\newmath.tbk"round ID 0
  791.         -    book "c:\books\newmath.tbk"
  792. Examples of names you assign
  793.         -    field "helphint"
  794.         -    group "red car"
  795.         -    page "Alaska"
  796. ced exercise"
  797. Examples of objects in other books
  798. -    page "Cats" of books "PETS.TBK"
  799. -    background "Exercise" of book \
  800.     "C:\BOOKS\MATHBOOK.TBK"
  801. -    group "Telephone" of page \
  802.     "Office Equipment" of book \
  803.     "D:\OFFICE\PLANS\FACILITIES.TBK"""""""""""""
  804. Object references - useful terms
  805. *    Use this  with page, background, or
  806.     book to refer to the current page,
  807.     background or book
  808. *    Use my  and self   to refer to the
  809.     object whose script is currently
  810.     executing
  811. More useful terms in references
  812. *    Use target   to refer to the object
  813.     that initially receives a message 
  814.     (as opposed to the one whose script
  815.     is executing)
  816. *    Use selection  to refer to the currently
  817.     selected object or objects
  818. Still more useful terms
  819. *    Use focus  to refer to the object that
  820.     receives keyboard messages
  821. *    Use parent   to refer to the object
  822.     next higher in the object hierarchy
  823. *    Use objects  to refer to the objects
  824.     next lower in the object hierarchy
  825. Referring to record fields
  826. *    To refer to a record field as an object,
  827.     specify the background:
  828.     -    recordField "data" of this background
  829. *    to refer to the text of a record field,
  830.     specify the page:
  831.     -    text of recordField "data" of this page
  832. "Special terms"
  833. *    "Special terms" is a loose category
  834.     for OpenScript terms that are not
  835.     commands, messages, properties,
  836.     functions, constants, or operators
  837. *    Where and how you use a special
  838.     term depends on context
  839. Common special terms - a few examples
  840. *    Ordinals: first   through tenth
  841. *    Relationals: first, last, middle, next,
  842.                                 previous
  843. *    Prepositions: of, by, after, before,
  844. *    Articles (optional): a, an, the o                f,
  845.                              by, the, after, before, into        
  846. Mouse and pointer messages
  847.     mouseEnter        rightButtonDown
  848.     mouseLeave        rightButtonUp
  849.     buttonDown        rightButtonDoubleClick
  850.     buttonStillDown
  851.     buttonUp
  852.     buttonDoubleClick
  853.     Parameters: location, isShift, isCtrlShift, and isCtrl
  854. Control structures - special-purpose
  855.     start spooler
  856.             statements
  857.     end spooler
  858.     linkDLL dllname
  859.             return type declarations
  860.     end linkDLL
  861. Commands
  862. *    Commands are the verbs of
  863.     OpenScript
  864. *    Almost every statement starts with
  865.     a command
  866. *    Most commands have parameterste
  867.     the object to be acted upon or
  868.     provides more detail
  869. Notes on command syntax
  870. *    Capitalization is not required
  871. *    Use \ to break up long statements
  872. *    Use ; to continue short statements
  873. *    Use -- to start a comment
  874. Types of commands
  875. *    Data and object manipulation
  876. *    Navigation
  877. *    Script control
  878. *    Variable declaration
  879. *    User interface control
  880. *    Menu control
  881. *    File manipulation and printing
  882. *    DDE, DLL, and data exchangeeeeeee
  883. Data and object commands
  884. draw, move, align
  885. select, select all, extend select, unselect
  886. show, hide
  887. set, get, put
  888. push, pop
  889. clear
  890. increment, decrement
  891. format
  892. return, sort, seed
  893. "So, where should I put a handler?""
  894. *    If a handler defines behavior unique
  895.     to an object, put the handler in that
  896.     object's script
  897. *    If a handler defines more general
  898.     behavior, put the handler in the
  899.     script of an object higher in the
  900.     hierarchy
  901.                     
  902. Variables
  903. Containers
  904. Variables
  905. Properties
  906. Command Window
  907. Declaring and using
  908. variables
  909. Parameters
  910. Parameters
  911. Expressions
  912. Special Terms
  913. Object References
  914. Messages
  915. A closer look at command parameters
  916. Containers
  917. Containers
  918. Variables
  919. Properties
  920. Command Window
  921. Referring to data
  922. in containersto
  923. arameters
  924. Parameterssameters
  925. *    A command's parameters provide
  926.     more detail for the command's action
  927. *    Command parameters can be:
  928.         -    Expressions
  929.         -    Special terms
  930.         -    Object references
  931.         -    Messages
  932.             ssages
  933.      F    l    
  934. Command Window
  935. Properties
  936. Variables
  937. Control Structures
  938. Parameters
  939. Script
  940. Handlers
  941. Statements
  942. Commands
  943. Expressions
  944. Special Terms
  945. Object References
  946. Messages
  947. Value References
  948. Functions
  949. Operators
  950. String Specifiers
  951. Literals
  952. Constants
  953. Containers
  954. Parts
  955. parts
  956. buttonUp
  957. buttonUp
  958. parts
  959. Parts
  960. Script
  961. Control Structures
  962. Script
  963. Handlers
  964. Statements
  965. Commands
  966. Parameters
  967. Building scripts
  968. Expressions - in detail
  969. *    An expression in OpenScript can 
  970.     consist of:
  971.         -    A simple reference to a value
  972.         -    A function with its parameters
  973.         -    Values combined with operators
  974.         -    A reference to part of a string 
  975. *    More details latere covered in more
  976.     detail later specifiers
  977. Literals
  978. Literals - literally
  979. *    A number
  980. *    A string 
  981. *    If the string contains spaces or
  982.     special characters, enclose it in
  983.     quotes
  984. Constants
  985. Constants
  986.     black                    CR                            null
  987.     blue                        CRLF                    pi
  988.     cyan                        formfeed            quote
  989.     green                    LF                            space
  990.     magenta
  991.     white
  992.     yellow
  993. Expressions - brieflysss
  994. *    An expression describes a value,
  995.     character, or string in OpenScript
  996. *    An expression can be:
  997.         -    Arithmetic (yields a value)
  998.         -    Logical (yields true or false)
  999.         -    String (yields a character string))gggggggggggggggggg
  1000. Still more eventss
  1001. *    Making the window active
  1002. *    Receiving a DDE request from
  1003.     another application
  1004. *    Pressing F1 for help
  1005. *    Toggling the status box
  1006. Where other messages get sent
  1007. *    Keyboard messages are sent to the
  1008.     current page at Reader level
  1009. *    Messages sent with the send  
  1010.     command go to the object specified
  1011. *    All other messages are sent to the
  1012.     current page
  1013. Then what?
  1014. *    If the object's script has a handler for
  1015.     the message, the handler runs
  1016. *    If not, the message "floats" up the
  1017.     object hierarchy
  1018. *    If it reaches the top (ToolBook, or
  1019.     "the system") default behavior results
  1020. Default behavior for messages
  1021. *    For menu commands, default 
  1022.     behavior is to carry out the command
  1023. *    For other messages, default behavior
  1024.     is to do nothing
  1025. *    You can write handlers to intercept
  1026.     and block default behavior for
  1027.     menu command messagesssssssss
  1028. Messages: built-in or user-defined
  1029. *    All the messages mentioned so far
  1030.     are "built-in" to ToolBook
  1031. *    You can define your own messages:
  1032.         -    Write a handler for the message
  1033.         -    Send the message with the
  1034.             send  commanddd
  1035. The object hierarchy    
  1036. *    All objects have a place in the
  1037.     object hierarchy
  1038. *    An object's position in the hierarchy
  1039.     affects how it receives messages
  1040. Object IDs and names
  1041. *    An object ID is assigned to every
  1042.     object (except a book) when it is 
  1043.     created
  1044. *    If you cut and paste an object, the
  1045.     pasted object gets a new ID
  1046. *    An object's ID is stored in its
  1047.     idNumber  propertyy
  1048. Object types
  1049.     book                    angledLine        polygon
  1050.     page                    arc                            rectangle
  1051.     background    curve                    roundedRectangle
  1052.     field                        ellipse
  1053.     recordField    irregularPolygon
  1054.     button                    line
  1055.     hotword                paintObject
  1056.     group                    pie
  1057.                                                     polygon
  1058.                                                     rectangle
  1059. Managing message traffic
  1060. *    You can handle a message where it
  1061.     enters the hierarchy or let it "float up"
  1062. *    You can handle a message and
  1063.     forward it for more processing
  1064. *    You can send a message directly
  1065.     to an object t anywhere in the hierarchy
  1066. Control structuresof processing
  1067. *    Control structures are common 
  1068.     to most programming languages
  1069. *    You use control structures to 
  1070.     alter the order in which statements
  1071.     are processed
  1072. *    OpenScript has five common and
  1073.     two special control structuresres
  1074. How scripts are executed
  1075. *    A script consists of one or more 
  1076.     handlers
  1077. *    Handlers are executed as needed,
  1078.     so they can be in any order
  1079. *    Statements within a handler are
  1080.     executed in order unless you use a
  1081.     control structure to alter processinggprocessinger of
  1082.     processing
  1083. Compared to C, Basic, and Pascal
  1084. OpenScript        C    Basic        Pascal
  1085. If/then/else        If/else    If/then        If/then/else
  1086. Step/by            For    For/next        For/do
  1087. While            While            While/do
  1088. Do/until            Do/while            Repeal/until
  1089. Conditions/when        Switch/case        Case/of
  1090. Control structures - if/then/else
  1091.     if expression
  1092.             statements
  1093.     else
  1094.             statements
  1095.     end if
  1096. Control structures - conditions/
  1097.     conditions
  1098.             when expression1
  1099.                     statements
  1100.             when expression2
  1101.                     statements
  1102.             when expressionN
  1103.                     statements
  1104.             else
  1105.                     statements
  1106.     end conditions
  1107.     conditions
  1108.             when expression1
  1109.                     statements
  1110.             when expression2
  1111.                     statements
  1112.             when expressionN
  1113.                     statements
  1114.             else
  1115.                     statements
  1116.     end conditions
  1117. Control structures - do/until, while
  1118.             statements
  1119.     until expression
  1120.     while expression
  1121.             statements
  1122.     end while    
  1123. Control structures - step/by
  1124.     step var from start to finish by steps
  1125.             statements
  1126.     end step
  1127. Introduction to OpenScript
  1128. :PRINTLAYOUT
  1129. `D|D|
  1130. `D|D|
  1131. `D|D|
  1132. `D|D|
  1133. `D|D|
  1134. `D|D|
  1135. `D|D|
  1136. `D|D|
  1137. enterBook
  1138. enterBook
  1139. sizeToPage
  1140. System
  1141. "arrow"
  1142. Select IrregularPolygon "
  1143. Move the 
  1144. 6097, 4690
  1145. B"hotword2" 
  1146. 6097, 4105
  1147. /record 
  1148. B"button2" 
  1149. B"graphic2" 
  1150. 6127, 3535
  1151. B"group2" 
  1152. 5167, 2950
  1153. 3877, 2545
  1154. 3862, 2020
  1155. 3862, 1540
  1156. 4books" 
  1157. 3922, 1060
  1158. B"windows dlls" 
  1159. 3892, 565
  1160. B"System" 
  1161. 1897, 7000
  1162. B"hotword1" 
  1163. 1897, 4690
  1164. B"button1" 
  1165. B"graphic1" 
  1166. 1882, 3535
  1167. B"group1" 
  1168. 1867, 3070
  1169. 3937, 2500
  1170. 3922, 2020
  1171. 3922, 1480
  1172. 3922, 1090
  1173. B"Windows DLLs" 
  1174. 3907, 565
  1175. leavepage
  1176. enterpage
  1177. keychar
  1178. buttonUp
  1179. enterpage
  1180. leavepage
  1181. keychar
  1182.     buttonUp
  1183. arrow
  1184. arrow
  1185. hotword2
  1186. field/record field
  1187. button2
  1188. graphic2
  1189. group2
  1190. background
  1191. system books
  1192. windows dlls
  1193. System
  1194. background
  1195. system books
  1196. windows dlls
  1197. system
  1198. hotword2
  1199. field/record field
  1200. button2
  1201. graphic2
  1202. group2
  1203. hotword1
  1204. field
  1205. button1
  1206. graphic1
  1207. group1
  1208. background
  1209. system books
  1210. Windows DLLs
  1211. System
  1212. arrow
  1213. selectall
  1214. Background
  1215. Background
  1216. System books
  1217. System books
  1218. Windows DLLs
  1219. Windows DLLs
  1220. System
  1221. The system (ToolBook)
  1222. Field
  1223. Field
  1224. Group1
  1225. Group
  1226. Hotword1
  1227. Hotword
  1228. Button1
  1229. Button
  1230. Graphic1
  1231. label
  1232. Graphic
  1233. Graphic
  1234. Field/Record field
  1235. Field/Record field
  1236. Button2
  1237. Button
  1238. Graphic2
  1239. label
  1240. Graphic
  1241. Graphic
  1242. Group2
  1243. Group
  1244. Hotword2
  1245. Hotword
  1246. arrow
  1247. Object referencessssssssssssss
  1248. *    An object reference starts with the
  1249.     object type
  1250. *    The object type is followed by the
  1251.     object's name or ID
  1252. *    Depending on context, you may need
  1253.     to supply information about the
  1254.     object's location
  1255. Parts
  1256. parts
  1257. buttonUp
  1258. buttonUp
  1259. parts
  1260. Parts
  1261. Scripts
  1262. *    A script is a property of an object
  1263. *    Any object can have a script
  1264. *    Scripts are compiled automatically
  1265.     without explicit compiling or linkingggatically
  1266.     without explicit compiling or linking
  1267. Handlers
  1268. *    A handler carries out a specific task
  1269. *    There are three kinds of     handlers:
  1270.         - message handlers
  1271.         - to set  handlers
  1272.         - to get  handlerssslerss
  1273. Parts
  1274. parts
  1275. buttonUp
  1276. buttonUp
  1277. parts
  1278. Parts
  1279. Getting Acquainted 
  1280. with OpenScript
  1281. disclaimer
  1282. IMPORTANT:  These ToolBook files and Dynamic Link Library files are being made available free of charge exclusively for demonstration purposes to show some approaches programmers are taking for applications using ToolBook. The files have not undergone the rigorous review process which Asymetrix's commercial products undergo. Asymetrix does not intend to provide support for these files. Asymetrix specifically disclaims all warranties including without limitation all warranties of title or non-infringement, warranties of merchantability or fitness for a particular purpose and all other warranties express or implied. The files are made available "as is."
  1283. ASYMETRIX SHALL NOT BE LIABLE FOR ANY DAMAGES INCLUDING BUT NOT LIMITED TO DIRECT, INDIRECT, INCIDENTAL, SPECIAL, COVER, RELIANCE, OR CONSEQUENTIAL DAMAGES ARISING FROM ITS MAKING THE FILES AVAILABLE, OR THE USE OR INABILITY TO USE THE FILES. ANY USE OF FILES IS STRICTLY AT YOUR OWN RISK.
  1284. Copyright (c) 1990 by Asymetrix Corporation. All rights reserved. Asymetrix, ToolBook, and OpenScript are registered trademarks of Asymetrix Corporation.  
  1285. Message handlers
  1286. *    A message handler runs in response
  1287.     to a message
  1288. *    Syntax:
  1289.         to handle messagename
  1290.                 statements
  1291.         end messagenameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
  1292. To set  and to get  handlers
  1293. *    A to set  handler is used to create
  1294.     a user-defined property for an object
  1295. *    A to get  handler is used to create
  1296.     a user-defined function or to obtain
  1297.     the value of a user-defined property
  1298. How messages work"handled"
  1299. *    A message is triggered by an event
  1300. *    The message is sent to an object
  1301. *    What happens then depends on
  1302.     the object's script
  1303. Events that send messagessssssssss
  1304. *    Mouse clicks
  1305. *    Pointer movement
  1306. *    Keyboard activity
  1307. *    Book/page/background navigation
  1308. More events that send messages
  1309. *    Menu commands
  1310. *    Object creation and deletion
  1311. *    The OpenScript send  command
  1312. *    Doing nothing (theidle  message)
  1313. Where messages get sent
  1314. *    Mouse and pointer movement 
  1315.     messages are sent to the object with 
  1316.     the pointer at Reader level
  1317. *    Enter, leave, destroy, and make
  1318.     messages are sent     to the related
  1319.     object
  1320. lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
  1321. "l ,b^aR
  1322.