home *** CD-ROM | disk | FTP | other *** search
/ Chip: 25 Years Anniversary / CHIP_25Jahre_Jubilaeum.iso / downloads / 401065 / WPO11 / Data1.cab / _7B2F19172B8545C3AEC8522B84F67A16 < prev    next >
Text File  |  2003-03-07  |  37KB  |  1,462 lines

  1. Call
  2.  
  3. Example
  4.  
  5. Syntax 1
  6.  
  7. (<Label> label)
  8.  
  9. Description 1
  10.  
  11. Call macro code associated with a Label, Procedure, or Function; it can pass one or more values to a Procedure or Function.
  12.  
  13. A Return statement in a Label, Procedure, or Function directs macro execution to the statement that follows the call of the Label.
  14.  
  15. Parameters 1
  16.  
  17. <Label> label    A Label, Procedure, or Function name that begins with a letter and consists of one or more letters or numbers.
  18.  
  19. Syntax 2
  20.  
  21. ({[<Parameter>any]})
  22.  
  23. Description 2
  24.  
  25. Call macro code associated with a Label, Procedure, or Function; it can pass one or more values to a Procedure or Function.
  26.  
  27. A Return statement in a Label, Procedure, or Function directs macro execution to the statement that follows the Label's caller.
  28.  
  29. The format for calling Label is:
  30.  
  31. Call(LabelSub)
  32.  
  33. ...other statements...
  34.  
  35. Label(LabelSub)
  36.  
  37. ...statement block...
  38.  
  39. Return
  40.  
  41. The syntax for calling and passing a value to a Procedure or Function is:
  42.  
  43. Call <Label> label ({<Parameter> any})
  44.  
  45. The formats for callng Procedures and Functions are:
  46.  
  47. Call ProcSub({<Parameter>})
  48.  
  49. ...other statements...
  50.  
  51. Procedure ProcSub({<Parameter>})
  52.  
  53. ...statementblock...
  54.  
  55. EndProc
  56.  
  57. Call FuncSub({<Parameter>})
  58.  
  59. ...other statements...
  60.  
  61. Function FuncSub({<Parameter>})
  62.  
  63. ...statementblock...
  64.  
  65. Return(<Value>)
  66.  
  67. EndFunc
  68.  
  69. Parameters 2
  70.  
  71. <Label> label    A Label, Procedure, or Function name that begins with a letter and consists of one or more letters or numbers.
  72.  
  73. Call
  74.  
  75. Example
  76.  
  77. Syntax
  78.  
  79. (<Label> label)
  80.  
  81. Description
  82.  
  83. Call macro code associated with a Label, Procedure, or Function; it can pass one or more values to a Procedure or Function.
  84.  
  85. A Return statement in a Label, Procedure, or Function directs macro execution to the statement that follows the call of the Label.
  86.  
  87. Parameters
  88.  
  89. <Label> label    A Label, Procedure, or Function name that begins with a letter and consists of one or more letters or numbers.
  90.  
  91.  
  92.  
  93. The format for calling Label is:
  94.  
  95. Call(LabelSub)
  96.  
  97. ...other statements...
  98.  
  99. Label(LabelSub)
  100.  
  101. ...statement block...
  102.  
  103. Return
  104.  
  105. The syntax for calling and passing a value to a Procedure or Function is:
  106.  
  107. Call <Label> label ({<Parameter> any})
  108.  
  109. The formats for calling Procedures and Functions are:
  110.  
  111. Call ProcSub({<Parameter>})
  112.  
  113. ...other statements...
  114.  
  115. Procedure ProcSub({<Parameter>})
  116.  
  117. ...statementblock...
  118.  
  119. EndProc
  120.  
  121. Call FuncSub({<Parameter>})
  122.  
  123. ...other statements...
  124.  
  125. Function FuncSub({<Parameter>})
  126.  
  127. ...statementblock...
  128.  
  129. Return(<Value>)
  130.  
  131. EndFunc
  132.  
  133. Call <Label> label
  134.  
  135. Syntax
  136.  
  137. ({[<Parameter>any]})
  138.  
  139. Description
  140.  
  141. Call macro code associated with a Label, Procedure, or Function; it can pass one or more values to a Procedure or Function.
  142.  
  143. A Return statement in a Label, Procedure, or Function directs macro execution to the statement that follows the Label's caller.
  144.  
  145. The format for calling Label is:
  146.  
  147. Call(LabelSub)
  148.  
  149. ...other statements...
  150.  
  151. Label(LabelSub)
  152.  
  153. ...statement block...
  154.  
  155. Return
  156.  
  157. The syntax for calling and passing a value to a Procedure or Function is:
  158.  
  159. Call <Label> label ({<Parameter> any})
  160.  
  161. The formats for callng Procedures and Functions are:
  162.  
  163. Call ProcSub({<Parameter>})
  164.  
  165. ...other statements...
  166.  
  167. Procedure ProcSub({<Parameter>})
  168.  
  169. ...statementblock...
  170.  
  171. EndProc
  172.  
  173. Call FuncSub({<Parameter>})
  174.  
  175. ...other statements...
  176.  
  177. Function FuncSub({<Parameter>})
  178.  
  179. ...statementblock...
  180.  
  181. Return(<Value>)
  182.  
  183. EndFunc
  184.  
  185. Parameters
  186.  
  187. <Label> label    A Label, Procedure, or Function name that begins with a letter and consists of one or more letters or numbers.
  188.  
  189. Callback Data Description
  190.  
  191. When a macro executes a callback routine, global return and parameter array variables that are accessible to the callback routine are automatically created by the macro system. The callback routine can access the callback parameter array for information about the callback event, and will place its return value (if any) in the callback return variable.
  192.  
  193. The parameters for the callback are placed into a global array variable that has the same name as the callback label. The return value (if any) returned from callback routines is placed in a (non-array) global variable that has the same name as the callback label. For example, parameters would be passed to callback routine 'MsgHandler' in an array called 'MsgHandler[ ]', and any return value would be placed into a variable called 'MsgHandler'.
  194.  
  195. The return value, the number of callback array entries, and the values contained in the callback array depend on the type of callback being called. The callback type is found in the first ([1]) entry of the callback array. The callback array element count can be retrieved by using the Dimensions command, or by accessing the [0] callback array element.
  196.  
  197. Callback array entries
  198.  
  199. RTN Callback return value (depends on [1])
  200.  
  201. [0] Count of elements in callback array
  202.  
  203. [1] Callback type:
  204.  
  205. 0 = CBTYPE_MOUSE - Mouse callback (CoachFilterAdd command)
  206.  
  207. 1 = CBTYPE_KEY - Key and Keystring callback (CoachFilterAdd command)
  208.  
  209. 2 = CBTYPE_TOKEN - Product token (command) callback (CoachFilterAdd command)
  210.  
  211. 3 = CBTYPE_DIALOG - Dialog callback (DialogShow and CoachSetDialogFilter commands)
  212.  
  213. 4 = CBTYPE_CBTMSGBOX - MessageBox callback (CoachMessageBox command)
  214.  
  215. [2...] (Repeating depends on [1])
  216.  
  217. Entries for Mouse callback (type 0 - CBTYPE_MOUSE)
  218.  
  219. This type of callback is no longer supported.
  220.  
  221. Entries for Key and Keystring callback (type 1 - CBTYPE_KEY)
  222.  
  223. This type of callback is no longer supported.
  224.  
  225. Entries for Product token (command) callback (type 2 - CBTYPE_TOKEN)
  226.  
  227. This type of callback is setup by the CoachFilterAdd command.
  228.  
  229. RTN Callback return value:
  230.  
  231. undefined = Pass the event to the application
  232.  
  233. 0 = Pass the event to the application
  234.  
  235. 1 = Discard the event
  236.  
  237. [0] Callback array contains 7 elements plus 1 for each token parameter (count in [6])
  238.  
  239. [1] Callback type 2 = CBTYPE_TOKEN
  240.  
  241. -1 = Error - The callback array is not complete.
  242.  
  243. 0 = Match - The user's actions exactly match the defined actions.
  244.  
  245. 1 = No match - The user's actions do not match the defined actions.
  246.  
  247. 2 = Partial match - The user's actions partially match the defined actions.
  248.  
  249. 3 = Regression - The event undoes previous events, such as a Backspace. A regression is not a match. Received only if LabelType is Any! or NonMatch!.
  250.  
  251. 4 = Quit filter - The callback is not called.
  252.  
  253. [3] Name of application that sent this token
  254.  
  255. [4] Macro id of the macro that sent this token (if sent by a macro)
  256.  
  257. [5] Product token id
  258.  
  259. [6] Number of parameters for this token
  260.  
  261. [7] Token flags
  262.  
  263. [8] Value of first parameter
  264.  
  265. [9] Value of second parameter
  266.  
  267. [10]... Value of ..., etc
  268.  
  269. Entries for Dialog callbacks (type 3 - CBTYPE_DIALOG)
  270.  
  271. This type of callback is setup by the DialogShow and CoachSetDialogFilter commands.
  272.  
  273. RTN Callback return value (only if [5] = WM_COMMAND (273) and from CoachSetDialogFilter, else not used):
  274.  
  275. undefined = Send the event to the application
  276.  
  277. 0 = Send the event to the application
  278.  
  279. 1 = Do not send the event to the application
  280.  
  281. [0] Callback array contains 11 elements
  282.  
  283. [1] Callback type 3 = CBTYPE_DIALOG
  284.  
  285. [2] Dialog name
  286.  
  287. [3] Control name = (if [5] = WM_COMMAND (273), WM_HSCROLL (276), WM_VSCROLL (277), WPMSG_SETNSLB_POPUP (4104), OR TCN_SELCHANGING (-552)
  288.  
  289. "" = Other messages have no control name
  290.  
  291. [4] Dialog window handle[5].
  292.  
  293. [5] Windows* message id being sent (see below)
  294.  
  295. [6] Value of the 32-bit DWORD wParam parameter that was received with the message
  296.  
  297. [7] Value of the 32-bit DWORD lParam parameter that was received with the message
  298.  
  299. [8] Value of the HIWORD of the lParam parameter [7] that was received with the message
  300.  
  301. [9] Value of the LOWORD of the lParam parameter [7] that was received with the message
  302.  
  303. [10] Value of the HIWORD of the wParam parameter [6] that was received with the message
  304.  
  305. [11] Value of the LOWORD of the wParam parameter [6] that was received with the message
  306.  
  307. Elements [6] to [11] have different meanings for each Windows message (contained in [5]). See Windows 95 documentation for more information. When [5] is:
  308.  
  309. 272 = WM_INITDIALOG
  310.  
  311. Sent just before the dialog is first displayed. This message is sent BEFORE the values of the controls are set from their associated variables. If the values of any controls are changed when responding to this message, the values will be changed again by the macro system to reflect the contents of the variables associated with the controls.
  312.  
  313. This message is for notification only, and cannot be altered or prevented.
  314.  
  315. RTN Callback return value not used
  316.  
  317. [0..2], [4..5], [8..11] are described above.
  318.  
  319. [3] "" = No control name
  320.  
  321. [6] Window handle of the control that will receive focus
  322.  
  323. [7] 0 = Sent from WM_INITDIALOG of the dialog callback procedure.
  324.  
  325. 1 = Sent from DialogLoad if dialog did not exist.
  326.  
  327. 2 = Sent from DialogLoad if dialog already existed.
  328.  
  329. 1272 = MX_POST_INITDIALOG (only sent from DialogShow, not sent from CoachSetDialogFilter)
  330.  
  331. This message is sent when the dialog is first displayed, AFTER the values of the controls are set from their associated variables. If the values of any controls need to be changed when the dialog is displayed to something other than the initial values from the associated variables, they should be set in response to this message. This message is for notification only, and cannot be altered or prevented.
  332.  
  333. RTN Callback return value not used
  334.  
  335. [0..2], [4..5], [7..11] are described above.
  336.  
  337. [3] "" = No control name
  338.  
  339. [6] Window handle of the control that will receive focus.
  340.  
  341. 2 = WM_DESTROY
  342.  
  343. Sent when the dialog goes down.
  344.  
  345. This message is for notification only, and cannot be altered or prevented.
  346.  
  347. RTN Callback return value not used
  348.  
  349. [0..2], [4..11] are described above
  350.  
  351. [3] "" - No control name
  352.  
  353. 6 = WM_ACTIVATE
  354.  
  355. Sent when the dialog is activated or deactivated.
  356.  
  357. This message is for notification only, and cannot be altered or prevented.
  358.  
  359. RTN Callback return value not used
  360.  
  361. [0..2], [4..6], [8..9] are described above
  362.  
  363. [3] "" - No control name
  364.  
  365. [7] Window handle of the window being activated or deactivated
  366.  
  367. [10] Minimized flag (non-zero means minimized)
  368.  
  369. [11] Dialog activation state:
  370.  
  371. 0 = WA_INACTIVE (dialog becomes inactive)
  372.  
  373. 1 = WA_ACTIVE (dialog becomes active)
  374.  
  375. 2 = WA_CLICKACTIVE (dialog becomes active from mouse click)
  376.  
  377. 3 = WM_MOVE (sent from Dialog Show and CoachSetDialogFilter commands)
  378.  
  379. Sent when the dialog is moved to a new location.
  380.  
  381. This message is for notification only, and cannot be altered or prevented.
  382.  
  383. RTN Callback return value not used
  384.  
  385. [0..2], [4..7], [10..11] are described above
  386.  
  387. [3] "" - No control name
  388.  
  389. [8] New X position
  390.  
  391. [9] New Y position
  392.  
  393. 5 = WM_SIZE (only sent from DialogShow, not sent from CoachSetDialogFilter)
  394.  
  395. This message is sent when the dialog is sized.
  396.  
  397. This message is for notification only, and cannot be altered or prevented.
  398.  
  399. RTNCallback return value not used
  400.  
  401. [0..2], [4..5], [7], [10..11] are described above
  402.  
  403. [3] "" - No control name
  404.  
  405. [6] Size type:
  406.  
  407. 0 = SIZE_RESTORED - Dialog has been restored, but not minimized of maximized
  408.  
  409. 1 = SIZE_MINIMIZED - Dialog has been minimized
  410.  
  411. 2 = SIZE_MAXIMIZED - Dialog has been maximized
  412.  
  413. 3 = SIZE_MAXSHOW - Some other window has been restored
  414.  
  415. 4 = SIZE_MAXHIDE - Some other window is maximized
  416.  
  417. [8] New x size (width) of client area
  418.  
  419. [9] New Y size (height) of client area
  420.  
  421. 22 = WM_ENDSESSION (only sent from DialogShow, not sent from CoachSetDialogFilter)
  422.  
  423. This message is sent when the Windows session is about to be terminated.
  424.  
  425. This message is for notification only, and cannot be altered or prevented.
  426.  
  427. RTN Callback return value not used
  428.  
  429. [0..2], [4..5], [8..11] are as described above
  430.  
  431. [3]"" - No control name
  432.  
  433. [6] True = The session is being ended, False = Otherwise
  434.  
  435. [7] True = The user is logging off, False = The user is shutting down
  436.  
  437. -552 = TCN_SELCHANGING
  438.  
  439. Sent when a different tab on a tab control is selected.
  440.  
  441. This message can be altered by the callback by returning a value in the callback return variable.
  442.  
  443. RTNCallback return value (used only from CoachSetDialogFilter command):
  444.  
  445. undefined = Send the event to the application
  446.  
  447. 0 = Send the event to the application
  448.  
  449. 1 = Do not send the event to the application
  450.  
  451. [0..2], [4..7], [10] are as described above
  452.  
  453. [3] Control name of tab control
  454.  
  455. [8] Zero based tab index number (the first tab is 0) of old tab
  456.  
  457. [9] Zero based tab index number (the first tab is 0) of new tab
  458.  
  459. [11] Tab control id
  460.  
  461. 4104 = WPMSG_SET_NSLB_POPUP
  462.  
  463. Sent when a name search text box pops up on a name search list box.
  464.  
  465. RTNCallback return value not used
  466.  
  467. [0..2], [4..7] are as described above
  468.  
  469. [3] Control name of ScrollBar control.
  470.  
  471. [8] Coordinate of bottom edge of text box
  472.  
  473. [9] Coordinate of right edge of text box
  474.  
  475. [10] Coordinate of top edge of text box
  476.  
  477. [11] Coordinate of left edge of text box
  478.  
  479. 276 = WM_HSCROLL (sent from DialogShow, and not from CoachSetDialogFilter)
  480.  
  481. 277 = WM_VSCROLL (sent from DialogShow, and not from CoachSetDialogFilter)
  482.  
  483. Sent when the user clicks on a scroll bar control.
  484.  
  485. This message is for notification only, and cannot be altered or prevented.
  486.  
  487. RTN Callback return value not used
  488.  
  489. [0..2], [4..6], [8..9] are as described above
  490.  
  491. [3] Control name of name search listbox
  492.  
  493. [7] Window handle of the ScrollBar control
  494.  
  495. [10] Position of thumb in ScrollBar control (if [11] = 4 or 5, else not used)
  496.  
  497. [11] Scroll notification code:
  498.  
  499. 6 = SB_TOP (HOME key pressed - scroll to the top or left)
  500.  
  501. 7 = SB_BOTTOM (END key pressed - scroll to the bottom or right)
  502.  
  503. 8 = SB_ENDSCROLL (Scroll bar activity ended)
  504.  
  505. 0 = SB_LINEDOWN (Down or Right arrow clicked - scroll ahead 1 line)
  506.  
  507. 1 = SB_LINEUP (Up or Left arrow clicked - scroll back 1 line)
  508.  
  509. 2 = SB_PAGEDOWN (Area between Down or Right arrow and thumb clicked - scroll ahead 1 page)
  510.  
  511. 3 = SB_PAGEUP (Area between Up or Left arrow and thumb clicked - scroll back 1 page)
  512.  
  513. 4 = SB_THUMBPOSITION (Position of thumb after it is dragged is in [10])
  514.  
  515. 5 = SB_THUMBTRACK (Current position of thumb as it is dragged is in [10])
  516.  
  517. 274 = WM_SYSCOMMAND (only sent from DialogShow, an not from CoachSetDialogFilter)
  518.  
  519. Sent when the user presses Alt+F4, chooses Close from the system menu, or double clicks the system menu.
  520.  
  521. This message is for notification only, and cannot be altered or prevented.
  522.  
  523. RTN Callback return value not used
  524.  
  525. [0..2], [4..10] are as described above
  526.  
  527. [3] Control name of name search listbox
  528.  
  529. [11] Menu item id of system menu item selected:
  530.  
  531. 61536 = SC_CLOSE - Close, Alt+F4 or double click on system menu
  532.  
  533. 273 = WM_COMMAND
  534.  
  535. Sent when the user interacts with a control or menu item on the dialog.
  536.  
  537. These messages can be altered by the callback if sent from the CoachSetDialogFilter command, by returning a value in the callback return variable.
  538.  
  539. RTN Callback return value (used only from CoachSetDialogFilter command):
  540.  
  541. undefined = Send the event to the application
  542.  
  543. 0 = Send the event to the application
  544.  
  545. 1 = Don't send the event to the application
  546.  
  547. [0..2], [4..6], [8..9] are as described above
  548.  
  549. [3] Control name or number, or:
  550.  
  551. "" if from a menu item
  552.  
  553. "OKBttn" if from the predefined OK button
  554.  
  555. "CancelBttn" if from the predefined Cancel button
  556.  
  557. [7] Control window handle ("" if from a menu item)
  558.  
  559. [10] Notification code (depends on the control type):
  560.  
  561. Popup Button Menu items:
  562.  
  563. 0 = (not used)
  564.  
  565. Windows ListBox:
  566.  
  567. 1 = LBN_SELCHANGE - Item selection changed (not sent from CoachSetDialogFilter)
  568.  
  569. 2 = LBN_DBLCLK - Item was double clicked
  570.  
  571. WP ListBox:
  572.  
  573. 1 = WLBN_SELCHANGE - Item selection changed (not sent from CoachSetDialogFilter)
  574.  
  575. 2 = WLBN_DBLCLK - Item was double clicked
  576.  
  577. 10 = WLBN_RBUTTONDOWN - The right mouse button was clicked in the list box (not sent from CoachSetDialogFilter)
  578.  
  579. 11 = WLBN_VK_DELETE - The delete key was pressed in the list box (not sent from CoachSetDialogFilter)
  580.  
  581. 12 = WLBN_VK_INSERT - The insert key was pressed in the list box (not sent from CoachSetDialogFilter)
  582.  
  583. 13 = WLBN_CHECKCHANGE - The check box next to an item was clicked in a list box with the CheckBoxes! style (not sent from CoachSetDialogFilter)
  584.  
  585. Windows ComboBox:
  586.  
  587. 1 = CBN_SELCHANGE -Item selection changed (not sent from CoachSetDialogFilter)
  588.  
  589. 2 = CBN_DBLCLK - Item was double clicked
  590.  
  591. WP ComboBox:
  592.  
  593. 1 = WCBN_SELCHANGE -Item selection changed (not sent from CoachSetDialogFilter)
  594.  
  595. 2 = WCBN_DBLCLK - Item was double clicked
  596.  
  597. Color control:
  598.  
  599. 5123 = HLSN_NEWVALUEDONE - A new color was selected (not sent from CoachSetDialogFilter)
  600.  
  601. Counter control:
  602.  
  603. 907 = CNTN_STEPUP - Up arrow was clicked, stepping up to next value (not sent from CoachSetDialogFilter)
  604.  
  605. 908 = CNTN_STEPDOWN - Down arrow was clicked, stepping down to previous value (not sent from CoachSetDialogFilter)
  606.  
  607. Push Button:
  608.  
  609. 0 = BN_CLICKED - Button was clicked
  610.  
  611. 5 = BN_DBLCLK - Button was double clicked (not sent from DialogShow)
  612.  
  613. Radio Button:
  614.  
  615. 0 = BN_CLICKED - Button was clicked
  616.  
  617. 5 = BN_DBLCLK - Button was double clicked (not sent from DialogShow)
  618.  
  619. Checkbox:
  620.  
  621. 0 = BN_CLICKED - Button was clicked
  622.  
  623. 5 = BN_DBLCLK - Button was double clicked (not sent from DialogShow)
  624.  
  625. Edit Box:
  626.  
  627. (none)
  628.  
  629. FileNameEntry:
  630.  
  631. 0 = FNEN_DLGDISMISS - File dialog was dismissed (not sent from CoachSetDialogFilter)
  632.  
  633. 1 = FNEN_DLGRAISE - File dialog was displayed (not sent from CoachSetDialogFilter)
  634.  
  635. 2 = FNEN_PFMK_DLGRAISE - File dialog was displayed (not sent from CoachSetDialogFilter)
  636.  
  637. 3 = FNEN_DLGDISMISS_OK - File dialog was dismissed by OK button (not sent from CoachSetDialogFilter)
  638.  
  639. 4 = FNEN_DLGDISMISS_CANCEL - File dialog was dismissed by Cancel button (not sent from CoachSetDialogFilter)
  640.  
  641. Date control:
  642.  
  643. 0 = DATEN_DLGRAISE - Date dialog was displayed (not sent from CoachSetDialogFilter)
  644.  
  645. 1 = DATEN_DLGDISMISS - Date dialog was dismissed (not sent from CoachSetDialogFilter)
  646.  
  647. 2 = DATEN_DLGDISMISS_OK - Date dialog was dismissed by OK button (not sent from CoachSetDialogFilter)
  648.  
  649. 3 = DATEN_DLGDISMISS_CANCEL - Date dialog was dismissed by Cancel button (not sent from CoachSetDialogFilter)
  650.  
  651. Bitmap:
  652.  
  653. (none)
  654.  
  655. HotSpot:
  656.  
  657. 0 = BMPN_CLICKED - Bitmap was clicked
  658.  
  659. 1 = BMPN_DOUBLECLICKED - Bitmap was double clicked
  660.  
  661. Popup Menu Button:
  662.  
  663. 500 = WPN_MENUCLOSE - Popup menu was closed (not sent from CoachSetDialogFilter)
  664.  
  665. [11] Control id or menu item id (depends on the control type):
  666.  
  667. Menu item:
  668.  
  669. Menu item id - Dividing this by 100 gives the position of the item in the menu
  670.  
  671. Controls:
  672.  
  673. Control id or:
  674.  
  675. 1 = from the predefined OK button
  676.  
  677. 2 = from the predefined Cancel button
  678.  
  679. Entries for MessageBox callback (type 4 - CBTYPE_CBTMSGBOX)
  680.  
  681. This type of callback is setup by the CoachMessageBoxEx command.
  682.  
  683. Callbacks called only if Modality parameter is not Simple!.
  684.  
  685. RTN Callback return value not used
  686.  
  687. [0] Callback array contains 4 elements
  688.  
  689. [1] Callback type 4 = CBTYPE_CBTMSGBOX
  690.  
  691. [2] Name of the message box
  692.  
  693. [3] Name of the control
  694.  
  695. [4] Control state:
  696.  
  697. 0 = Checked, pressed or clicked
  698.  
  699. 1 = Unchecked, not pressed, or not clicked
  700.  
  701. CallbackResume
  702.  
  703. Example
  704.  
  705. Description
  706.  
  707. Resume macro execution paused by CallbackWait. The macro continues to the next command after CallbackWait.
  708.  
  709. See the example under CallbackWait.
  710.  
  711. CallbackWait
  712.  
  713. Example
  714.  
  715. Syntax
  716.  
  717. ()
  718.  
  719. Description
  720.  
  721. Replace the loop statement after DialogShow, pausing the macro to allow the callback to be executed. Use this command with CallbackResume.
  722.  
  723. CallbackWait and CallbackResume are easier to use and more efficient than loops.
  724.  
  725. Example with CallbackWait and CallbackResume
  726.  
  727. DialogDefine (Dialog:"Dialog1"; Left:50; Top:50; Width:200; Height:150; Style:Percent!|OK!; Caption:"Dialog 1")
  728.  
  729. DialogShow ("Dialog1"; "WordPerfect"; Msg)
  730.  
  731. CallbackWait
  732.  
  733. Quit
  734.  
  735. Label (Msg)
  736.  
  737. If (Msg[5] = 274)
  738.  
  739. DialogDestroy ("Dialog1")
  740.  
  741. CallbackResume
  742.  
  743. Return
  744.  
  745. Endif
  746.  
  747. If (Msg[3] = "OKBttn")
  748.  
  749. DialogDestroy ("Dialog1")
  750.  
  751. CallbackResume
  752.  
  753. Return
  754.  
  755. Endif
  756.  
  757. Return
  758.  
  759. Example with While loop
  760.  
  761. DialogDefine (Dialog:"Dialog1"; Left:50; Top:50; Width:200; Height:150; Style:Percent!|OK!; Caption:"Dialog 1")
  762.  
  763. DialogShow ("Dialog1"; "WordPerfect"; Msg)
  764.  
  765. Loop = 1
  766.  
  767. While (Loop)
  768.  
  769. EndWhile
  770.  
  771. Quit
  772.  
  773.  
  774.  
  775. Label (Msg)
  776.  
  777. If (Msg[5] = 274)
  778.  
  779. DialogDestroy ("Dialog1")
  780.  
  781. Loop = 0
  782.  
  783. Return
  784.  
  785. Endif
  786.  
  787. If (Msg[3] = "OKBttn")
  788.  
  789. DialogDestroy ("Dialog1")
  790.  
  791. Loop = 0
  792.  
  793. Return
  794.  
  795. Endif
  796.  
  797. Return
  798.  
  799. enumeration := Cancel
  800.  
  801. Example
  802.  
  803. Syntax
  804.  
  805. ([State: enumeration])
  806.  
  807. Description
  808.  
  809. Determine how a macro responds to a Cancel condition.
  810.  
  811. Create a Cancel condition by pressing Esc, or with Assert(CancelCondition!).
  812.  
  813. Return Value
  814.  
  815. Off! Previous Cancel state was Off!
  816.  
  817. On! Previous Cancel state was On!
  818.  
  819. Parameters
  820.  
  821. State: enumeration (optional)    Specify the Cancel state. Cancel state is On! when a macro begins. If missing, the current state is returned without changing it.
  822.  
  823. Off! Ignore a Cancel condition.
  824.  
  825. On! Stop a macro unless preceded by OnCancel, which directs macro execution to a specified Label.
  826.  
  827. Case
  828.  
  829. Example
  830.  
  831. Syntax
  832.  
  833. (<Test> any; {<Case> any; <Label> label}; [<DefaultLabel> label])
  834.  
  835. Description
  836.  
  837. A conditional statement that tests for matching expressions. If a match is found, a Label is called.
  838.  
  839. Case compares <Test> to a set of <Cases> (values). If the first comparison is true (if <Test> and <Case> match), the Label following <Case> is called. If the comparison is false, the next <Case> is evaluated and so forth. If no comparison is true, DefaultLabel is called.
  840.  
  841. Parameters
  842.  
  843. Test: any    The control expression. Variables are assigned values by commands such as GetString, GetNumber, or Menu.
  844.  
  845. Case: any    An expression (variable, constant, character) with a value that is usually assigned before the macro is compiled. It is possible to assign the value at run-time.
  846.  
  847. Label: label    Label to call if <Case> matches <Test>.
  848.  
  849. DefaultLabel: label (optional)    The Label to execute if no <Case> matches <Test>. If not specified, the statement immediately following Case is executed.
  850.  
  851. CaseCall
  852.  
  853. Example
  854.  
  855. Syntax
  856.  
  857. (<Test> any; {<Case> any; <Label> label}; [<DefaultLabel> label])
  858.  
  859. Description
  860.  
  861. A conditional statement that tests for matching expressions. If a match is found, a Label is called.
  862.  
  863. Case Call compares <Test> to a set of <Cases> (values). If the first comparison is true (if <Test> and <Case> match), the Label following <Case> is executed. If the comparison is false, the next <Case> is evaluated and so forth. If no comparison is true, <DefaultLabel> is executed.
  864.  
  865. Case is different from Case Call, in that a Return statement after Label directs macro execution to the statement that follows Case Call.
  866.  
  867. Parameters
  868.  
  869. Test: any    The control expression. Variables are assigned values by commands such as GetString, GetNumber, or Menu.
  870.  
  871. Case: any    An expression (variable, constant, character) with a value that is usually assigned before the macro is compiled. It is possible to assign the value at run-time.
  872.  
  873. Label: label    Label to call if <Case> matches <Test>.
  874.  
  875. DefaultLabel: label (optional)    The Label to execute if no <Case> matches <Test>. If not specified, the statement immediately following Case Call is executed.
  876.  
  877. CaseOf
  878.  
  879. Example
  880.  
  881. Syntax
  882.  
  883. ({<Selector> any})
  884.  
  885. Description
  886.  
  887. Identify the code to execute when a CaseOf <Selector> matches the control expression in a Switch statement. Parentheses around Selector are optional. See Switch.
  888.  
  889. numeric := Ceiling
  890.  
  891. Syntax
  892.  
  893. (Value: numeric)
  894.  
  895. Description
  896.  
  897. Get the smallest integer greater than or equal to a specified value (the ceiling of a number).
  898.  
  899. Example
  900.  
  901. vInt := Ceiling (15.4)
  902.  
  903. Result: vInt = 16
  904.  
  905. Return Value
  906.  
  907. Integer.
  908.  
  909. Parameters
  910.  
  911. Value: numeric    Return the ceiling of this value.
  912.  
  913. Chain
  914.  
  915. Example
  916.  
  917. Syntax
  918.  
  919. (MacroFilename: string; {[Parameter: any]})
  920.  
  921. Description
  922.  
  923. Call (start) another macro when the parent macro ends.
  924.  
  925. Corel PerfectScript automatically compiles uncompiled Chain macros. Macro execution stops if the macro will not compile. A Chain macro does not return to its caller (see Run).
  926.  
  927. Although Chain can occur anywhere in a macro, the Chain macro does not execute until the current macro ends. If the current macro contains more than one Chain command, only the macro file in the last Chain command is executed when the current macro ends.
  928.  
  929. You can cancel Chain (so the macro is not executed) with a Quit statement. For example,
  930.  
  931. Chain(EnvPaths + "Test4.wcm")
  932.  
  933. ...other statements...
  934.  
  935. Switch(Test)
  936.  
  937. CaseOF 1: Chain(EnvPaths + "Test1.wcm")
  938.  
  939. CaseOF 2: Chain(EnvPaths + "Test2.wcm")
  940.  
  941. CaseOF 3: Chain(EnvPaths + "Test3.wcm")
  942.  
  943. CaseOF 4: Call(DoSomethingElse)
  944.  
  945. Default: Quit
  946.  
  947. EndSwitch
  948.  
  949. Explanation: If <Test> equals 1, 2, or 3, the corresponding macro plays when the parent macro ends. If <Test> equals 4, the DoSomethingElse subroutine is called and Test4.wcm plays when the parent macro ends. If <Test> does not equal 1, 2, 3, or 4, the macro quits and a Chain statement does not execute.
  950.  
  951. Parameters
  952.  
  953. MacroFilename: string    The path and filename of a compiled macro.
  954.  
  955. Parameter: any (optional)    Enclose multiple parameters in braces ({ }), separated by a semicolon. For example: Chain ("macro"; {"a"; "b"; "c"}). Parameter values are passed to a special array variable named MacroArgs.
  956.  
  957. If missing, MacroArgs[ ] is not defined in the new macro.
  958.  
  959. numeric := CharLen
  960.  
  961. Example
  962.  
  963. Syntax
  964.  
  965. (String: string)
  966.  
  967. Description
  968.  
  969. Return the number of characters in a string, including codes.
  970.  
  971. The string can be a variable, constant, character string, or result of an expression. See StrLen for examples.
  972.  
  973. Return Value
  974.  
  975. The number of characters, including codes, in a string.
  976.  
  977. Parameters
  978.  
  979. String: string    A variable, constant, character string, or result of an expression.
  980.  
  981. numeric := CharPos
  982.  
  983. Example
  984.  
  985. Syntax
  986.  
  987. (String: string; SubString: string; [Beginning: numeric])
  988.  
  989. Description
  990.  
  991. Return the beginning character position of a substring in a string.
  992.  
  993. Examples
  994.  
  995. vPos := CharPos("WordPerfect"; "Perfect")
  996.  
  997. Result: vPos = 5
  998.  
  999. vPos := CharPos("WordPerfect"; "Scott")
  1000.  
  1001. Result: vPos = 0
  1002.  
  1003. vPos := CharPos("WordPerfect"; "or"; 7)
  1004.  
  1005. Result: vPos = 8
  1006.  
  1007. Explanation: Search begins at character position 7, bypassing the first occurrence of the substring.
  1008.  
  1009. Return Value
  1010.  
  1011. The beginning character position of a substring, or 0 if a substring is not found.
  1012.  
  1013. Parameters
  1014.  
  1015. String: string    A character string to evaluate.
  1016.  
  1017. Substring: string    A substring to locate in String.
  1018.  
  1019. Beginning: numeric (optional)    Begin looking for Substring at this character position (see the example above). If missing, 1 is used.
  1020.  
  1021. numeric := CheckSum
  1022.  
  1023. Syntax
  1024.  
  1025. ([Data: any]; [Options: enumeration]: [Seed: numeric])
  1026.  
  1027. Description
  1028.  
  1029. This command computes a checksum for a data value.
  1030.  
  1031. Return Value
  1032.  
  1033. The checksum is computed on the data value, and returned.
  1034.  
  1035. Parameters
  1036.  
  1037. Data:
  1038.  
  1039. any    The data to compute the checksum on. Any type of data may be passed, including strings, numerics, raw binary data, arrays, etc... If an array is passed, the cumulative checksum of the values of all the array elements is computed. 
  1040.  
  1041. Options:
  1042.  
  1043. enumeration    The checksum type to compute. Different types of checksums return checksums that are less prone to error than others. If missing, CheckSum32! Is used.
  1044.  
  1045. CheckSum16! Compute a 16 bit checksum. This is the 16 bit checksum used internally by the PerfectFit shared code. The checksum in the loword of the return value.
  1046.  
  1047. CheckSum32! Compute a 32 bit checksum. This is the 32 bit checksum used interally by the PerfectFit shared code.
  1048.  
  1049. CRC_16! Compute a 16 bit checksum based on the CRC 16 polynomial. The checksum in the loword of the return value.
  1050.  
  1051. CCITT! Compute a 32 bit checksum based on the CCITT polynomial.
  1052.  
  1053. AUTODIN_II! Compute a checksum based on the AUTODIN_II polynomial.
  1054.  
  1055. Seed:
  1056.  
  1057. numeric    A checksum from a previous piece of data that is used as a starting point for the checksum. This allows long streams of data to be computed, by passing the checksum from the previous piece of data into the Seed parameter of a subsequent piece. On the first piece of data, ommit this parameter, or specify as a 0. If missing, an initial seed is used that depends on the value of the Options parameter above.
  1058.  
  1059. boolean := CloseFile
  1060.  
  1061. Example
  1062.  
  1063. Syntax
  1064.  
  1065. ([FileID: numeric])
  1066.  
  1067. Description
  1068.  
  1069. Close one file or all files.
  1070.  
  1071. Close file(s) when they are no longer needed, or system resources will be lost. All open files are closed automatically when the macro ends. See OpenFile.
  1072.  
  1073. Return Value
  1074.  
  1075. True if successful, False if not.
  1076.  
  1077. Parameters
  1078.  
  1079. FileID: numeric (optional)    If not specified, all open files are closed.
  1080.  
  1081. enumeration := Condition
  1082.  
  1083. Syntax
  1084.  
  1085. (Condition: enumeration or numeric; [State: enumeration])
  1086.  
  1087. Description
  1088.  
  1089. Determine how a macro responds to a Cancel, Error, NotFound, or user-defined condition.
  1090.  
  1091. Example
  1092.  
  1093. If Cancel is On! to start, the following two lines return the following results.
  1094.  
  1095. vCnd1 := Condition (CancelCondition!; Off!)
  1096.  
  1097. Result := vCnd1 = On! (condition was On!, now is Off!)
  1098.  
  1099. vCnd2 := Condition (CancelCondition!; On!)
  1100.  
  1101. Result := vCnd2 = Off! (condition was Off!, now is On!)
  1102.  
  1103. Return Value
  1104.  
  1105. Off! Previous condition state was Off!
  1106.  
  1107. On! Previous condition state was On!
  1108.  
  1109. Parameters
  1110.  
  1111. Condition: enumeration or numeric    Specify a condition to change. See OnCondition6297 for a description of how to specify a user-defined condition number.
  1112.  
  1113. CancelCondition! See the Cancel command.
  1114.  
  1115. ErrorCondition! See the Error command.
  1116.  
  1117. ExitCondition! See the ExitHandlerState command.
  1118.  
  1119. NotFoundCondition! See the NotFound command.
  1120.  
  1121. UserDefinedCondition! See the OnCondition command.
  1122.  
  1123. VarErrChkCondition! See the VarErrChk command.
  1124.  
  1125. State: enumeration (optional)    Set the state of the specified condition. When a macro starts, all conditions are On!. If missing, the current state is returned without changing it.
  1126.  
  1127. Off! Ignore the specified condition.
  1128.  
  1129. On! Stop a macro unless preceded by OnCondition, which directs macro execution to a specified Label.
  1130.  
  1131. Constant
  1132.  
  1133. Syntax
  1134.  
  1135. ({<Name> variable := <Value> any})
  1136.  
  1137. Description
  1138.  
  1139. Define a constant variable (an identifier whose value cannot change at run-time).
  1140.  
  1141. Constants make macros easier to read. For example,
  1142.  
  1143. Constant (Start := 0; Stop := 1)
  1144.  
  1145. defines two constants. Start is replaced by 0 wherever it occurs in the macro, and Stop by 1.
  1146.  
  1147. Constants are compile-time only commands that are constant from the point of declaration to the end of the macro. All constants have a single value (array constants are not accepted), and cannot appear on the left side of subsequent assignment statements (or a compile-time error occurs).
  1148.  
  1149. Separate multiple definitions with a semicolon. Parentheses are optional.
  1150.  
  1151. Examples
  1152.  
  1153. Constant (Inch := 2.54C; Diameter := Inch)
  1154.  
  1155. Constant Radius := 10I
  1156.  
  1157. Constant (Tel := "222-5555")
  1158.  
  1159. Constant Team := "Dana, Steve, Alice, Barry, Jenny, Dave"
  1160.  
  1161. numeric := Constants
  1162.  
  1163. Syntax
  1164.  
  1165. (Constant: enumeration)
  1166.  
  1167. Description
  1168.  
  1169. Get various mathematical and physical constants.
  1170.  
  1171. Return Value
  1172.  
  1173. A constant.
  1174.  
  1175. Parameters
  1176.  
  1177. Constant: enumeration    The math constant to return.
  1178.  
  1179. e! Napierian base of natural logarithms.
  1180.  
  1181. pi! Ratio of the circumference of a circle to its diameter.
  1182.  
  1183. EulersConstant! Euler's constant
  1184.  
  1185. GoldenRatio! Approximately (1+(square root of 5))/2.
  1186.  
  1187. Continue
  1188.  
  1189. Example
  1190.  
  1191. Execute the code in the next CaseOf statement without evaluating its expression. See Switch.
  1192.  
  1193. any := ConvertType
  1194.  
  1195. Syntax
  1196.  
  1197. (Value: any; Type: enumeration; [DefaultUnitsType: enumeration])
  1198.  
  1199. Description
  1200.  
  1201. Convert a value to a specified data type.
  1202.  
  1203. If Value is a number and Type is a measurement, or if Value is a measurement and Type is a number, a measurement conversion is also applied to the magnitude of the value to convert between the measurement and the type specified by DefaultUnitsType. You can prevent this by specifying None! for DefaultUnitsType.
  1204.  
  1205. If both Value and Type are measurements, or if both are numbers, DefaultUnitsType is not used.
  1206.  
  1207. Example
  1208.  
  1209. vTestValue := 72
  1210.  
  1211. vResult = ConvertType( vTestValue; Centimeters!; Points! )
  1212.  
  1213. Result: vResult = 2.54C
  1214.  
  1215. Return Value
  1216.  
  1217. Converted data type.
  1218.  
  1219. Parameters
  1220.  
  1221. Value: any    Value to convert.
  1222.  
  1223.         Type: enumeration    Convert Value to this data type.
  1224.  
  1225. Boolean!
  1226.  
  1227. String! WP string.
  1228.  
  1229. WPString!
  1230.  
  1231. AnsiString!
  1232.  
  1233. OemString!
  1234.  
  1235. Number! Convert Value to a float or an integer. Value is converted to an integer if the result has no fractional part and is in the range of an integer.
  1236.  
  1237. Float!
  1238.  
  1239. Integer!
  1240.  
  1241. Measurement! Convert Value to the measurement type specified by the current default units type (see DefaultUnits).
  1242.  
  1243. Centimeters!
  1244.  
  1245. Inches!
  1246.  
  1247. Millimeters!
  1248.  
  1249. Points!
  1250.  
  1251. WPUnits!
  1252.  
  1253. RawBinary!
  1254.  
  1255. DateTime! Convert Value to a DateTime value, stored as a number by the Date and Time commands. See Date and Time commands for more information.
  1256.  
  1257. DefaultUnitsType: enumeration (optional)    Default units to use when converting between measurements and numbers. If both Value and Type are measurements, or if both are numbers, this parameter is not used. If missing, DefaultUnits! is used.
  1258.  
  1259. None! Do no number-to-measurement conversion. This causes no conversion of the magnitude of the numeric value. It changes only the type of the value. See the None! value of the DefaultUnits command.
  1260.  
  1261. DefaultUnits! Assume that numbers are in the units specified by the current default units type.
  1262.  
  1263. Centimeters! Assume that numbers are in units of centimeters.
  1264.  
  1265. Inches! Assume that numbers are in units of inches.
  1266.  
  1267. Millimeters! Assume that numbers are in units of millimeters.
  1268.  
  1269. Points! Assume that numbers are in units of points.
  1270.  
  1271. WPUnits! Assume that numbers are in units of WPUnits.
  1272.  
  1273. boolean := CopyFile
  1274.  
  1275. Example
  1276.  
  1277. Syntax
  1278.  
  1279. (SourceFilename: string; DestinationFilename: string; [Prompts: enumeration])
  1280.  
  1281. Description
  1282.  
  1283. Copy a file.
  1284.  
  1285. Return Value
  1286.  
  1287. True if successful, False if not.
  1288.  
  1289. Parameters
  1290.  
  1291. SourceFilename: string    A path and filename.
  1292.  
  1293. DestinationFilename: string    A path and filename.
  1294.  
  1295. Prompts: enumeration (optional)    Default: NoPrompts!
  1296.  
  1297. NoPrompts!
  1298.  
  1299. Prompts! Confirm replacement if the destination file exists.
  1300.  
  1301. numeric := cos
  1302.  
  1303. Syntax
  1304.  
  1305. (Angle: numeric)
  1306.  
  1307. Description
  1308.  
  1309. Get the cosine of an angle in radians.
  1310.  
  1311. Return Value
  1312.  
  1313. Cosine of an angle.
  1314.  
  1315. Parameters
  1316.  
  1317. Angle: numeric    Get the cosine of this angle.
  1318.  
  1319. numeric := cosh
  1320.  
  1321. Syntax
  1322.  
  1323. (Angle: numeric)
  1324.  
  1325. Description
  1326.  
  1327. Get the hyperbolic cosine of an angle in radians.
  1328.  
  1329. Return Value
  1330.  
  1331. Hyperbolic cosine of an angle.
  1332.  
  1333. Parameters
  1334.  
  1335. Angle: numeric    Get the hyperbolic cosine of this angle.
  1336.  
  1337. boolean := CreateDirectory
  1338.  
  1339. Example
  1340.  
  1341. Syntax
  1342.  
  1343. (DirectoryName: string; [Prompts: enumeration])
  1344.  
  1345. Description
  1346.  
  1347. Create a directory.
  1348.  
  1349. Return Value
  1350.  
  1351. True if successful, False if not.
  1352.  
  1353. Parameters
  1354.  
  1355. DirectoryName: string    Include the full path.
  1356.  
  1357. Prompts: enumeration (optional)    Default: NoPrompts!
  1358.  
  1359. NoPrompts!
  1360.  
  1361. Prompts! Prompt if the directory exists.
  1362.  
  1363. OLEObjectVariable := CreateObject
  1364.  
  1365. Syntax
  1366.  
  1367. (ClassName: string)
  1368.  
  1369. Description
  1370.  
  1371. Create a new instance of an OLE object.
  1372.  
  1373. Return Value
  1374.  
  1375. Instance that identifies an OLE object. After an OLE object variable is assigned an object instance, commands can be called, and values obtained and set for the object variable. When the object and variable are no longer needed, use the Discard command to destroy the object instance.
  1376.  
  1377. Parameters
  1378.  
  1379. ClassName: string    Class name of the OLE object to create, also called the ProgID. This must be the name of a registered OLE automation object. You can located the name of the OLE component in the Windows Registry under the HKEY_CLASSES_ROOT key.
  1380.  
  1381. Example
  1382.  
  1383. //*** Declare an ODBC object
  1384.  
  1385. DECLARE dataOb
  1386.  
  1387. Object(dataOb; "CorelPDControl.DBControl")
  1388.  
  1389. //*** Set a reference to the ODBC data object
  1390.  
  1391. dataOb := CreateObject("CorelPDControl.DBControl")
  1392.  
  1393. //**** Call connect()
  1394.  
  1395. dataOb.Connect()
  1396.  
  1397. Note
  1398.  
  1399.   This command is not available for use on a Linux operating system.
  1400.   
  1401. numeric := CToN
  1402.  
  1403. Example
  1404.  
  1405. Syntax
  1406.  
  1407. (Character: string)
  1408.  
  1409. Description
  1410.  
  1411. Convert a character to its numeric equivalent.
  1412.  
  1413. Return Value
  1414.  
  1415. Numeric equivalent of a character.
  1416.  
  1417. Parameters
  1418.  
  1419. Character: string    Character to convert. If a string is used, the numeric equivalent of the first character is returned.
  1420.  
  1421. numeric := CubeRoot
  1422.  
  1423. Syntax
  1424.  
  1425. (Value: numeric)
  1426.  
  1427. Description
  1428.  
  1429. Get the cube root of a value.
  1430.  
  1431. Example
  1432.  
  1433. x = CubeRoot (4)
  1434.  
  1435. MessageBox (Caption:"Example"; Message:"CubeRoot(4)="+ x; Style:OK!)
  1436.  
  1437. Return Value
  1438.  
  1439. Cube root.
  1440.  
  1441. Parameters
  1442.  
  1443. Value: numeric    Get the cube root of this value.
  1444.  
  1445. Currency
  1446.  
  1447. Syntax
  1448.  
  1449. Description
  1450.  
  1451. Return Value
  1452.  
  1453. Parameters
  1454.  
  1455.     
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.