home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 14 / 14.iso / s / s005 / 58.ddi / AMIMACRO.HL$ / AMIMACRO.HLP (.txt)
Encoding:
OS/2 Help File  |  1993-11-09  |  960.1 KB  |  26,426 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. About ΓòÉΓòÉΓòÉ
  3.  
  4. This function displays the About Ami Pro dialog box. This function is 
  5. equivalent to choosing Help About Ami Pro. 
  6.  
  7.  
  8. Syntax 
  9. About() 
  10.  
  11. Return Value 
  12. This function does not return a value. 
  13.  
  14. Example 
  15. FUNCTION Example() 
  16. About()       'This brings up the About Ami Pro dialog box 
  17. END FUNCTION 
  18. See also: 
  19.     Help 
  20.     HowDoIHelp 
  21.     MacroHelp 
  22.     UsingHelp 
  23.  
  24.  
  25. ΓòÉΓòÉΓòÉ 2. ActivateApp ΓòÉΓòÉΓòÉ
  26.  
  27. This function causes the application used in the argument to become the active 
  28. application in OS/2. This function is equivalent to choosing the application 
  29. from the OS/2 Window List. The application must be started before this command 
  30. is used. 
  31.  
  32.  
  33. Though control passes to the named application, Ami Pro regains control if the 
  34. macro continues with additional statements beyond this statement. 
  35.  
  36. Syntax 
  37. ActivateApp(App) 
  38. App is the name of the application that you want to find. The name you use must 
  39. appear as it does in the Window List window or as it does in the application's 
  40. title bar. 
  41.  
  42. Return Value 
  43. 1  (TRUE) if the application was activated. 
  44. 0  (FALSE) if control could not be passed to the application or if the 
  45. application was incorrectly named. 
  46.  
  47. Example 
  48. FUNCTION Example() 
  49. 'Notify the user what we are doing 
  50. 'Check to see if the app is running 
  51. IF AppIsRunning("CMD.EXE") 
  52.     'Activate it if it is 
  53.     ActivateApp("CMD.EXE") 
  54.     'Restore it to its previous size 
  55.     AppRestore("CMD.EXE") 
  56. ELSE 
  57.     'Run it if it is not (it becomes the active app) 
  58.     Exec("CMD.EXE", 1) 
  59. ENDIF 
  60. StatusBarMsg("")  'Clear the status bar 
  61. END FUNCTION 
  62.  
  63. See also: 
  64.  
  65.     AppGetAppCount 
  66.     AppGetAppNames 
  67.     AppHide 
  68.     AppIsRunning 
  69.     AppMaximize 
  70.     AppMinimize 
  71.     AppMove 
  72.     AppRestore 
  73.     AppSize 
  74.     Exec 
  75.  
  76.  
  77. ΓòÉΓòÉΓòÉ 3. ADDCascadeMenu ΓòÉΓòÉΓòÉ
  78.  
  79. This function adds a cascading menu to the end of an existing pull down menu. 
  80.  
  81.  
  82. Syntax 
  83. AddCascadeMenu(BarID, Menu, CascadeMenu) 
  84. BarID is the identification number of the menu bar and must always be 1. 
  85. Menu is the name of the pull down menu this cascade menu should be added to. 
  86. This must match exactly the name of the pull down menu you want to add to, 
  87. including any ampersand (&) characters. An ampersand is placed before a 
  88. character that has an underline. 
  89. CascadeMenu is the name of the Cascade menu you want to add. Placing an 
  90. ampersand (&) in front of a character makes that character appear underlined 
  91. and makes that character a shortcut key. 
  92.  
  93. Return Value 
  94. 1  (TRUE) if the cascading menu was created. 
  95. 0  (FALSE) if the cascading menu was not created. 
  96.  
  97. Example 
  98. FUNCTION Example() 
  99. ' Add a new cascade to the page menu 
  100. Mac = GetRunningMacroFile$()   ' Name of running macro 
  101. Menu = "&Page" 
  102. Cascade = "New &Cascade" 
  103. DeleteMenuItem(1,Menu,Cascade) ' We don't want multiple cascades 
  104. AddCascadeMenu(1, Menu,Cascade) 
  105. AddCascadeMenuItem(1, Menu, Cascade, "Item1","{Mac}!Item1()","Help for item1") 
  106. AddCascadeMenuItem(1, Menu, Cascade, "My File New",New,"") 
  107. AddCascadeMenuItem(1, Menu, Cascade, "My Copy",Copy,"") 
  108. End Function 
  109.  
  110. Function Item1() 
  111. Message("Nice menu!") 
  112. End Function 
  113.  
  114. See also: 
  115.  
  116.     AddCascadeMenuItem 
  117.     AddMenu 
  118.     AddMenuItem 
  119.     ChangeMenuAction 
  120.     CheckMenuItem 
  121.     DeleteMenu 
  122.     DeleteMenuItem 
  123.     GrayMenuItem 
  124.     InsertCascadeMenuItem 
  125.     InsertCascadeMenu 
  126.     InsertMenuItem 
  127.     InsertMenu 
  128.     RenameMenuItem 
  129.  
  130.  
  131. ΓòÉΓòÉΓòÉ 4. AddCascadeMenuItem ΓòÉΓòÉΓòÉ
  132.  
  133. This function adds a menu item to an existing cascading menu. 
  134.  
  135.  
  136. Syntax 
  137. AddCascadeMenuItem(BarID, Menu, CascadeMenu, Item, MacroName[!Function[(parm1[, 
  138. parm2...])]], Help) 
  139. BarID is the identification number of the menu bar and must always be 1. 
  140. Menu is the name of the pull down menu this cascade menu should be added to. 
  141. This must match exactly the name of the pull down menu you want to add to, 
  142. including any ampersand (&) characters. An ampersand is placed before a 
  143. character that has an underline. 
  144. CascadeMenu is the name of the cascade menu you want to add. Placing an 
  145. ampersand (&) in front of a character makes that character appear underlined 
  146. and makes that character a shortcut key. 
  147. Item is the name of the menu item to add. Placing an ampersand (&) in front of 
  148. a character makes that character appear underlined and makes that character a 
  149. shortcut key. If the menu item has a shortcut key, you must press TAB, type a 
  150. ^, and then type the appropriate letter as part of the item name. 
  151. MacroName is the name of the macro to run if this menu item is selected. This 
  152. parameter may contain the macro file name, the function within that file to 
  153. call, and any parameters that function may require. At a minimum, this 
  154. parameter must contain the macro file name. 
  155. Help is the one-line Help text that appears in the title bar of Ami Pro when 
  156. this menu item is highlighted. It is not optional for this function. 
  157.  
  158. Return Value 
  159. 1  (true) if the new menu bar was created. 
  160. 0  (UserCancel/FALSE) if the new menu bar was not created or if the user 
  161. canceled the function. 
  162.  
  163. Example 
  164. FUNCTION Example() 
  165. ' Add a new cascade to the page menu 
  166. Mac = GetRunningMacroFile$()   ' Name of running macro 
  167. Menu = "&Page" 
  168. Cascade = "New &Cascade" 
  169. DeleteMenuItem(1,Menu,Cascade) ' We don't want multiple cascades 
  170. AddCascadeMenu(1, Menu,Cascade) 
  171. AddCascadeMenuItem(1, Menu, Cascade, "Item1","{Mac}!Item1()","Help for item1") 
  172. AddCascadeMenuItem(1, Menu, Cascade, "My File New",New,"") 
  173. AddCascadeMenuItem(1, Menu, Cascade, "My Copy",Copy,"") 
  174. End Function 
  175.  
  176. Function Item1() 
  177. Message("Nice menu!") 
  178. End Function 
  179.  
  180. See also: 
  181.  
  182.     AddCascadeMenu 
  183.     AddMenu 
  184.     AddMenuItem 
  185.     ChangeMenuAction 
  186.     CheckMenuItem 
  187.     DeleteMenu 
  188.     DeleteMenuItem 
  189.     GrayMenuItem 
  190.     InsertCascadeMenuItem 
  191.     InsertCascadeMenu 
  192.     InsertMenuItem 
  193.     InsertMenu 
  194.     RenameMenuItem 
  195.  
  196.  
  197. ΓòÉΓòÉΓòÉ 5. AddFrame ΓòÉΓòÉΓòÉ
  198.  
  199. This function automatically creates a frame. All dimensions of the frame must 
  200. be entered in twips (1 inch = 1440 twips), with the 0,0 location considered to 
  201. be the top left corner of the page. This function is equivalent to choosing 
  202. Frame Create Frame. 
  203.  
  204.  
  205. You must be in Layout Mode to call this function. 
  206.  
  207. Syntax 
  208. AddFrame(X1, Y1, X2, Y2) 
  209. X1 is the horizontal position of the top left corner of the frame. 
  210. Y1 is the vertical position of the top left corner of the frame. 
  211. X2 is the horizontal position of the bottom right corner of the frame. 
  212. Y2 is the vertical position of the bottom right corner of the frame. 
  213. The two X coordinates should either be zero or positive numbers. The two Y 
  214. coordinates should either be zero or negative numbers. 
  215.  
  216. To display the Add a Frame dialog box and allow the user to select the 
  217. coordinates: AddFrameDLG 
  218.  
  219. Return Value 
  220. 1  (TRUE) if the frame was created. 
  221. -2  (GeneralFailure) if the frame was not created. 
  222.  
  223. Example 
  224. FUNCTION Example() 
  225. Mode = GetMode()     'What mode is the screen in? 
  226. IF Mode != TRUE 
  227.     LayoutMode()     'If not Layout Mode, make it so. 
  228. ENDIF 
  229. X1 = 3000         ' horizontal - top left 
  230. Y1 = -3000        ' vertical - top right 
  231. X2 = 7000         ' horizontal - bottom right 
  232. Y2 = -7000        ' vertical - bottom right 
  233. AddFrame(X1, Y1, X2, Y2)       ' create frame 
  234. END FUNCTION 
  235.  
  236. See also: 
  237.  
  238.     AddFrameDLG 
  239.     FrameLayout 
  240.     FrameModBorders 
  241.     FrameModFinish 
  242.     FrameModInit 
  243.     FrameModLines 
  244.     FrameModType 
  245.     ImportPicture 
  246.     IsFrameSelected 
  247.     SelectFrameByName 
  248.     SetFrameDefaults 
  249.  
  250.  
  251. ΓòÉΓòÉΓòÉ 6. AddFrameDLG ΓòÉΓòÉΓòÉ
  252.  
  253. This function displays the Create Frame dialog box. This function is equivalent 
  254. to choosing Frame Create Frame. 
  255.  
  256.  
  257. This function does not automatically create a frame. To create a frame 
  258. automatically, refer to the AddFrame function. 
  259.  
  260. You must be in Layout Mode to call this function. 
  261.  
  262. Syntax 
  263. AddFrameDLG 
  264.  
  265. Return Value 
  266. 1  (TRUE) if the frame was created. 
  267. 0  (UserCancel) if the user canceled the function. 
  268.  
  269. Example 
  270. FUNCTION Example() 
  271. Mode = GetMode()  'What mode is the screen in? 
  272. IF Mode != 1 
  273.     LayoutMode()  'If not Layout Mode, make it so. 
  274. ENDIF 
  275. AddFrameDLG          'Display Add Frame dialog box. 
  276. END FUNCTION 
  277.  
  278. See also: 
  279.  
  280.     AddFrame 
  281.     FrameLayout 
  282.     FrameModBorders 
  283.     FrameModFinish 
  284.     FrameModInit 
  285.     FrameModLines 
  286.     FrameModType 
  287.     ImportPicture 
  288.     IsFrameSelected 
  289.     SelectFrameByName 
  290.     SetFrameDefaults 
  291.  
  292.  
  293.  
  294. ΓòÉΓòÉΓòÉ 7. AddMenu ΓòÉΓòÉΓòÉ
  295.  
  296. This function creates a new menu on an existing menu bar. The new menu is added 
  297. to the right of the last menu on the menu bar. 
  298.  
  299.  
  300. Syntax 
  301. AddMenu(BarID, Menu) 
  302. BarID is the identification number of the menu bar and must always be 1. 
  303. Menu is the name of the pull down menu that should be added. Placing an 
  304. ampersand (&) character before a character makes that character appear 
  305. underlined and makes that character a shortcut key. 
  306.  
  307. Return Value 
  308. 1  (TRUE) if the menu was added. 
  309. 0  (FALSE) if the menu was not added to the menu bar, or if an invalid BarID 
  310. was used. 
  311.  
  312. Example 
  313. FUNCTION Example() 
  314. thisfile = getrunningmacrofile$() 
  315. addmenu(1,"&New Menu")      ' create a new menu 
  316. addmenuitem(1,"&New Menu","Menu Item &1","{thisfile}!message1()","Display 
  317. Message 1") 
  318. addmenuitem(1,"&New Menu","Menu Item &2","{thisfile}!message2()","Display 
  319. Message 2") 
  320. ' create a cascade menu 
  321. addcascademenu(1,"&New Menu", "Cascade Menu &1") 
  322. addcascademenuitem(1,"&New Menu","Cascade Menu &1","Cascade Item &1", " 
  323. {thisfile}!message3()","Display Message 3") 
  324. addcascademenuitem(1,"&New Menu","Cascade Menu &1","Cascade Item &2", " 
  325. {thisfile}!message4()","Display Message 4") 
  326. end function 
  327.  
  328. function message1() 
  329. message("You selected Menu Item 1.") 
  330. end function 
  331. function message2() 
  332. message("You selected Menu Item 2.") 
  333. end function 
  334. function message3() 
  335. message("You selected Cascade Item 1.") 
  336. end function 
  337. function message4() 
  338. message("You selected Cascade Item 2.") 
  339. END FUNCTION 
  340.  
  341. See also: 
  342.  
  343.     AddCascadeMenu 
  344.     AddCascadeMenuItem 
  345.     AddMenuItem 
  346.     ChangeCascadeAction 
  347.     ChangeMenuAction 
  348.     CheckMenuItem 
  349.     DeleteMenu 
  350.     DeleteMenuItem 
  351.     GrayMenuItem 
  352.     InsertCascadeMenuItem 
  353.     InsertCascadeMenu 
  354.     InsertMenuItem 
  355.     InsertMenu 
  356.     RenameMenuItem 
  357.  
  358.  
  359. ΓòÉΓòÉΓòÉ 8. AddMenuItem ΓòÉΓòÉΓòÉ
  360.  
  361. This function adds a new menu item to the bottom of an existing pull down menu 
  362. or adds an item directly to an existing menu bar. 
  363.  
  364.  
  365. Syntax 
  366. AddMenuItem(BarID, Menu, Item, MacroName[!Function[(parm1[, parm2...])]][, 
  367. Help]) 
  368. BarID is the identification number of the menu bar and must always be 1. 
  369. Menu is the name of the pull down menu to which this item should be added. This 
  370. name must match the name of the pull down menu, including any ampersand (&) 
  371. characters. An ampersand is placed before a character that has an underline. 
  372. Item is the name of the menu item to add. Placing an ampersand (&) in front of 
  373. a character makes that character appear underlined and makes that character a 
  374. shortcut key. If the menu item has a shortcut key, you must press TAB, type a 
  375. ^, and then type the appropriate letter as part of the item name. 
  376. MacroName is the name of the macro to run if this menu item is selected. This 
  377. parameter may contain the macro file name, the function within that file to 
  378. call, and any parameters that function may require. At a minimum, this 
  379. parameter must contain the macro file name. If you want to run an Ami Pro 
  380. function, use its name without quotes or parentheses. 
  381. Help is the optional one-line Help text that appears in the title bar of Ami 
  382. Pro when this menu item is highlighted. 
  383. If you want the item on the menu bar: AddMenuItem 
  384.  
  385. Return Value 
  386. This function returns: 
  387. 1  (TRUE) if the new menu item was added. 
  388. 0  (FALSE) if the new menu item was not added, or if an invalid BarID or 
  389. MenuName was used. 
  390.  
  391. Example 
  392. FUNCTION Example() 
  393. thisfile = getrunningmacrofile$() 
  394. addmenu(1,"&New Menu")      ' create a new menu 
  395. addmenuitem(1,"&New Menu","Menu Item &1","{thisfile}!message1()","Display 
  396. Message 1") 
  397. addmenuitem(1,"&New Menu","Menu Item &2","{thisfile}!message2()","Display 
  398. Message 2") 
  399. ' create a cascade menu 
  400. addcascademenu(1,"&New Menu", "Cascade Menu &1") 
  401. addcascademenuitem(1,"&New Menu","Cascade Menu &1","Cascade Item &1", " 
  402. {thisfile}!message3()","Display Message 3") 
  403. addcascademenuitem(1,"&New Menu","Cascade Menu &1","Cascade Item &2", " 
  404. {thisfile}!message4()","Display Message 4") 
  405. end function 
  406.  
  407. function message1() 
  408. message("You selected Menu Item 1.") 
  409. end function 
  410. function message2() 
  411. message("You selected Menu Item 2.") 
  412. end function 
  413. function message3() 
  414. message("You selected Cascade Item 1.") 
  415. end function 
  416. function message4() 
  417. message("You selected Cascade Item 2.") 
  418. END FUNCTION 
  419.  
  420. See also: 
  421.  
  422.     AddCascadeMenu 
  423.     AddCascadeMenuItem 
  424.     AddMenu 
  425.     ChangeCascadeAction 
  426.     ChangeMenuAction 
  427.     CheckMenuItem 
  428.     DeleteMenu 
  429.     DeleteMenuItem 
  430.     GetMacPath 
  431.     GrayMenuItem 
  432.     InsertCascadeMenuItem 
  433.     InsertCascadeMenu 
  434.     InsertMenuItem 
  435.     InsertMenu 
  436.     RenameMenuItem 
  437.  
  438.  
  439. ΓòÉΓòÉΓòÉ 9. AllocGlobalVar ΓòÉΓòÉΓòÉ
  440.  
  441. This function allocates memory to hold a global variable (single element or 
  442. array). Global variables retain their values until the user frees them or exits 
  443. Ami Pro, as opposed to regular variables, which are lost once the macro is 
  444. finished. 
  445.  
  446.  
  447. Syntax 
  448. AllocGlobalVar(Name, Count) 
  449. Name is a unique number or string naming the variable being allocated. 
  450. Count is the number of entries to allocate. A count of one allocates a single 
  451. element global variable. A count of more than one allocates an array with count 
  452. elements. 
  453.  
  454. Return Value 
  455. The Name if the variable allocates memory. 
  456. 0  (FALSE) if there is no free memory to allocate. 
  457.  
  458. Example 
  459. FUNCTION Example() 
  460. varname = Query$("What do you wish to name the global variable?") 
  461. AllocGlobalVar("{varname}", 1) 
  462. Message("The variable {varname} has been allocated room in memory to hold one 
  463. entry.") 
  464. varvalue = Query$("Enter some data to put in this global variable called 
  465. {varname}.") 
  466. SetGlobalVar("{varname}", "{varvalue}") 
  467. Message("Ok, we will now go and get the value of {varname} and display it.") 
  468. Message(GetGlobalVar$("{varname}")) 
  469. END FUNCTION 
  470.  
  471. See also: 
  472.  
  473.     FreeGlobalVar 
  474.     GetGlobalArray$ 
  475.     GetGlobalVar$ 
  476.     GetGlobalVarCount 
  477.     GetGlobalVarNames 
  478.     Global Variables 
  479.     SetGlobalArray 
  480.     SetGlobalVar 
  481.  
  482.  
  483.  
  484. ΓòÉΓòÉΓòÉ 10. AmiProIndirect ΓòÉΓòÉΓòÉ
  485.  
  486. This function is used to call any Ami Pro function where the number of 
  487. parameters cannot be determined ahead of time. 
  488.  
  489.  
  490. Syntax 
  491. AmiProIndirect(FunctionName, &Parameters, Count) 
  492. FunctionName is the function you want to call. 
  493. Parameters are the arrays that contain the parameters. 
  494. Count is the number of parameters in the array. 
  495.  
  496. Return Value 
  497. 1  (TRUE) if the changes were made. 
  498. 0  (FALSE) if the changes could not be made. 
  499.  
  500. Example 
  501. FUNCTION Example() 
  502. ' how many parameters? 
  503. ParamCount = GetLayoutParmCnt(ModLayoutRightPage) 
  504. ' dimension an array for the parameters 
  505. DIM LayoutValues(ParamCount) 
  506. ' get the values 
  507. GetLayoutParameters(ModLayoutRightPage, &LayoutValues) 
  508. ' increase the top margin by 1 inch 
  509. LayoutValues(2) = LayoutValues(1) + 1440 
  510. ' prepare Ami Pro for a layout change 
  511. ModLayoutInit(512) ' apply layout 
  512. AmiProIndirect(ModLayoutRightPage, &LayoutValues, ParamCount) 
  513. ModLayoutFinish() ' let Ami Pro accept the changes 
  514. END FUNCTION 
  515.  
  516. See also: 
  517.  
  518.     GetLayoutParameters 
  519.     ModLayoutFinish 
  520.     ModLayoutInit 
  521.     ModLayoutRightPage 
  522.  
  523.  
  524.  
  525. ΓòÉΓòÉΓòÉ 11. AnswerMsgBox ΓòÉΓòÉΓòÉ
  526.  
  527. This function is used to 'reply' to an Ami Pro function that asks the user for 
  528. a response. Many functions require the user to provide some response before the 
  529. function can be completed. The Messages function allows the macro programmer to 
  530. decide if the user has to respond to messages or if the default action is 
  531. taken. The AnswerMsgBox function works in a similar manner; however, a response 
  532. determined by the programmer is taken, rather than the default. 
  533.  
  534.  
  535. The AnswerMsgBox function should be used immediately before the function which 
  536. displays the message. Unlike the Messages function, the AnswerMsgBox function 
  537. provides a response only to the next Ami Pro function called, rather than all 
  538. succeeding messages. 
  539.  
  540. In general, within a given macro, you should not mix the Messages and 
  541. AnswerMsgBox functions. 
  542.  
  543. Syntax 
  544. AnswerMsgBox(Response) 
  545. Response is the desired response to a message box displayed by a function. It 
  546. must be set to one of the following options: 
  547.     OK (1) - Equivalent to choosing OK 
  548.     Cancel (2) - Equivalent to choosing Cancel 
  549.     Abort (3) - Equivalent to choosing Abort 
  550.     Retry (4) - Equivalent to choosing Retry 
  551.     Yes (6) - Equivalent to choosing Yes 
  552.     No (7) - Equivalent to choosing No 
  553.  
  554. Return Value 
  555. This function does not return a value. 
  556.  
  557. Example 
  558. FUNCTION Example() 
  559. New("_default.sty", 0, 0) 
  560. Type("Lotus Ami Pro for OS/2") 
  561. Message("New file created. Press OK to close without saving.") 
  562. AnswerMsgBox(7) 
  563. FileClose() 
  564. END FUNCTION 
  565.  
  566. See also: 
  567.  
  568.     HourGlass 
  569.     IgnoreKeyboard 
  570.     Messages 
  571.     SingleStep 
  572.     UserControl 
  573.  
  574.  
  575.  
  576. ΓòÉΓòÉΓòÉ 12. AppClose ΓòÉΓòÉΓòÉ
  577.  
  578. This function closes any OS/2 application. 
  579.  
  580.  
  581. Syntax 
  582. AppClose(App) 
  583. App is the name of the application which should be closed. The name you use 
  584. must appear as it does in the OS/2 Window List or as it does in the 
  585. application's title bar. 
  586.  
  587. Return Value 
  588. 1  (TRUE) if the changes were made. 
  589. 0  (FALSE) if the changes could not be made. 
  590.  
  591. Example 
  592. FUNCTION Example() 
  593. exec("E.EXE", "", 1) 
  594. message("About to close E.") 
  595. AppClose("E.EXE") 
  596. END FUNCTION 
  597.  
  598. See also: 
  599.  
  600.     ActivateApp 
  601.     AppGetAppCount 
  602.     AppGetAppNames 
  603.     AppGetWindowPos 
  604.     AppHide 
  605.     AppIsRunning 
  606.     AppMaximize 
  607.     AppMinimize 
  608.     AppMove 
  609.     AppRestore 
  610.     AppSendMessage 
  611.     AppSize 
  612.  
  613.  
  614.  
  615.  
  616. ΓòÉΓòÉΓòÉ 13. AppGetAppCount ΓòÉΓòÉΓòÉ
  617.  
  618. This function allows you to get the number of currently running OS/2 
  619. applications. It is usually used to dimension an array before the 
  620. AppGetAppNames function is called. 
  621.  
  622.  
  623. Syntax 
  624. AppGetAppCount() 
  625.  
  626. Return Value 
  627. The number of running OS/2 applications. 
  628.  
  629. Example 
  630. FUNCTION Example() 
  631. numapps = AppGetAppCount()     'return the number of apps 
  632. Message("Currently, there are {numapps} applications running, whether hidden or 
  633. visible.") 
  634. DIM names(numapps)          'dimension a name array 
  635. AppGetAppNames(&names)      'get the name for the apps 
  636. FOR I = 1 to numapps    'show the name for each app 
  637.     app = names(I) 
  638.     Message(app) 
  639. NEXT 
  640. END FUNCTION 
  641.  
  642. See also: 
  643.  
  644.     ActivateApp 
  645.     AppClose 
  646.     AppGetAppNames 
  647.     AppGetWindowPos 
  648.     AppHide 
  649.     AppIsRunning 
  650.     AppMaximize 
  651.     AppMinimize 
  652.     AppMove 
  653.     AppRestore 
  654.     AppSendMessage 
  655.     AppSize 
  656.  
  657.  
  658. ΓòÉΓòÉΓòÉ 14. AppGetAppNames ΓòÉΓòÉΓòÉ
  659.  
  660. This function retrieves the names of all of the currently running OS/2 
  661. applications and places them in an array. The array may be dimensioned using 
  662. the AppGetAppCount function. 
  663.  
  664.  
  665. Syntax 
  666. AppGetAppNames(&Array) 
  667. Array is the name of an array, dimensioned from the return value of the 
  668. AppGetAppCount function. Note the use of indirection (&). 
  669.  
  670. Return Value 
  671. The number of applications. 
  672.  
  673. Example 
  674. FUNCTION Example() 
  675. numapps = AppGetAppCount()     'return the number of apps 
  676. Message("Currently, there are {numapps} applications running, whether hidden or 
  677. visible.") 
  678. DIM names(numapps)          'dimension a name array 
  679. AppGetAppNames(&names)      'get the name for the apps 
  680. FOR I = 1 to numapps    'show the name for each app 
  681.     app = names(I) 
  682.     Message(app) 
  683. NEXT 
  684. END FUNCTION 
  685.  
  686. See also: 
  687.  
  688.     ActivateApp 
  689.     AppClose 
  690.     AppGetAppCount 
  691.     AppGetWindowPos 
  692.     AppHide 
  693.     AppIsRunning 
  694.     AppMaximize 
  695.     AppMinimize 
  696.     AppMove 
  697.     AppRestore 
  698.     AppSendMessage 
  699.     AppSize 
  700.  
  701.  
  702. ΓòÉΓòÉΓòÉ 15. AppGetWindowPos ΓòÉΓòÉΓòÉ
  703.  
  704. This function returns the location and size information about any OS/2 
  705. application. Note the use of indirection (&). The X, Y, Width, and Height 
  706. parameters are all passed by addressing. The return values are in percentages 
  707. of the screen size. 
  708.  
  709.  
  710. Syntax 
  711. AppGetWindowPos(App, &X, &Y, &Width, &Height) 
  712. App is the name of the application that you want to find. The name you use must 
  713. appear as it does in the OS/2 Window List or as it does in the application's 
  714. title bar. 
  715. X is the horizontal starting point of App. 
  716. Y is the vertical starting point of App. 
  717. Width is the width of App. 
  718. Height is the height of App. 
  719.  
  720. Return Value 
  721. 1  (TRUE) if the application was valid. 
  722. 0  (FALSE) if the application was not valid. 
  723.  
  724. Example 
  725. FUNCTION Example() 
  726. defstr x,y,x2,y2; 
  727. exec("E.EXE", "", 1) 
  728. AppgetWindowPos("E.EXE", &x, &y, &x2, &y2) 
  729. Message("About to move window") 
  730. AppMove("E.EXE", 10,20) 
  731. END FUNCTION 
  732.  
  733. See also: 
  734.  
  735.     ActivateApp 
  736.     AppClose 
  737.     AppGetAppCount 
  738.     AppGetAppNames 
  739.     AppHide 
  740.     AppIsRunning 
  741.     AppMaximize 
  742.     AppMinimize 
  743.     AppMove 
  744.     AppRestore 
  745.     AppSendMessage 
  746.     AppSize 
  747.  
  748.  
  749.  
  750. ΓòÉΓòÉΓòÉ 16. AppHide ΓòÉΓòÉΓòÉ
  751.  
  752. This function hides any OS/2 application. When an application is hidden it 
  753. cannot receive keyboard or mouse input; however, it responds to Dynamic Data 
  754. Exchange (DDE) commands. 
  755.  
  756.  
  757. Syntax 
  758. AppHide(App) 
  759. App is the name of the application that should be hidden. The name you use must 
  760. appear as it does in the OS/2 Window List or as it does in the application's 
  761. title bar. 
  762.  
  763. Return Value 
  764. 1  (TRUE) if the application was hidden. 
  765. 0  (FALSE) if the application could not be hidden. 
  766.  
  767. Example 
  768. FUNCTION Example() 
  769. if appisrunning("E.EXE") 
  770.     ActivateApp("E.EXE") 
  771. else 
  772.     Exec("E.EXE", "", 1) 
  773. endif 
  774. message("About to hide E.") 
  775. AppHide("E.EXE") 
  776. message("About to restore E.") 
  777. AppRestore("E.EXE") 
  778. END FUNCTION 
  779.  
  780. See also: 
  781.  
  782.     ActivateApp 
  783.     AppClose 
  784.     AppGetAppCount 
  785.     AppGetAppNames 
  786.     AppGetWindowPos 
  787.     AppIsRunning 
  788.     AppMaximize 
  789.     AppMinimize 
  790.     AppMove 
  791.     AppRestore 
  792.     AppSendMessage 
  793.     AppSize 
  794.  
  795.  
  796. ΓòÉΓòÉΓòÉ 17. AppIsRunning ΓòÉΓòÉΓòÉ
  797.  
  798. This function allows you to see if any OS/2 application is currently running. 
  799.  
  800.  
  801. Syntax 
  802. AppIsRunning(App) 
  803. App is the name of the application to be evaluated. The name you use must 
  804. appear as it does in the OS/2 Window List or as it does in the application's 
  805. title bar. 
  806.  
  807. Return Value 
  808. 1  (TRUE) if the application is running. 
  809. 0  (FALSE) if the application is not running. 
  810.  
  811. Example 
  812. FUNCTION Example() 
  813. if appisrunning("E.EXE") 
  814.     ActivateApp("E.EXE") 
  815. else 
  816.     Exec("E.EXE", "", 1) 
  817. endif 
  818. END FUNCTION 
  819.  
  820. See also: 
  821.  
  822.     ActivateApp 
  823.     AppClose 
  824.     AppGetAppCount 
  825.     AppGetAppNames 
  826.     AppGetWindowPos 
  827.     AppHide 
  828.     AppMaximize 
  829.     AppMinimize 
  830.     AppMove 
  831.     AppRestore 
  832.     AppSendMessage 
  833.     AppSize 
  834.  
  835.  
  836. ΓòÉΓòÉΓòÉ 18. ApplyFormat ΓòÉΓòÉΓòÉ
  837.  
  838. This function applies text formatting to selected text. The text formatting 
  839. must be loaded using the FastFormat function. 
  840.  
  841.  
  842. A macro must be edited to insert this non-recordable function. 
  843.  
  844. Syntax 
  845. ApplyFormat() 
  846.  
  847. Return Value 
  848. This function returns 1. 
  849.  
  850. Example 
  851. FUNCTION Example() 
  852. UserControl("Shade the area that contains the formatting you want:") 
  853. FastFormat()   ' Turn on Fast Formatting 
  854. FastFormat()   ' Turn off Fast Formatting 
  855. UserControl("Shade the area you want to apply formatting to:") 
  856. ApplyFormat() 
  857. END FUNCTION 
  858.  
  859. See also: 
  860.  
  861.     FastFormat 
  862.  
  863.  
  864. ΓòÉΓòÉΓòÉ 19. AppMaximize ΓòÉΓòÉΓòÉ
  865.  
  866. This function maximizes any OS/2 application. 
  867.  
  868.  
  869. Syntax 
  870. AppMaximize(App) 
  871. App is the name of the application that is to be maximized. The name you use 
  872. must appear as it does in the OS/2 Window List or as it does in the 
  873. application's title bar. 
  874.  
  875. Return Value 
  876. 1  (TRUE) if the application was maximized. 
  877. 0  (FALSE) if the application could not be maximized. 
  878.  
  879. Example 
  880. FUNCTION Example() 
  881. Exec("pmamifm.exe", "", 1) 
  882. AppMaximize("File Manager") 
  883. Message("File Manager is maximized.") 
  884. AppRestore("File Manager") 
  885. Message("File Manager is windowed.") 
  886. AppMinimize("File Manager") 
  887. Message("File Manager is an icon.") 
  888. ActivateApp("File Manager") 
  889. Message("Click OK to close File Manager.") 
  890. AppClose("File Manager") 
  891. END FUNCTION 
  892.  
  893. See also: 
  894.  
  895.     ActivateApp 
  896.     AppClose 
  897.     AppGetAppCount 
  898.     AppGetAppNames 
  899.     AppGetWindowPos 
  900.     AppHide 
  901.     AppIsRunning 
  902.     AppMinimize 
  903.     AppMove 
  904.     AppRestore 
  905.     AppSendMessage 
  906.     AppSize 
  907.  
  908.  
  909. ΓòÉΓòÉΓòÉ 20. AppMinimize ΓòÉΓòÉΓòÉ
  910.  
  911. This function minimizes any OS/2 application. 
  912.  
  913.  
  914. Syntax 
  915. AppMinimize(App) 
  916. App is the name of the application that is to be minimized. The name you use 
  917. must appear as it does in the OS/2 Window List or as it does in the 
  918. application's title bar. 
  919.  
  920. Return Value 
  921. 1  (TRUE) if the application was minimized. 
  922. 0  (FALSE) if the application could not be minimized. 
  923.  
  924. Example 
  925. FUNCTION Example() 
  926. Exec("PMAMIFM.EXE", "", 1) 
  927. AppMaximize("File Manager") 
  928. Message("File Manager is maximized.") 
  929. AppRestore("File Manager") 
  930. Message("File Manager is windowed.") 
  931. AppMinimize("File Manager") 
  932. Message("File Manager is an icon.") 
  933. ActivateApp("File Manager") 
  934. Message("Click OK to close File Manager.") 
  935. AppClose("File Manager") 
  936. END FUNCTION 
  937.  
  938. See also: 
  939.  
  940.     ActivateApp 
  941.     AppClose 
  942.     AppGetAppCount 
  943.     AppGetAppNames 
  944.     AppGetWindowPos 
  945.     AppHide 
  946.     AppIsRunning 
  947.     AppMaximize 
  948.     AppMove 
  949.     AppRestore 
  950.     AppSendMessage 
  951.     AppSize 
  952.  
  953.  
  954. ΓòÉΓòÉΓòÉ 21. AppMove ΓòÉΓòÉΓòÉ
  955.  
  956. This function moves a OS/2 application. It does not size the window, but moves 
  957. it to a new location on the screen. 
  958.  
  959.  
  960. Syntax 
  961. AppMove(App, X, Y) 
  962. App is the name of the application that is to be moved. The name you use must 
  963. appear as it does in the OS/2 Window List or as it does in the application's 
  964. title bar. To identify Ami Pro as the application to move, use the null string 
  965. (""). 
  966. X is the horizontal location on the screen, in percent. 
  967. Y is the vertical location on the screen, in percent. 
  968. (0,0) is the upper left position on the screen. 
  969.  
  970. Return Value 
  971. 1  (TRUE) if the application was moved. 
  972. 0  (FALSE) if the application could not be moved. 
  973.  
  974. Example 
  975. FUNCTION Example() 
  976. defstr x,y,x2,y2; 
  977. exec("E.EXE", "", 1) 
  978. AppgetWindowPos("E.EXE", &x, &y, &x2, &y2) 
  979. Message("About to move window") 
  980. AppMove("E.EXE", 10,20) 
  981. END FUNCTION 
  982.  
  983.  
  984. See also: 
  985.  
  986.     ActivateApp 
  987.     AppClose 
  988.     AppGetAppCount 
  989.     AppGetAppNames 
  990.     AppGetWindowPos 
  991.     AppHide 
  992.     AppIsRunning 
  993.     AppMaximize 
  994.     AppMinimize 
  995.     AppRestore 
  996.     AppSendMessage 
  997.     AppSize 
  998.  
  999.  
  1000.  
  1001. ΓòÉΓòÉΓòÉ 22. AppRestore ΓòÉΓòÉΓòÉ
  1002.  
  1003. This function restores any OS/2 application to its former non-maximized or 
  1004. non-minimized size. 
  1005.  
  1006.  
  1007. Syntax 
  1008. AppRestore(App) 
  1009. App is the name of the application that is to be restored. The name you use 
  1010. must appear as it does in the OS/2 Window List or as it does in the 
  1011. application's title bar. 
  1012.  
  1013. Return Value 
  1014. 1  (TRUE) if the application was restored. 
  1015. 0  (FALSE) if the application could not be restored. 
  1016.  
  1017. Example 
  1018. FUNCTION Example() 
  1019. if appisrunning("E.EXE") 
  1020.     ActivateApp("E.EXE") 
  1021. else 
  1022.     Exec("E.EXE", "", 1) 
  1023. endif 
  1024. message("About to hide E.") 
  1025. AppHide("E.EXE") 
  1026. message("About to restore E.") 
  1027. AppRestore("E.EXE") 
  1028. END FUNCTION 
  1029.  
  1030.  
  1031. See also: 
  1032.  
  1033.     ActivateApp 
  1034.     AppClose 
  1035.     AppGetAppCount 
  1036.     AppGetAppNames 
  1037.     AppGetWindowPos 
  1038.     AppHide 
  1039.     AppIsRunning 
  1040.     AppMaximize 
  1041.     AppMinimize 
  1042.     AppMove 
  1043.     AppSendMessage 
  1044.     AppSize 
  1045.  
  1046.  
  1047.  
  1048. ΓòÉΓòÉΓòÉ 23. AppSendMessage ΓòÉΓòÉΓòÉ
  1049.  
  1050. This function allows you to send any OS/2 message to any OS/2 application. You 
  1051. should be familiar with the Message, Wparam, and Lparam parameters. This 
  1052. function first locates the application's handle and then calls the SendMessage 
  1053. function from OS/2 with the specified parameters. 
  1054.  
  1055.  
  1056. Syntax 
  1057. AppSendMessage(App, Message, Wparam, Lparam) 
  1058. App is the name of the application to send the message to. It can also be a 
  1059. window handle. 
  1060. Message is the OS/2 message to send to the application. 
  1061. Wparam is the wparam parameter for the OS/2 message. 
  1062. Lparam is the lparam parameter for the OS/2 message. 
  1063.  
  1064. Return Value 
  1065. The return value from the OS/2 function SendMessage. 
  1066.  
  1067. Example 
  1068. DEFINE Em_SetPassWord   1052 
  1069. DEFINE Asterisk      42 
  1070.  
  1071. FUNCTION Example() 
  1072. ' get the name of this macro file 
  1073. Mac = GetRunningMacrofile$() 
  1074. ' this is called before the box is displayed 
  1075. SetDlgCallBack(0,"{Mac}!InitDlg") 
  1076. Box = DialogBox(".","Pass") 
  1077. pword = GetDialogField$(8000) 
  1078. Message("Password was {pword}") 
  1079. END FUNCTION 
  1080.  
  1081. FUNCTION InitDlg(Hdlg, id, value) 
  1082. ' Get the handle to the edit box 8000 
  1083. hEditBox = GetDlgItem(Hdlg, 8000) 
  1084. ' Password protect edit box 
  1085. AppSendMessage(hEditbox,Em_SetPassWord,Asterisk,0) 
  1086. END FUNCTION 
  1087.  
  1088. DIALOG Pass 
  1089. -2134376448 2 80 51 160 52 "" "" "Password Example" 
  1090. FONT 8 "Helv" 
  1091. 6 22 100 12 8000 1350631552 "edit" "" 0 
  1092. 116 4 40 14 1 1342242817 "button" "OK" 0 
  1093. END DIALOG 
  1094.  
  1095. See also: 
  1096.  
  1097.     ActivateApp 
  1098.     AppClose 
  1099.     AppGetAppCount 
  1100.     AppGetAppNames 
  1101.     AppGetWindowPos 
  1102.     AppHide 
  1103.     AppIsRunning 
  1104.     AppMaximize 
  1105.     AppMinimize 
  1106.     AppMove 
  1107.     AppRestore 
  1108.     AppSize 
  1109.     SetDlgCallback 
  1110.  
  1111.  
  1112. ΓòÉΓòÉΓòÉ 24. AppSize ΓòÉΓòÉΓòÉ
  1113.  
  1114. This function changes the size of any OS/2 application. 
  1115.  
  1116.  
  1117. Syntax 
  1118. AppSize(App, Width, Height) 
  1119. App is the name of the application that is to be sized. The name you use must 
  1120. appear as it does in the OS/2 Window List or as it does in the application's 
  1121. title bar. Using null ( "" ) will cause AppSize to affect the current Ami Pro 
  1122. window. 
  1123. Width is the new width, as a percentage of screen size, of the App. 
  1124. Height is the new height, as a percentage of screen size, of the App. 
  1125.  
  1126. Return Value 
  1127. 1  (TRUE) if the application was successfully sized. 
  1128. 0  (FALSE) if the application could not be sized. 
  1129.  
  1130. Example 
  1131. FUNCTION Example() 
  1132. defstr x,y,x2,y2; 
  1133. exec("E.EXE", "", 1) 
  1134. AppGetWindowPos("E.EXE", &x, &y, &x2, &y2) 
  1135. Message("About to size window") 
  1136. AppSize("E.EXE", 10,20) 
  1137. END FUNCTION 
  1138.  
  1139. See also: 
  1140.  
  1141.     ActivateApp 
  1142.     AppClose 
  1143.     AppGetAppCount 
  1144.     AppGetAppNames 
  1145.     AppGetWindowPos 
  1146.     AppHide 
  1147.     AppIsRunning 
  1148.     AppMaximize 
  1149.     AppMinimize 
  1150.     AppMove 
  1151.     AppRestore 
  1152.     AppSendMessage 
  1153.  
  1154.  
  1155.  
  1156. ΓòÉΓòÉΓòÉ 25. ArrayDelete ΓòÉΓòÉΓòÉ
  1157.  
  1158. This function deletes the specified record from an existing array. This 
  1159. function does not re-dimension the array. 
  1160.  
  1161.  
  1162. Syntax 
  1163. ArrayDelete(&Array, Index) 
  1164. Array is the name of the array from which to delete a record. Note the use of 
  1165. indirection (&). 
  1166. Index is the location in the array to delete. This parameter must be a valid 
  1167. array index. 
  1168.  
  1169. Return Value 
  1170. 1  (TRUE) if the record could be deleted. 
  1171. 0  (FALSE) if the record could not be deleted. 
  1172.  
  1173. Example 
  1174. FUNCTION Example() 
  1175. as = Query$("How many records do you want this array to hold?") 
  1176. DIM Names(as)     ' dimension the name array 
  1177. FOR I = 1 to as 
  1178.     ThisName = Query$("What is this person's Name?") 
  1179.     IF ThisName != ""'if not blank, insert the name 
  1180.        ArrayInsert(&Names, 1, ThisName) 
  1181.     ENDIF 
  1182. NEXT 
  1183. Size = ArraySize(&Names)    'return the number of names 
  1184. Message("Number of records is {Size}.") 
  1185. ArraySort(&Names)       'sort the names 
  1186. Again: 
  1187. ' Find the location of the name 
  1188. Ndex = ArraySearch(&Names, Query$("What name to find?")) 
  1189. IF Ndex != 0 
  1190.     IF Decide("Do you want to delete record {Ndex}?") 
  1191.        ' delete the record at that index 
  1192.        ArrayDelete(&Names, Ndex) 
  1193.        ' shrink the size of the array 
  1194.        Size = Size - 1 
  1195.     ENDIF 
  1196. ELSE 
  1197.     Message("Could not find record.") 
  1198.     GoTo again 
  1199. ENDIF 
  1200. FOR I = 1 to Size 
  1201.     ThisName = Names(I) 
  1202.     Message("Record Number {I} of {Size} is {ThisName}.") 
  1203. NEXT 
  1204. END FUNCTION 
  1205.  
  1206. See also: 
  1207.  
  1208.     ArrayInsertByKey 
  1209.     ArrayInsert 
  1210.     ArraySearch 
  1211.     ArraySize 
  1212.     ArraySort 
  1213.     Declaring Formal Variables Using the DIM Statement 
  1214.  
  1215.  
  1216. ΓòÉΓòÉΓòÉ 26. ArrayInsert ΓòÉΓòÉΓòÉ
  1217.  
  1218. This function inserts the specified record into the array at the specified 
  1219. index. It "moves" existing records to make room for the new record. If the 
  1220. array is full, the function expands the array. 
  1221.  
  1222.  
  1223. Syntax 
  1224. ArrayInsert(&Array, Index, Record) 
  1225. Array is the name of the array in which to insert the specified record. Note 
  1226. the use of indirection (&). 
  1227. Index is the position in the array to insert the specified record. Index must 
  1228. be a valid array index or one greater than the full array. If the array index 
  1229. is greater than the current size of the array by one, the record appends to the 
  1230. end of the array. 
  1231. Record is the data to insert into the array. 
  1232. The name of the array uses indirection (&). 
  1233.  
  1234. Return Value 
  1235. 1  (TRUE) if the record was inserted. 
  1236. 0  (FALSE) if the record could not be inserted. 
  1237.  
  1238. Example 
  1239. FUNCTION Example() 
  1240. as = Query$("How many records do you want this array to hold?") 
  1241. DIM Names(as)     ' dimension the name array 
  1242. FOR I = 1 to as 
  1243.     ThisName = Query$("What is this person's Name?") 
  1244.     IF ThisName != ""'if not blank, insert the name 
  1245.        ArrayInsert(&Names, 1, ThisName) 
  1246.     ENDIF 
  1247. NEXT 
  1248. Size = ArraySize(&Names)    'return the number of names 
  1249. Message("Number of records is {Size}.") 
  1250. ArraySort(&Names)       'sort the names 
  1251. Again: 
  1252. ' Find the location of the name 
  1253. Ndex = ArraySearch(&Names, Query$("What name to find?")) 
  1254. IF Ndex != 0 
  1255.     IF Decide("Do you want to delete record {Ndex}?") 
  1256.        ' delete the record at that index 
  1257.        ArrayDelete(&Names, Ndex) 
  1258.        ' shrink the size of the array 
  1259.        Size = Size - 1 
  1260.     ENDIF 
  1261. ELSE 
  1262.     Message("Could not find record.") 
  1263.     GoTo again 
  1264. ENDIF 
  1265. FOR I = 1 to Size 
  1266.     ThisName = Names(I) 
  1267.     Message("Record Number {I} of {Size} is {ThisName}.") 
  1268. NEXT 
  1269. END FUNCTION 
  1270.  
  1271. See also: 
  1272.  
  1273.     ArrayDelete 
  1274.     ArrayInsertByKey 
  1275.     ArraySearch 
  1276.     ArraySize 
  1277.     ArraySort 
  1278.     Declaring Formal Variables Using the DIM Statement 
  1279.  
  1280.  
  1281.  
  1282.  
  1283. ΓòÉΓòÉΓòÉ 27. ArrayInsertByKey ΓòÉΓòÉΓòÉ
  1284.  
  1285. This function inserts the record based on the assumption that the array is 
  1286. sorted. The array can be a single element array or field delimited records. If 
  1287. the array is full, the function expands the array. 
  1288.  
  1289.  
  1290. Syntax 
  1291. ArrayInsertByKey(&Array, Record, DuplicatesOk[, FieldNumber, Delimiter]) 
  1292. Array is the name of the array in which to insert the specified record. Note 
  1293. the use of indirection (&). 
  1294. Record is the data to insert into the array. 
  1295. DuplicatesOk determines if this record should be inserted if its key is already 
  1296. in the array. If the DuplicatesOk parameter is TRUE and this record has a 
  1297. duplicate key, the record is inserted after all other records with the same 
  1298. key. 
  1299. FieldNumber is the optional field number when using field delimited records. 
  1300. This defines the Key field. 
  1301. Delimiter is the optional delimiter in field delimited records. 
  1302.  
  1303. Return Value 
  1304. A positive number which is the index of the inserted record. 
  1305. 0  (FALSE) if the record was not inserted. 
  1306.  
  1307. Example 
  1308. FUNCTION Example() 
  1309. as = Query$("How many records do you want this array to hold?") 
  1310. DIM Names(as)     'dimension the name array 
  1311. FOR I = 1 to as 
  1312.     ThisName = Query$("What is this one's name?") 
  1313.     ArrayInsertByKey(&Names, ThisName, TRUE) 
  1314. NEXT 
  1315. Size = ArraySize(&Names) 
  1316. FOR I = 1 to Size 
  1317.     ThisName = Names(I) 
  1318.     Message("Record #{I} of {Size} is {ThisName}.") 
  1319. NEXT 
  1320. END FUNCTION 
  1321.  
  1322. See also: 
  1323.  
  1324.     ArrayDelete 
  1325.     ArrayInsert 
  1326.     ArraySearch 
  1327.     ArraySize 
  1328.     ArraySort 
  1329.     Declaring Formal Variables Using the DIM Statement 
  1330.  
  1331.  
  1332.  
  1333.  
  1334. ΓòÉΓòÉΓòÉ 28. ArraySearch ΓòÉΓòÉΓòÉ
  1335.  
  1336. This function searches the specified array looking for a key. If a FieldNumber 
  1337. and a  delimiter are specified, the function assumes the records are field 
  1338. delimited and matches only on the specified field. If duplicate matches occur, 
  1339. this function finds the first matching record. If an index is specified, the 
  1340. function begins searching at that position and returns the next matching index 
  1341. of the record. 
  1342.  
  1343.  
  1344. Syntax 
  1345. ArraySearch(&Array, Key[, FieldNumber, Delimiter][, Index]) 
  1346. Array is the name of the array to search. Note the use of indirection (&). 
  1347. Key is the data to search for. 
  1348. FieldNumber is the optional field number when using field delimited records. 
  1349. This defines the Key field. 
  1350. Delimiter is the optional delimiter in field delimited records. 
  1351. Index is the position in the array to begin the search. 
  1352.  
  1353. Return Value 
  1354. A positive number which is the index of the matching record. 
  1355. 0  (FALSE) if the record was not matched. 
  1356.  
  1357. Example 
  1358. FUNCTION Example() 
  1359. as = Query$("How many records do you want this array to hold?") 
  1360. DIM Names(as)     ' dimension the name array 
  1361. FOR I = 1 to as 
  1362.     ThisName = Query$("What is this person's Name?") 
  1363.     IF ThisName != ""'if not blank, insert the name 
  1364.        ArrayInsert(&Names, 1, ThisName) 
  1365.     ENDIF 
  1366. NEXT 
  1367. Size = ArraySize(&Names)    'return the number of names 
  1368. Message("Number of records is {Size}.") 
  1369. ArraySort(&Names)       'sort the names 
  1370. Again: 
  1371. ' Find the location of the name 
  1372. Ndex = ArraySearch(&Names, Query$("What name to find?")) 
  1373. IF Ndex != 0 
  1374.     IF Decide("Do you want to delete record {Ndex}?") 
  1375.        ' delete the record at that index 
  1376.        ArrayDelete(&Names, Ndex) 
  1377.        ' shrink the size of the array 
  1378.        Size = Size - 1 
  1379.     ENDIF 
  1380. ELSE 
  1381.     Message("Could not find record.") 
  1382.     GoTo again 
  1383. ENDIF 
  1384. FOR I = 1 to Size 
  1385.     ThisName = Names(I) 
  1386.     Message("Record Number {I} of {Size} is {ThisName}.") 
  1387. NEXT 
  1388. END FUNCTION 
  1389.  
  1390. See also: 
  1391.  
  1392.     ArrayDelete 
  1393.     ArrayInsertByKey 
  1394.     ArrayInsert 
  1395.     ArraySize 
  1396.     ArraySort 
  1397.     Declaring Formal Variables Using the DIM Statement 
  1398.  
  1399.  
  1400.  
  1401. ΓòÉΓòÉΓòÉ 29. ArraySize ΓòÉΓòÉΓòÉ
  1402.  
  1403. This function returns the number of elements in an existing array. 
  1404.  
  1405.  
  1406. Syntax 
  1407. ArraySize(&Array) 
  1408. Array is the name of the array to be examined. Note the use of indirection (&). 
  1409.  
  1410. Return Value 
  1411. The number of dimensioned elements in the array. 
  1412.  
  1413. Example 
  1414. FUNCTION Example() 
  1415. as = Query$("How many records do you want this array to hold?") 
  1416. DIM Names(as)     ' dimension the name array 
  1417. FOR I = 1 to as 
  1418.     ThisName = Query$("What is this person's Name?") 
  1419.     IF ThisName != ""'if not blank, insert the name 
  1420.        ArrayInsert(&Names, 1, ThisName) 
  1421.     ENDIF 
  1422. NEXT 
  1423. Size = ArraySize(&Names)    'return the number of names 
  1424. Message("Number of records is {Size}.") 
  1425. ArraySort(&Names)       'sort the names 
  1426. Again: 
  1427. ' Find the location of the name 
  1428. Ndex = ArraySearch(&Names, Query$("What name to find?")) 
  1429. IF Ndex != 0 
  1430.     IF Decide("Do you want to delete record {Ndex}?") 
  1431.        ' delete the record at that index 
  1432.        ArrayDelete(&Names, Ndex) 
  1433.        ' shrink the size of the array 
  1434.        Size = Size - 1 
  1435.     ENDIF 
  1436. ELSE 
  1437.     Message("Could not find record.") 
  1438.     GoTo again 
  1439. ENDIF 
  1440. FOR I = 1 to Size 
  1441.     ThisName = Names(I) 
  1442.     Message("Record Number {I} of {Size} is {ThisName}.") 
  1443. NEXT 
  1444. END FUNCTION 
  1445.  
  1446. See also: 
  1447.  
  1448.     ArrayDelete 
  1449.     ArrayInsertByKey 
  1450.     ArrayInsert 
  1451.     ArraySearch 
  1452.     ArraySort 
  1453.     Declaring Formal Variables Using the DIM Statement 
  1454.  
  1455.  
  1456.  
  1457.  
  1458. ΓòÉΓòÉΓòÉ 30. ArraySort ΓòÉΓòÉΓòÉ
  1459.  
  1460. This function sorts an existing array in ascending order. If a FieldNumber and 
  1461. D elimiter are specified, the function assumes the records are field delimited 
  1462. and the sort is performed on the specified field. If duplicate keys exist, 
  1463. their order is undefined. 
  1464.  
  1465.  
  1466. Numbers sort before alphabetical characters. 
  1467.  
  1468. Syntax 
  1469. ArraySort(&Array[, FieldNumber, Delimiter]) 
  1470. Array is the name of the array to be sorted. Note the use of indirection (&). 
  1471. FieldNumber is the optional field number when using field delimited records. 
  1472. This defines the Key field. 
  1473. Delimiter is the optional delimiter in field delimited records. 
  1474.  
  1475. Return Value 
  1476. 1  (TRUE) if the array was sorted. 
  1477. 0  (FALSE) if the array could not be sorted. 
  1478.  
  1479. Example 
  1480. FUNCTION Example() 
  1481. as = Query$("How many records do you want this array to hold?") 
  1482. DIM Names(as)     ' dimension the name array 
  1483. FOR I = 1 to as 
  1484.     ThisName = Query$("What is this person's Name?") 
  1485.     IF ThisName != ""'if not blank, insert the name 
  1486.        ArrayInsert(&Names, 1, ThisName) 
  1487.     ENDIF 
  1488. NEXT 
  1489. Size = ArraySize(&Names)    'return the number of names 
  1490. Message("Number of records is {Size}.") 
  1491. ArraySort(&Names)       'sort the names 
  1492. Again: 
  1493. ' Find the location of the name 
  1494. Ndex = ArraySearch(&Names, Query$("What name to find?")) 
  1495. IF Ndex != 0 
  1496.     IF Decide("Do you want to delete record {Ndex}?") 
  1497.        ' delete the record at that index 
  1498.        ArrayDelete(&Names, Ndex) 
  1499.        ' shrink the size of the array 
  1500.        Size = Size - 1 
  1501.     ENDIF 
  1502. ELSE 
  1503.     Message("Could not find record.") 
  1504.     GoTo again 
  1505. ENDIF 
  1506. FOR I = 1 to Size 
  1507.     ThisName = Names(I) 
  1508.     Message("Record Number {I} of {Size} is {ThisName}.") 
  1509. NEXT 
  1510. END FUNCTION 
  1511.  
  1512. See also: 
  1513.  
  1514.     ArrayDelete 
  1515.     ArrayInsertByKey 
  1516.     ArrayInsert 
  1517.     ArraySearch 
  1518.     ArraySize 
  1519.     Declaring Formal Variables Using the DIM Statement 
  1520.  
  1521.  
  1522.  
  1523.  
  1524. ΓòÉΓòÉΓòÉ 31. ASC ΓòÉΓòÉΓòÉ
  1525.  
  1526. This function determines the numeric code page value of the first letter in the 
  1527. text. If the text contains more than one letter, the remaining letters are 
  1528. ignored. 
  1529.  
  1530.  
  1531. Syntax 
  1532. ASC(Text) 
  1533. Text is a string of one or more letters. 
  1534.  
  1535. Return Value 
  1536. A number that is the code page value of the first letter in the text. 
  1537.  
  1538. Example 
  1539. FUNCTION Example() 
  1540. String = Query$("What character to return the Value of?") 
  1541. Number = ASC(String) 
  1542. Message("The code page equivalent of {String} is {Number}.") 
  1543. END FUNCTION 
  1544.  
  1545. See also: 
  1546.  
  1547.     CHR$ 
  1548.     Instr 
  1549.     LCASE$ 
  1550.     Left$ 
  1551.     LEN 
  1552.     MID$ 
  1553.     Right$ 
  1554.     strcat$ 
  1555.     strchr 
  1556.     strfield$ 
  1557.     UCASE$ 
  1558.  
  1559.  
  1560.  
  1561.  
  1562. ΓòÉΓòÉΓòÉ 32. ASCIIOptions ΓòÉΓòÉΓòÉ
  1563.  
  1564. This function sets the ASCII options for any opened file that uses the ASCII 
  1565. filter. This function is equivalent to choosing File Open, specifying ASCII as 
  1566. the file type, and choosing ASCII Options. 
  1567.  
  1568.  
  1569. Syntax 
  1570. ASCIIOptions(Options) 
  1571. Options is the options available to open an ASCII file. It is one or more of 
  1572. the following values: 
  1573.     CRLF (2) - Expect carriage return/line feed characters at end of lines; if 
  1574.     not set, expect CR/LFs at end of paragraphs 
  1575.     PCASCII (8) - 8 bit PC ASCII file 
  1576.     ANSI (16) - 8 bit ANSI file 
  1577.     KeepNames (32) - Keep style names 
  1578.  
  1579. Return Value 
  1580. This function returns 1. 
  1581.  
  1582. Example 
  1583. Function Example() 
  1584. AsciiOptions(PCASCII) 
  1585. FileOpen("c:\autoexec.bat", 16, "ASCII") 
  1586. end function 
  1587.  
  1588. See also: 
  1589.  
  1590.     FileOpen 
  1591.     ImportExport 
  1592.     SaveAs 
  1593.  
  1594.  
  1595.  
  1596. ΓòÉΓòÉΓòÉ 33. Assign ΓòÉΓòÉΓòÉ
  1597.  
  1598. This function assigns the result of an expression to a variable and returns the 
  1599. same result. The expression can be anything that you can pass to another 
  1600. function. This function is useful when using IF/THEN and WHILE/WEND statements. 
  1601.  
  1602.  
  1603. Syntax 
  1604. Assign(&Var, Express) 
  1605. Var is the name of the variable to assign the return value from Express to. 
  1606. Note the use of indirection (&). 
  1607. Express is the expression to evaluate. 
  1608.  
  1609. Return Value 
  1610. The return value of Express. 
  1611.  
  1612. Example 
  1613. FUNCTION Example() 
  1614. DEFSTR id, Line; 
  1615. 'if the open file can be assigned to id 
  1616. IF 0 != Assign(&id, fopen("c:\autoexec.bat", "r")) 
  1617.     New("_DEFAULT.STY", 0, 0)  'new file 
  1618.     WHILE -1 != Assign(&Line, fgets$(id)) 
  1619.        TYPE("{Line}[Enter]") 'type the autoexec lines 
  1620.     WEND 
  1621.     fclose(id) 
  1622. ELSE 
  1623.     Message("Could not open C:\AUTOEXEC.BAT") 
  1624. ENDIF 
  1625. END FUNCTION 
  1626.  
  1627. See also: 
  1628.  
  1629.     Declaring Formal Variables Using the DEFSTR Statement 
  1630.     fclose 
  1631.     fgets$ 
  1632.     fopen 
  1633.     Using the IF/THEN Statements 
  1634.     Using the WHILE Statement 
  1635.  
  1636.  
  1637.  
  1638.  
  1639. ΓòÉΓòÉΓòÉ 34. AssignMacroToFile ΓòÉΓòÉΓòÉ
  1640.  
  1641. This function assigns an open and close macro to the current file. This 
  1642. function is equivalent to choosing Tools Macro Edit and choosing Assign. 
  1643.  
  1644.  
  1645. Syntax 
  1646. AssignMacroToFile(OpenMacro, CloseMacro, Flag) 
  1647. OpenMacro is the macro name that is specified to run when the current file 
  1648. opens. Use the null string ("") to specify no opening macro. 
  1649. CloseMacro is the macro name that is specified to run when the current file 
  1650. closes. Use the null string ("") to specify no closing macro. 
  1651. Flag indicates whether to run the specified open or close macro. Add the values 
  1652. together to run both open and close macros. 
  1653.     2 - Run the opening macro 
  1654.     4 - Run the closing macro 
  1655.  
  1656. Return Value 
  1657. This function returns 0. 
  1658.  
  1659. Example 
  1660. FUNCTION Example() 
  1661. ' assign the openit macro to run when you open the doc 
  1662. ' assign the closeit macro to run when you close the doc 
  1663. AssignMacroToFile("Openit.smm", "Closeit.smm", 6) 
  1664. END FUNCTION 
  1665.  
  1666. See also: 
  1667.  
  1668.     MacroEdit 
  1669.     MacroOptions 
  1670.     MacroPlay 
  1671.  
  1672.  
  1673. ΓòÉΓòÉΓòÉ 35. AtEOF ΓòÉΓòÉΓòÉ
  1674.  
  1675. This function determines if the insertion point is at the end of the document. 
  1676.  
  1677.  
  1678. Syntax 
  1679. AtEOF() 
  1680.  
  1681. Return Value 
  1682. 1 (TRUE) if the insertion point is at the end of the document. 
  1683. 0 (FALSE) if the insertion point is not at the end of the document. 
  1684.  
  1685. Example 
  1686. FUNCTION Example() 
  1687. New("_default.sty", 0, 0) 
  1688. Type("This is the time for all good men to come to the aid of their country.") 
  1689. Sendkeys("[ctrlhome]")      'go to the beginning of the doc 
  1690. WHILE not AtEOF() 
  1691.     Sendkeys("[right]") 'move the cursor right one character 
  1692. WEND 
  1693. Message("The insertion point is now at the end of this file.") 
  1694. END FUNCTION 
  1695.  
  1696. See also: 
  1697.  
  1698.     CurChar$ 
  1699.     CurWord$ 
  1700.     EndOfFile 
  1701.     GetPageNo 
  1702.     TopOfFile 
  1703.     Type 
  1704.  
  1705.  
  1706.  
  1707. ΓòÉΓòÉΓòÉ 36. Beep ΓòÉΓòÉΓòÉ
  1708.  
  1709. This function tells OS/2 to sound (beep) the current audio device if the sound 
  1710. is turned on in the System Setup. 
  1711.  
  1712.  
  1713. Syntax 
  1714. Beep() 
  1715.  
  1716. Return Value 
  1717. This function does not return a value. 
  1718.  
  1719. Example 
  1720. FUNCTION Example() 
  1721. numbeeps = Query$("How many beeps do you want to hear?", 50) 
  1722. FOR I = 1 to numbeeps 
  1723.     Beep() 
  1724. NEXT 
  1725. END FUNCTION 
  1726.  
  1727. See also: 
  1728.  
  1729.     HourGlass 
  1730.     Message 
  1731.     StatusBarMsg 
  1732.  
  1733.  
  1734.  
  1735.  
  1736. ΓòÉΓòÉΓòÉ 37. BinToBrackets ΓòÉΓòÉΓòÉ
  1737.  
  1738. This function takes binary information and converts it to the Ami Pro brackets 
  1739. convention. This function is useful after using the fread function to see 
  1740. exactly what was read. 
  1741.  
  1742.  
  1743. Syntax 
  1744. BinToBrackets(Data) 
  1745. Data is the binary information you want to convert to brackets. 
  1746.  
  1747. Return Value 
  1748. The bracket convention to which the binary information equates. 
  1749.  
  1750. Example 
  1751. FUNCTION Example() 
  1752. DEFSTR string; 
  1753. id = fopen("test.txt", "w")    'open test.txt for write 
  1754. IF id != 0    ' get the name and address 
  1755.     Name = Query$("What is your name?") 
  1756.     fwrite(id, Name) 
  1757.     ' convert to binary 
  1758.     fwrite(id, BracketsToBin([Enter])) 
  1759.     fputs(id, Query$("What is your address?")) 
  1760.     fclose(id) 
  1761. ENDIF 
  1762. id2 = fopen("test.txt", "r")       'open test.txt for read 
  1763. IF id2 != 0 
  1764.     NameLength = len(Name)     'get the length of the name 
  1765.     fseek(id2, 0, 0) 
  1766.     Name = fread(id2, NameLength) 
  1767.     ' convert to brackets from binary 
  1768.     EnterKey = BinToBrackets(fread(id2, 2)) 
  1769.     AddressBegins = ftell(id2) 
  1770.     Address = fgets$(id2) 
  1771.     Message("Your name is {Name}.") 
  1772.     Message("Your address is {Address}.") 
  1773.     Message("EnterKey code is = {EnterKey}") 
  1774.     Message("Your address begins at the number {AddressBegins} byte in 
  1775.  TEST.TXT.") 
  1776.     fclose(id2) 
  1777. ENDIF 
  1778. END FUNCTION 
  1779.  
  1780. See also: 
  1781.  
  1782.     ASC 
  1783.     BracketsToBin 
  1784.     CHR$ 
  1785.     fclose 
  1786.     fgets$ 
  1787.     fopen 
  1788.     fputs 
  1789.     fread 
  1790.     fwrite 
  1791.  
  1792.  
  1793.  
  1794. ΓòÉΓòÉΓòÉ 38. Bold ΓòÉΓòÉΓòÉ
  1795.  
  1796. This function sets the bold attribute for selected text or all following text 
  1797. if no text is selected. It acts as a toggle, turning off the attribute if it is 
  1798. currently on and turning on the attribute if it is currently off. This function 
  1799. is equivalent to choosing Text Bold. This  function toggles the bold attribute 
  1800. on or off, depending on its current state. 
  1801.  
  1802.  
  1803. Syntax 
  1804. Bold() 
  1805.  
  1806. Return Value 
  1807. 0   if the bold attribute is toggled on and there are no attributes assigned to 
  1808. the text. 
  1809. 4   if the bold attribute is toggled off. 
  1810. 8   if the bold attribute is toggled on and the italic attribute is assigned. 
  1811. 16  if the bold attribute is toggled on and the underline attribute is already 
  1812. assigned. 
  1813. 32  if the bold attribute is toggled on and the word underline attribute is 
  1814. already assigned. 
  1815. -2  (GeneralFailure) if the text was not changed. 
  1816. The return values may be added together to identify the attributes that were 
  1817. previously assigned. 
  1818.  
  1819. Example 
  1820. FUNCTION Example() 
  1821. text = Query$("Enter some text:") 
  1822. New("_default.sty", 0, 0)      'open a new file 
  1823. TYPE("{text}") 
  1824. TYPE("[enter]") 
  1825. TYPE("[ctrlhome][ctrlshiftend]") 
  1826. Copy() 'copy text to clipboard 
  1827. FOR I = 1 to 10 
  1828.     Paste()   'paste text 10 times 
  1829. NEXT 
  1830. Message("The text will be shaded, bolded, italicized, underlined, and 
  1831. centered.") 
  1832. TYPE("[ctrlhome][ctrlshiftend]") 
  1833. Bold() 
  1834. Italic() 
  1835. Underline() 
  1836. Center() 
  1837. TYPE("[ctrlhome]") 
  1838. END FUNCTION 
  1839.  
  1840. See also: 
  1841.  
  1842.     Italic 
  1843.     NormalText 
  1844.     Underline 
  1845.     WordUnderline 
  1846.  
  1847.  
  1848.  
  1849.  
  1850. ΓòÉΓòÉΓòÉ 39. BracketsToBin ΓòÉΓòÉΓòÉ
  1851.  
  1852. This function converts Ami Pro bracketed values to their binary equivalents. It 
  1853. is useful when you are using the fwrite function. 
  1854.  
  1855.  
  1856. Syntax 
  1857. BracketsToBin(Data) 
  1858. Data is the bracketed information to convert to binary. 
  1859.  
  1860. Return Value 
  1861. The binary equivalent to the bracketed information. 
  1862.  
  1863. Example 
  1864. FUNCTION Example() 
  1865. DEFSTR string; 
  1866. id = fopen("test.txt", "w")    'open test.txt for write 
  1867. IF id != 0    ' get the name and address 
  1868.     Name = Query$("What is your name?") 
  1869.     fwrite(id, Name) 
  1870.     ' convert to binary 
  1871.     fwrite(id, BracketsToBin([Enter])) 
  1872.     fputs(id, Query$("What is your address?")) 
  1873.     fclose(id) 
  1874. ENDIF 
  1875. id2 = fopen("test.txt", "r")       'open test.txt for read 
  1876. IF id2 != 0 
  1877.     NameLength = len(Name)     'get the length of the name 
  1878.     fseek(id2, 0, 0) 
  1879.     Name = fread(id2, NameLength) 
  1880.     ' convert to brackets from binary 
  1881.     EnterKey = BinToBrackets(fread(id2, 2)) 
  1882.     AddressBegins = ftell(id2) 
  1883.     Address = fgets$(id2) 
  1884.     Message("Your name is {Name}.") 
  1885.     Message("Your address is {Address}.") 
  1886.     Message("EnterKey code is = {EnterKey}") 
  1887.     Message("Your address begins at the number {AddressBegins} byte in 
  1888.  TEST.TXT.") 
  1889.     fclose(id2) 
  1890. ENDIF 
  1891. END FUNCTION 
  1892.  
  1893. See also: 
  1894.  
  1895.     ASC 
  1896.     BinToBrackets 
  1897.     CHR$ 
  1898.     fclose 
  1899.     fgets$ 
  1900.     fopen 
  1901.     fputs 
  1902.     fread 
  1903.     fwrite 
  1904.  
  1905.  
  1906.  
  1907.  
  1908. ΓòÉΓòÉΓòÉ 40. BringFrameToFront ΓòÉΓòÉΓòÉ
  1909.  
  1910. This function brings the selected frame to the front of a stack of frames for 
  1911. editing. This function is equivalent to choosing Frame Bring to Front. 
  1912.  
  1913.  
  1914. Syntax 
  1915. BringFrameToFront() 
  1916.  
  1917. Return Value 
  1918. 1 (TRUE) if the frame was brought to the front. 
  1919. 0 (NoAction) if no action was taken because the frame was already brought to 
  1920. the front. 
  1921.  
  1922. Example 
  1923. FUNCTION Example() 
  1924. 'get the cursor position 
  1925. x = strfield$(CursorPosition$(), 1, ",") 
  1926. y = strfield$(CursorPosition$(), 2, ",") 
  1927. ' add the frames and bookmark them 
  1928. AddFrame(x, y, (x + 1440), (y - 1440)) 
  1929. MarkBookMark("Frame1", AddBookMark) 
  1930. AddFrame((x + 360), (y - 360), (x + 1800), (y - 1800)) 
  1931. MarkBookMark("Frame2", AddBookMark) 
  1932. SendFrameToBack()    ' send frame to back 
  1933. MarkBookMark("Frame1", FindBookMark) 
  1934. Message("The First frame is in front.") 
  1935. MarkBookMark("Frame2", FindBookMark) 
  1936. BringFrameToFront()  'bring frame to front 
  1937. Message("The Second frame is in front.") 
  1938. END FUNCTION 
  1939.  
  1940. See also: 
  1941.  
  1942.     AddFrame 
  1943.     AddFrameDLG 
  1944.     GoToCmd 
  1945.     SelectFrameByName 
  1946.     SendFrameToBack 
  1947.  
  1948.  
  1949. ΓòÉΓòÉΓòÉ 41. CascadeWindow ΓòÉΓòÉΓòÉ
  1950.  
  1951. This function cascades and overlaps multiple open windows with the currently 
  1952. active window on top. This function is equivalent to choosing Window Cascade. 
  1953.  
  1954.  
  1955. Syntax 
  1956. CascadeWindow() 
  1957.  
  1958. Return Value 
  1959. This function does not return a value. 
  1960.  
  1961. Example 
  1962. FUNCTION Example() 
  1963. Text = UCASE$(Left$(Query$("What action to take (Tile, Cascade, or New) on MDI 
  1964. Windows?"), 1)) 
  1965. SWITCH Text 
  1966. CASE "T" 
  1967. TileWindow() 
  1968. CASE "C" 
  1969. CascadeWindow() 
  1970. CASE "N" 
  1971. NewWindow() 
  1972. default 
  1973. Message("Only the proposed options are available.") 
  1974. ENDSWITCH 
  1975. END FUNCTION 
  1976.  
  1977. See also: 
  1978.  
  1979.     NewWindow 
  1980.     NextWindow 
  1981.     SelectWindow 
  1982.     TileWindow 
  1983.  
  1984.  
  1985. ΓòÉΓòÉΓòÉ 42. Center ΓòÉΓòÉΓòÉ
  1986.  
  1987. This function turns centering on or off. This function toggles the current 
  1988. state of the centering attribute. This function is equivalent to choosing Text 
  1989. Alignment Center. 
  1990.  
  1991.  
  1992. Syntax 
  1993. Center() 
  1994.  
  1995. Return Value 
  1996.  1 (TRUE) if the text was centered, or if centering was removed. 
  1997. -2 (GeneralFailure) if the alignment was not changed. 
  1998.  
  1999. Example 
  2000. FUNCTION Example() 
  2001. text = Query$("Enter some text:") 
  2002. New("_default.sty", 0, 0)      'open a new file 
  2003. TYPE("{text}") 
  2004. TYPE("[enter]") 
  2005. TYPE("[ctrlhome][ctrlshiftend]") 
  2006. Copy() 'copy text to clipboard 
  2007. FOR I = 1 to 10 
  2008.     Paste()   'paste text 10 times 
  2009. NEXT 
  2010. Message("The text will be shaded, bolded, italicized, underlined, and 
  2011. centered.") 
  2012. TYPE("[ctrlhome][ctrlshiftend]") 
  2013. Bold() 
  2014. Italic() 
  2015. Underline() 
  2016. Center() 
  2017. TYPE("[ctrlhome]") 
  2018. END FUNCTION 
  2019.  
  2020. See also: 
  2021.  
  2022.     Justify 
  2023.     LeftAlign 
  2024.     NormalText 
  2025.     RightAlign 
  2026.  
  2027.  
  2028.  
  2029.  
  2030. ΓòÉΓòÉΓòÉ 43. ChangeCascadeAction ΓòÉΓòÉΓòÉ
  2031.  
  2032. This function changes the action of the selected cascade menu item. 
  2033.  
  2034.  
  2035. Syntax 
  2036. ChangeCascadeAction(BarID, Menu, CascadeMenu, Item, NewAction, Help) 
  2037. BarID is the identification number of the menu bar and must always be 1. 
  2038. Menu is the name of the pull down menu this cascade menu rests on. This must 
  2039. match exactly the name of the pull down menu you are referencing, including any 
  2040. ampersand (&) characters in the name of the menu. An ampersand is placed before 
  2041. a character that has an underline. 
  2042. CascadeMenu is the name of the Cascade menu that the item to change is on. This 
  2043. must match exactly the name of the cascade menu that the item to change is on, 
  2044. including any ampersands (&). 
  2045. Item is the name of the cascade menu item to be changed. If the menu item has a 
  2046. shortcut key, you must press TAB, type a ^, and then type the appropriate 
  2047. letter as part of the item name. 
  2048. NewAction can either be an Ami Pro function or a macro. 
  2049. Help is the one-line Help text that appears in the title bar of Ami Pro when 
  2050. this menu item is highlighted. This parameter is not optional for this 
  2051. function. 
  2052.  
  2053. Return Value 
  2054. 1  (TRUE) if the item's action was changed. 
  2055. 0  (FALSE) if the change could not be made. 
  2056.  
  2057. Example 
  2058. FUNCTION Example() 
  2059. MacFile = GetRunningMacroFile$() 'get the name of this macro 
  2060. 'change the Edit/Insert/Note text to say Hello World 
  2061. ChangeCascadeAction(1, "&Edit", "&Insert", "&Note", "{MacFile}!Test()", "") 
  2062. END FUNCTION 
  2063.  
  2064. FUNCTION Test() 
  2065. Message("Hello World...") 
  2066. END FUNCTION 
  2067.  
  2068. See also: 
  2069.  
  2070.     AddCascadeMenu 
  2071.     AddCascadeMenuItem 
  2072.     AddMenu 
  2073.     AddMenuItem 
  2074.     ChangeMenuAction 
  2075.     CheckMenuItem 
  2076.     GrayMenuItem 
  2077.     InsertCascadeMenuItem 
  2078.     InsertCascadeMenu 
  2079.     InsertMenuItem 
  2080.     InsertMenu 
  2081.     RenameMenuItem 
  2082.  
  2083.  
  2084. ΓòÉΓòÉΓòÉ 44. ChangeIcons ΓòÉΓòÉΓòÉ
  2085.  
  2086. This function changes the current icon set to the icon set specified in the 
  2087. Name parameter. This function is equivalent to choosing Tools SmartIcons or the 
  2088. SmartIcons button on the status bar and specifying the desired icon set. 
  2089.  
  2090.  
  2091. A macro must be edited to insert this non-recordable function. 
  2092.  
  2093. Syntax 
  2094. ChangeIcons(Name) 
  2095. Name is the name of the icon set. This is the full icon set name, not the file 
  2096. name. 
  2097. A null string ("") changes the current set to the default icon set. 
  2098.  
  2099. Return Value 
  2100. This function returns a 1. 
  2101.  
  2102. Example 
  2103. FUNCTION Example() 
  2104. ChangeIcons("Working Together") 
  2105. END FUNCTION 
  2106.  
  2107. See also: 
  2108.  
  2109.     GetIconPalette 
  2110.     IconBottom 
  2111.     IconCustomize 
  2112.     IconFloating 
  2113.     IconLeft 
  2114.     IconRight 
  2115.     IconTop 
  2116.     SetIconSize 
  2117.  
  2118.  
  2119. ΓòÉΓòÉΓòÉ 45. ChangeLanguage ΓòÉΓòÉΓòÉ
  2120.  
  2121. This function changes the default language path and sets the language used for 
  2122. the current document and new documents. This function is equivalent to choosing 
  2123. Tools Spell Check and choosing Language Options. 
  2124.  
  2125.  
  2126. Syntax 
  2127. ChangeLanguage(Path, NewLang, CurrentLang) 
  2128. Path is the full path where the dictionary file is located. 
  2129. NewLang is the number of the language dictionary to use. 
  2130. CurrentLang is the number of the language dictionary for this document. 
  2131. Language numbers are: 
  2132.     1- American English 
  2133.     2 - British English 
  2134.     3 - French 
  2135.     4 - French Canadian 
  2136.     5 - Italian 
  2137.     6 - Spanish 
  2138.     7 - German 
  2139.     8 - Dutch 
  2140.     9 - Norwegian 
  2141.     10 - Swedish 
  2142.     11 - Danish 
  2143.     12 - Portuguese 
  2144.     13 - Finnish 
  2145.     14 - Medical 
  2146.     15 - Swiss German 
  2147.     16 - Greek 
  2148.     17 - Brazilian 
  2149.     18 - Australian 
  2150.     19 - Polish 
  2151.     20 - Russian 
  2152.     21 - Catalan 
  2153.     22 - Nynorsk 
  2154.     23 - Voorkeur 
  2155.  
  2156. Return Value 
  2157. 1  (TRUE) if the language was changed. 
  2158. 0  (UserCancel/FALSE) if the language dictionary could not be changed or if the 
  2159. user canceled the function. 
  2160.  
  2161. Example 
  2162. FUNCTION Example() 
  2163. ' get the path for the dictionary from the amiuser3.ini 
  2164. path = GetProfileString$("AmiPro", "dictionary", "amiuser3.ini") 
  2165. newlang = 7       'German 
  2166. currlang = 1  'American English 
  2167. ChangeLanguage(path, newlang, currlang) 
  2168. END FUNCTION 
  2169.  
  2170. See also: 
  2171.  
  2172.     SpellCheck 
  2173.     Thesaurus 
  2174.  
  2175.  
  2176. ΓòÉΓòÉΓòÉ 46. ChangeMenuAction ΓòÉΓòÉΓòÉ
  2177.  
  2178. This function changes the function of a menu item on a pull down menu. 
  2179.  
  2180.  
  2181. Syntax 
  2182. ChangeMenuAction(BarID, Menu, Item, MacroName[!Function[(parm1[, parm2...])]][, 
  2183. Help]) 
  2184. BarID is the identification number of the menu bar and must always be 1. 
  2185. Menu is the name of the pull down menu on which the item is located. This name 
  2186. must match the name of the pull down menu, including any ampersand (&) 
  2187. characters. An ampersand is placed before a character that has an underline. 
  2188. Item is the name of the existing menu item to change. This name must match the 
  2189. name of the existing menu item, including any ampersand (&) characters. An 
  2190. ampersand is placed before a character that has an underline. 
  2191. MacroName is the name of the Ami Pro function or macro to run if this menu item 
  2192. is selected. This parameter may contain the macro file name, the function 
  2193. within that file to call, and any parameters that function may require. At a 
  2194. minimum, this parameter must contain the macro file name. 
  2195. Help is the one-line Help text that appears in the title bar of Ami Pro when 
  2196. this menu item is highlighted. If an Ami Pro function is used, its one-line 
  2197. Help appears. 
  2198.  
  2199. Return Value 
  2200. A positive number if the menu item was changed. 
  2201. 0  (FALSE) if the menu item could not be changed, or if an invalid BarID or 
  2202. MenuName was used. 
  2203.  
  2204. Example 
  2205. FUNCTION Example() 
  2206. RMac = GetRunningMacroFile$() ' get the name of the running macro 
  2207. ChangeMenuAction(1, "Too&ls", "Smart&Icons...", IconLeft, "Places the SmartIcon 
  2208. bar on the left") ' make the menu toggle the icon bar 
  2209. OnCancel RestoreIt ' set a goto address in case the user cancels 
  2210. UserControl("Try out the SmartIcon menu item then select Resume") ' try it out 
  2211. RestoreIt: 
  2212. ' change the menu 
  2213. ChangeMenuAction(1, "Too&ls", "Smart&Icons...", IconCustomize, "Customize 
  2214. SmartIcons by specifying the desired position, size and set of icons") 
  2215. END FUNCTION 
  2216.  
  2217. See also: 
  2218.  
  2219.     AddCascadeMenu 
  2220.     AddCascadeMenuItem 
  2221.     AddMenu 
  2222.     AddMenuItem 
  2223.     ChangeCascadeAction 
  2224.     ChangeMenuAction 
  2225.     CheckMenuItem 
  2226.     DeleteMenu 
  2227.     DeleteMenuItem 
  2228.     GetMacPath$ 
  2229.     GrayMenuItem 
  2230.     InsertCascadeMenuItem 
  2231.     InsertCascadeMenu 
  2232.     InsertMenuItem 
  2233.     InsertMenu 
  2234.     RenameMenuItem 
  2235.  
  2236.  
  2237.  
  2238. ΓòÉΓòÉΓòÉ 47. ChangeShortcutKey ΓòÉΓòÉΓòÉ
  2239.  
  2240. This function assigns a shortcut key combination to run a macro. It overrides 
  2241. an existing macro key definition. It does not check to make sure that the 
  2242. MacroName exists. If an invalid MacroName is used, the keystroke does nothing 
  2243. when pressed. 
  2244.  
  2245.  
  2246. Syntax 
  2247. ChangeShortcutKey(MacroName, Key, State) 
  2248. MacroName is the name of the macro, including the file name that should be 
  2249. assigned to a keystroke. 
  2250. Key is the alphanumeric function key used as the shortcut key combination. 
  2251. State is the shift state of the key. It can be "C" (Control key), "S" (Shift 
  2252. key), "A" (Alternate key), or a combination of the three. 
  2253. You can use either CTRL or SHIFT, or a combination of the two, with most keys. 
  2254. When assigning a shortcut, you must spell out the shortcut command keys. For 
  2255. example, to assign SHIFT+F2, you must type the actual alphanumeric characters 
  2256. with no spaces. You cannot use F10, SHIFT+F1, or SHIFT+ an alphanumeric key. 
  2257.  
  2258. Return Value 
  2259. 1  (TRUE) if the macro was successfully assigned to the function key. 
  2260. -2  (GeneralFailure) if the key could not be assigned because an invalid 
  2261. keyname was used. 
  2262.  
  2263. Example 
  2264. FUNCTION Example() 
  2265. FileName = Query$("What macro do you want to change the shortcut key for?") 
  2266. Key = Query$("What number function key do you want to assign?") 
  2267. IF not IsNumeric(Key) 
  2268.     Message("Not a valid function key; try again.") 
  2269. ENDIF 
  2270. IF Decide("Use Shift with F{key}?") 
  2271.     State = "S" 
  2272. ELSE 
  2273.     State = "" 
  2274. ENDIF 
  2275. IF Decide("Use Ctrl with F{key}?") 
  2276.     State = strcat$(State, "C") 
  2277. ENDIF 
  2278. IF Decide("Use Alt with F{key}?") 
  2279.     State = strcat$(State, "A") 
  2280. ENDIF 
  2281. RealKey=strcat$("F", Key) 
  2282. IF -2 = ChangeShortcutKey(Filename, RealKey, State) 
  2283.     Message("Could not change shortcut key for {Filename} to {State}F{Key}") 
  2284. ENDIF 
  2285. END FUNCTION 
  2286.  
  2287. See also: 
  2288.  
  2289.     AddCascadeMenu 
  2290.     AddCascadeMenuItem 
  2291.     AddMenu 
  2292.     AddMenuItem 
  2293.     ChangeMenuAction 
  2294.     InsertCascadeMenuItem 
  2295.     InsertCascadeMenu 
  2296.     InsertMenuItem 
  2297.     InsertMenu 
  2298.     OnKey 
  2299.  
  2300.  
  2301.  
  2302. ΓòÉΓòÉΓòÉ 48. CharLeft ΓòÉΓòÉΓòÉ
  2303.  
  2304. This function scrolls the document left one character without moving the 
  2305. insertion point. This function is equivalent to clicking once on the right 
  2306. arrow at the right of the horizontal scroll bar. 
  2307.  
  2308.  
  2309. Syntax 
  2310. CharLeft() 
  2311.  
  2312. Return Value 
  2313. This function returns 0. 
  2314.  
  2315. Example 
  2316. FUNCTION Example() 
  2317. Again: 
  2318. UserControl("Click Resume to shift to the left, or Cancel to Quit.") 
  2319. CharLeft() 
  2320. GoTo Again 
  2321. END FUNCTION 
  2322.  
  2323. See also: 
  2324.  
  2325.     CharRight 
  2326.     EndOfFile 
  2327.     LeftEdge 
  2328.     LineDown 
  2329.     LineUp 
  2330.     RightEdge 
  2331.     ScreenDown 
  2332.     ScreenLeft 
  2333.     ScreenRight 
  2334.     ScreenUp 
  2335.     TopOfFile 
  2336.  
  2337.  
  2338. ΓòÉΓòÉΓòÉ 49. CharRight ΓòÉΓòÉΓòÉ
  2339.  
  2340. This function scrolls the document right one character without moving the 
  2341. insertion point. This function is equivalent to clicking once on the left arrow 
  2342. at the left of the horizontal scroll bar. 
  2343.  
  2344.  
  2345. Syntax 
  2346. CharRight() 
  2347.  
  2348. Return Value 
  2349. This function returns 0. 
  2350.  
  2351. Example 
  2352. FUNCTION Example() 
  2353. Again: 
  2354. UserControl("Click Resume to shift to the right, or Cancel to Quit.") 
  2355. CharRight() 
  2356. GoTo Again 
  2357. END FUNCTION 
  2358.  
  2359. See also: 
  2360.  
  2361.     CharLeft 
  2362.     EndOfFile 
  2363.     LeftEdge 
  2364.     LineDown 
  2365.     LineUp 
  2366.     RightEdge 
  2367.     ScreenDown 
  2368.     ScreenLeft 
  2369.     ScreenRight 
  2370.     ScreenUp 
  2371.     TopOfFile 
  2372.  
  2373.  
  2374. ΓòÉΓòÉΓòÉ 50. CheckMenuItem ΓòÉΓòÉΓòÉ
  2375.  
  2376. This function adds or removes a check mark next to a menu item. Use this 
  2377. function to indicate that the menu function is currently active. 
  2378.  
  2379.  
  2380. You can only place indicators next to menu items you create. 
  2381.  
  2382. Syntax 
  2383. CheckMenuItem(BarID, Menu[, CascadeMenu], Item, State) 
  2384. BarID is the identification number of the menu bar and must always be 1. 
  2385. Menu is the name of the pull down menu that the item to be checked or unchecked 
  2386. rests on. This must match exactly the name of the pull down menu you want to 
  2387. modify, including any ampersand (&) characters. An ampersand is placed before a 
  2388. character that has an underline. 
  2389. CascadeMenu is the optional name of the cascade menu that the item to be 
  2390. checked or unchecked rests on. This must match exactly the name of the cascade 
  2391. menu you want to modify, including any ampersand (&) characters. 
  2392. Item is the name of the menu item you want to check or uncheck. If the menu 
  2393. item has a shortcut key, you must press TAB, type a ^, and then type the 
  2394. appropriate letter as part of the item name. 
  2395. State indicates whether the item is checked or unchecked. State can be either a 
  2396. 1 (On) or a 0 (Off). 
  2397.  
  2398. Return Value 
  2399. 1  (TRUE) if the item was successfully checked or unchecked. 
  2400. 0  (FALSE) if the item could not be checked or unchecked, or if an invalid 
  2401. BarID, MenuName, or ItemName was used. 
  2402.  
  2403. Example 
  2404. FUNCTION Example() 
  2405. MacFile = GetRunningMacroFile$()   'get the name of this macro 
  2406. State = 0 
  2407. DeleteMenuItem(1, "&Text", "B&old+Italic+Underline") 
  2408. InsertMenuItem(1, "&Text", 10, "B&old+Italic+Underline", "{MacFile}!Example2( 
  2409. {State})", "Bold and Italicize and Underline Text.") 
  2410. END FUNCTION 
  2411.  
  2412. FUNCTION Example2(State) 
  2413. MacFile = GetRunningMacroFile$() 
  2414. ' This is the most important line in the macro 
  2415. ' it handles the toggle feature passed as the parameter State 
  2416. ' by making zero into one, one into zero. 
  2417. State = Right$((State - 1), 1) 
  2418. Bold(State) 
  2419. Underline(State) 
  2420. Italic(State) 
  2421. ChangeMenuAction(1, "&Text", "B&old+Italic+Underline", "{MacFile}!Example2( 
  2422. {State})", "Bold and Italicize and Underline Text.") 
  2423. CheckMenuItem(1, "&Text", "B&old+Italic+Underline", State) 
  2424. END FUNCTION 
  2425.  
  2426. See also: 
  2427.  
  2428.     AddCascadeMenu 
  2429.     AddCascadeMenuItem 
  2430.     AddMenu 
  2431.     AddMenuItem 
  2432.     ChangeCascadeAction 
  2433.     ChangeMenuAction 
  2434.     ChangeMenuItem 
  2435.     DeleteMenu 
  2436.     DeleteMenuItem 
  2437.     GrayMenuItem 
  2438.     InsertCascadeMenuItem 
  2439.     InsertCascadeMenu 
  2440.     InsertMenuItem 
  2441.     InsertMenu 
  2442.     RenameMenuItem 
  2443.  
  2444.  
  2445.  
  2446. ΓòÉΓòÉΓòÉ 51. CHR ΓòÉΓòÉΓòÉ
  2447.  
  2448. This function determines the code page character of the number provided. 
  2449.  
  2450.  
  2451. Syntax 
  2452. CHR$(Value) 
  2453. Value is a number between 0 and 255. 
  2454.  
  2455. Return Value 
  2456. A single character string that is the code page character derived from the 
  2457. function's argument. 
  2458.  
  2459. Example 
  2460. FUNCTION Example() 
  2461. TYPE("NumberCharacter[Enter]") 
  2462. FOR I = 1 to 255 
  2463.     Char = CHR$(I) 
  2464.     TYPE("{I}={Char}[Enter]") 
  2465. NEXT 
  2466. END FUNCTION 
  2467.  
  2468. See also: 
  2469.  
  2470.     ASC 
  2471.     Instr 
  2472.     LCASE$ 
  2473.     Left$ 
  2474.     MID$ 
  2475.     Right$ 
  2476.     strcat$ 
  2477.     strchr 
  2478.     strfield$ 
  2479.     UCASE$ 
  2480.  
  2481.  
  2482.  
  2483. ΓòÉΓòÉΓòÉ 52. CleanScreenOptions ΓòÉΓòÉΓòÉ
  2484.  
  2485. This function determines which elements display in Clean Screen mode. This 
  2486. function is equivalent to choosing View View Preferences and choosing Clean 
  2487. Screen. 
  2488.  
  2489.  
  2490. Syntax 
  2491. CleanScreenOptions(Options) 
  2492. Options is a flag that determines the screen elements to display. The Options 
  2493. parameter can be one of the following: 
  2494.     None (0) - None of the elements display. 
  2495.     TitleBar (1) - Display the title bar. This value must be combined with 
  2496.     MenuBar (2). 
  2497.     MenuBar (2) - Display the menu bar. 
  2498.     Icons (4) - Display the SmartIcons. 
  2499.     StatusBar (8) - Display the status bar. 
  2500.     VertScroll (16) - Display the vertical scroll bar. 
  2501.     HorzScroll (32) - Display the horizontal scroll bar. 
  2502.     ReturnIcon (64) - Display the icon to exit Clean Screen mode. 
  2503. You can add the values together to get the Options parameter. 
  2504.  
  2505. Return Value 
  2506. This function returns 1. 
  2507.  
  2508. Example 
  2509. FUNCTION Example() 
  2510. CleanScreenOptions(112)  ' Display the scroll bars and return icon 
  2511. ToggleCleanScreen() 
  2512. END FUNCTION 
  2513.  
  2514. See also: 
  2515.  
  2516.     ToggleCleanScreen 
  2517.     ViewPreferences 
  2518.  
  2519.  
  2520. ΓòÉΓòÉΓòÉ 53. ConnectCells ΓòÉΓòÉΓòÉ
  2521.  
  2522. This function connects or disconnects the selected table cells. This function 
  2523. is equivalent to choosing Table Connect Cells. The ConnectCells function is a 
  2524. toggle. If the selected cells are not connected, they become connected. If the 
  2525. selected cells are already connected, they become disconnected. 
  2526.  
  2527.  
  2528. Syntax 
  2529. ConnectCells() 
  2530.  
  2531. Return Value 
  2532. 1  (TRUE) if the cells were successfully connected or disconnected. 
  2533. -2  (GeneralFailure) if the cells could not be connected or disconnected. 
  2534. -7  (CouldNotFind) if the cells to connect or disconnect could not be located. 
  2535.  
  2536. Example 
  2537. FUNCTION Example() 
  2538. DEFSTR StartRow, StartCol, EndRow, EndCol; 
  2539. Tables(1, TRUE, 4, 10) 
  2540. WHILE StartRow != 2 
  2541.     TYPE("[Right]") 
  2542.     TableGetRange(&StartRow, &StartCol, &EndRow, &EndCol) 
  2543. WEND 
  2544. TYPE("[ShiftRight][ShiftRight]") 
  2545. ConnectCells() 
  2546. TableLines(AllSides, 0, 0, OnePoint, 0) 
  2547. END FUNCTION 
  2548.  
  2549. See also: 
  2550.  
  2551.     ProtectCells 
  2552.     SizeColumnRow 
  2553.     TableLayout 
  2554.     TableLines 
  2555.     Tables 
  2556.  
  2557.  
  2558.  
  2559. ΓòÉΓòÉΓòÉ 54. Copy ΓòÉΓòÉΓòÉ
  2560.  
  2561. This function copies the selected text, selected frame, or table to the 
  2562. clipboard. This function is equivalent to choosing Edit Copy. 
  2563.  
  2564.  
  2565. Syntax 
  2566. Copy() 
  2567.  
  2568. Return Value 
  2569.  1  (TRUE) if the text was copied to the clipboard. 
  2570. -2  (GeneralFailure) if the text could not be copied or if there was no text to 
  2571. copy. 
  2572.  
  2573. Example 
  2574. FUNCTION Example() 
  2575. TYPE("Hello World") 
  2576. TYPE("[CtrlHome][CtrlShiftEND]") 
  2577. Copy() 
  2578. Paste() 
  2579. Paste() 
  2580. END FUNCTION 
  2581.  
  2582. See also: 
  2583.  
  2584.     CurChar$ 
  2585.     CurShade$ 
  2586.     CurWord$ 
  2587.     Cut 
  2588.     DDELinks 
  2589.     Paste 
  2590.  
  2591.  
  2592.  
  2593. ΓòÉΓòÉΓòÉ 55. CreateDataFile ΓòÉΓòÉΓòÉ
  2594.  
  2595. This function creates a new data file. It does not run the automated data file 
  2596. record entry function. 
  2597.  
  2598.  
  2599. Syntax 
  2600. CreateDataFile() 
  2601.  
  2602. Return Value 
  2603. This function returns 1. 
  2604.  
  2605. Example 
  2606. FUNCTION Example() 
  2607. CreateDataFile() 
  2608. END FUNCTION 
  2609.  
  2610. See also: 
  2611.  
  2612.     CreateDescriptionFile 
  2613.     Merge 
  2614.     MergeToFile 
  2615.     OpenDataFile 
  2616.     OpenMergeFile 
  2617.  
  2618.  
  2619.  
  2620. ΓòÉΓòÉΓòÉ 56. CreateDescriptionFile ΓòÉΓòÉΓòÉ
  2621.  
  2622. This function creates an Ami Pro merge description file. A description file 
  2623. contains a list of the fields in an external data file. This function is 
  2624. equivalent to entering the field names in the Merge Data File Fields dialog 
  2625. box. 
  2626.  
  2627.  
  2628. Syntax 
  2629. CreateDescriptionFile(FileName, Type[, Fields...]) 
  2630. FileName is the name of the description file, in Ami Pro format, to be created. 
  2631. Type is the format of the data file and is one of the following: 
  2632.     Ami Pro 
  2633.     1-2-3 
  2634.     1-2-3 rel 3 
  2635.     Comma delimited 
  2636.     dBase 
  2637.     DIF 
  2638.     Excel 
  2639.     Excel 3.0 
  2640.     Excel 4.0 
  2641.     Fixed length ASCII 
  2642. Fields are the names of the fields to insert into the description file. You can 
  2643. insert a maximum of 15 fields. 
  2644.  
  2645. Return Value 
  2646. This function returns 1. 
  2647.  
  2648. Example 
  2649. FUNCTION Example() 
  2650. ' this a description file with the name 123desc.sam with the following lines 
  2651. CreateDescriptionFile("123desc.sam", "1-2-3 rel 3", "Name", "Address", "City", 
  2652. "State", "Zip") 
  2653. END FUNCTION 
  2654.  
  2655. See also: 
  2656.  
  2657.     CreateDataFile 
  2658.     MergeToFile 
  2659.     OpenDataFile 
  2660.     OpenMergeFile 
  2661.  
  2662.  
  2663. ΓòÉΓòÉΓòÉ 57. CreateStyle ΓòÉΓòÉΓòÉ
  2664.  
  2665. This function creates a new paragraph style. This function is equivalent to 
  2666. choosing Style Create Style. 
  2667.  
  2668.  
  2669. The paragraph style name cannot exceed thirteen characters. 
  2670.  
  2671. Syntax 
  2672. CreateStyle(NewName, BaseName, Options) 
  2673. NewName is the name of the new paragraph style. 
  2674. BaseName is the name of the existing paragraph style on which to base the new 
  2675. paragraph style. 
  2676. Options is a flag which determines whether to create or modify a style. It also 
  2677. determines whether to create or modify a style based on the style at the 
  2678. insertion point position or in the BaseName parameter. 
  2679.     CreateSty (0) - Create style 
  2680.     ModSty (1) - Modify style 
  2681.     SelectSty (2) - Create or modify style based on the style at the insertion 
  2682.     point position. If this parameter is used, the BaseName parameter is 
  2683.     ignored. You must still enter an empty string ("") for the BaseName. 
  2684. The Options parameter must use either CreateSty or ModSty. SelectSty may be 
  2685. added to one of the other parameters. 
  2686.  
  2687. To display the Create Styles dialog box and allow the user to select the new 
  2688. paragraph style name and the paragraph style it is based on: CreateStyle 
  2689.  
  2690. Return Value 
  2691. 1  (TRUE) if the new paragraph style was created. 
  2692. 0  (UserCancel) if the user canceled the function. 
  2693. -2  (GeneralFailure) if the paragraph style could not be created. 
  2694. -6  (NoMemory) if the function failed because of insufficient memory. 
  2695.  
  2696. Example 
  2697. FUNCTION Example() 
  2698. NewName = Query$("What do you want to name the new style?", "TestStyle") 
  2699. BaseName = GetStyleName$() 
  2700. CreateStyle(NewName, BaseName, 0) 
  2701. ModifySelect(NewName) 
  2702. ModifyAlignment(AlignLeft, 0, 0, 0, 0, 0) 
  2703. ModifyBreaks(4, 0, 0) 
  2704. ModifyEffects("<#1>", 1, 1440, UpperCase, 0, 16) 
  2705. ModifySpacing(2, 0, 0, 0, 90, 0, 0) 
  2706. ModifyTable(3, 2, ".", ",", "$", (8 + 16 + 128 + 256)) 
  2707. ModifyLines(1, 2, 180, 0, 0, 1440, 65535, 0) 
  2708. ModifyFont("Times New Roman", (20 * 20), 255, UpperCase) 
  2709. SetStyle(NewName) 
  2710. ModifyReflow() 
  2711. TYPE("This[Enter]is what the new[Enter]style looks[Enter]Like...[Enter]") 
  2712. SetStyle(BaseName) 
  2713. END FUNCTION 
  2714.  
  2715. See also: 
  2716.  
  2717.     ModifyAlignment 
  2718.     ModifyBreaks 
  2719.     ModifyEffects 
  2720.     ModifyFont 
  2721.     ModifyLines 
  2722.     ModifyReflow 
  2723.     ModifySelect 
  2724.     ModifySpacing 
  2725.     ModifyStyle 
  2726.     ModifyTable 
  2727.     SaveAsNewStyle 
  2728.     StyleManagement 
  2729.  
  2730.  
  2731. ΓòÉΓòÉΓòÉ 58. CurChar ΓòÉΓòÉΓòÉ
  2732.  
  2733. This function is used to determine the character to the right of the insertion 
  2734. point. 
  2735.  
  2736.  
  2737. Syntax 
  2738. CurChar$() 
  2739.  
  2740. Return Value 
  2741. The character to the right of the insertion point. 
  2742. The null string ("") if there is a mark at the insertion point. Marks returning 
  2743. the null string include a bookmark, a note, a date mark, a merge variable, the 
  2744. end of a paragraph, a footnote, etc. 
  2745.  
  2746. Example 
  2747. FUNCTION Example() 
  2748. UserControl("Place your cursor in the document, then click Resume...") 
  2749. Message(CurChar$()) 
  2750. UserControl("Shade some text, then click Resume...") 
  2751. Message(CurShade$()) 
  2752. UserControl("Double-click a word in your document, then click Resume...") 
  2753. Message(CurWord$()) 
  2754. END FUNCTION 
  2755.  
  2756. See also: 
  2757.  
  2758.     CurShade$ 
  2759.     CurWord$ 
  2760.     GetMarkText$ 
  2761.     GetTextBeforeCursor$ 
  2762.     GoToCmd 
  2763.  
  2764.  
  2765.  
  2766. ΓòÉΓòÉΓòÉ 59. CurShade ΓòÉΓòÉΓòÉ
  2767.  
  2768. This function is used to obtain the value of the selected text. 
  2769.  
  2770.  
  2771. Syntax 
  2772. CurShade$() 
  2773.  
  2774. Return Value 
  2775. The null string ("") if there is no text selected. 
  2776. Only printable characters are returned. Marks in the text are ignored. 
  2777.  
  2778. Example 
  2779. FUNCTION Example() 
  2780. UserControl("Place your cursor in the document, then click Resume...") 
  2781. Message(CurChar$()) 
  2782. UserControl("Shade some text, then click Resume...") 
  2783. Message(CurShade$()) 
  2784. UserControl("Click a word in your document, then click Resume...") 
  2785. Message(CurWord$()) 
  2786. END FUNCTION 
  2787.  
  2788. See also: 
  2789.  
  2790.     CurChar$ 
  2791.     CurWord$ 
  2792.     GetMarkText$ 
  2793.     GetTextBeforeCursor$ 
  2794.     GoToCmd 
  2795.  
  2796.  
  2797.  
  2798. ΓòÉΓòÉΓòÉ 60. CurWord ΓòÉΓòÉΓòÉ
  2799.  
  2800. This function is used to obtain the value of the word at the insertion point. 
  2801.  
  2802.  
  2803. Syntax 
  2804. CurWord$() 
  2805.  
  2806. Return Value 
  2807. Only printable characters. Marks in the text are ignored. 
  2808.  
  2809. Example 
  2810. FUNCTION Example() 
  2811. UserControl("Place your cursor in the document, then click Resume...") 
  2812. Message(CurChar$()) 
  2813. UserControl("Shade some text, then click Resume...") 
  2814. Message(CurShade$()) 
  2815. UserControl("Click a word in your document, then click Resume...") 
  2816. Message(CurWord$()) 
  2817. END FUNCTION 
  2818.  
  2819. See also: 
  2820.  
  2821.     CurChar$ 
  2822.     CurShade$ 
  2823.     GetMarkText$ 
  2824.     GetTextBeforeCursor$ 
  2825.     GoToCmd 
  2826.  
  2827.  
  2828.  
  2829.  
  2830. ΓòÉΓòÉΓòÉ 61. CustomView ΓòÉΓòÉΓòÉ
  2831.  
  2832. This function changes the current view level to Custom View. This function is 
  2833. equivalent to choosing View Custom. 
  2834.  
  2835.  
  2836. Syntax 
  2837. CustomView() 
  2838.  
  2839. Return Value 
  2840. This function returns 1. 
  2841.  
  2842. Example 
  2843. FUNCTION Example() 
  2844. CustomView() 
  2845. END FUNCTION 
  2846.  
  2847. See also: 
  2848.  
  2849.     EnlargedView 
  2850.     FacingView 
  2851.     FullPageView 
  2852.     GetViewLevel 
  2853.     LayoutMode 
  2854.     StandardView 
  2855.  
  2856.  
  2857. ΓòÉΓòÉΓòÉ 62. Cut ΓòÉΓòÉΓòÉ
  2858.  
  2859. This function is used to cut the selected text, frame, or table from the 
  2860. document and save it to the clipboard. This function is equivalent to choosing 
  2861. Edit Cut. 
  2862.  
  2863.  
  2864. Syntax 
  2865. Cut() 
  2866.  
  2867. Return Value 
  2868. This function does not return a value. If no text was shaded, the macro 
  2869. terminates with an error message. 
  2870.  
  2871. Example 
  2872. FUNCTION Example() 
  2873. UserControl("Shade the text to move to the end of the doc, then click 
  2874. Resume...") 
  2875. Cut()      ' cut the selected text 
  2876. TYPE("[CtrlEND]")    ' move to the end of the file 
  2877. Paste()       ' paste the text at the end of the file 
  2878. END FUNCTION 
  2879.  
  2880. See also: 
  2881.  
  2882.     Copy 
  2883.     CurChar$ 
  2884.     CurShade$ 
  2885.     CurWord$ 
  2886.     DDELinks 
  2887.     Paste 
  2888.  
  2889.  
  2890. ΓòÉΓòÉΓòÉ 63. DateDiff ΓòÉΓòÉΓòÉ
  2891.  
  2892. This function takes two dates (Date1, Date2) and calculates the number of days 
  2893. elapsed by subtracting Date2 from Date1. 
  2894.  
  2895.  
  2896. Syntax 
  2897. DateDiff(Date1, Date2) 
  2898. Date1 is the first date to examine. It can be stated as the number of seconds 
  2899. since January 1, 1970 or the current OS/2 date format. 
  2900. Date2 is the second date to examine. It can be stated as the number of seconds 
  2901. since January 1, 1970 or the current OS/2 date format. 
  2902. The date format must match the separator and month, day, and year order found 
  2903. in the OS/2 System Setup Country settings. 
  2904.  
  2905. Return Value 
  2906. The number of days the two dates differ. 
  2907.  
  2908. Example 
  2909. FUNCTION Example() 
  2910. Born = Query$("What is your Birthday (MM/DD/YY)?") 
  2911. Date = FormatDate$(Now(), "h") 'current date 
  2912. Time = FormatTime$(Now(), 6)   'current time 
  2913. Days = DateDiff(Born, Date) ' how many days old 
  2914. TextDate = FormatDate$(Now(), "d")    'format the date 
  2915. Message("It is now {Time} on {TextDate}. You are {Days} days old.") 
  2916. END FUNCTION 
  2917.  
  2918. See also: 
  2919.  
  2920.     FormatDate$ 
  2921.     FormatTime$ 
  2922.     GetTime 
  2923.     Now 
  2924.  
  2925.  
  2926. ΓòÉΓòÉΓòÉ 64. DDEAdvise ΓòÉΓòÉΓòÉ
  2927.  
  2928. This function is used to have another application notify Ami Pro when data has 
  2929. changed in that application. Before using the DDEAdvise function, a 
  2930. conversation with the other application must be started using the DDEInitiate 
  2931. function. 
  2932.  
  2933.  
  2934. Following the DDEAdvise function, Ami Pro continues operation normally. When 
  2935. data is received from the channel and item, the macro specified in the 
  2936. DDEAdvise function is started. The data received from the other application (in 
  2937. CF_Text format) is passed to the macro specified in the DDEAdvise function as 
  2938. the first argument to the macro. It is up to the macro to parse the data from 
  2939. the other application as needed. 
  2940.  
  2941. Syntax 
  2942. DDEAdvise(ChannelID, Item, MacroName[!Function]) 
  2943. ChannelID is the channel ID of the Dynamic Data Exchange (DDE) conversation. 
  2944. Item describes the information requested from the linked application. 
  2945. MacroName is the name of an Ami Pro macro to execute when data changes in the 
  2946. linked application. 
  2947.  
  2948. Return Value 
  2949. 1  (TRUE) if the other application responded to the Ami Pro request. 
  2950. 0  (FALSE) if the other application could not be contacted or if an invalid 
  2951. ChannelID was used. 
  2952.  
  2953. Example 
  2954. FUNCTION Example() 
  2955. ' This example starts a conversation with 123w untitled worksheet and 
  2956. ' sets up a dde advise back to Ami Pro with the cells A1 and A2. 
  2957.  
  2958. ' If the user types data into A1, Ami Pro is notified and displays the value. 
  2959. ' If the user types data into A2, Ami Pro breaks the Advise with DDEUnAdvise 
  2960. ' and terminates the conversation. 
  2961.  
  2962. id = DDEInitiate("123w", "Untitled") ' start a dde conversation with 123w 
  2963. IF id = 0 
  2964.     Exec("c:\123w\123w.exe", "") ' launch app if unable to connect 
  2965.     id = DDEInitiate("123w", "Untitled") ' contact one more time 
  2966.     IF id = 0 
  2967.        Message("Unable to contact server application.") ' failed to contact 
  2968.        EXIT FUNCTION 
  2969.     ENDIF 
  2970. ENDIF 
  2971. AllocGlobalVar("ChannelID", 1) ' create a global variable 
  2972. SetGlobalVar("ChannelID", id) ' store the channel id in a global variable 
  2973. RMac = GetRunningMacroFile$() ' what macro name are we running? 
  2974. DDEAdvise(id, "A1", "{RMac}!GetData") ' set up advise for cell A1 
  2975. DDEAdvise(id, "A2", "{RMac}!EndDDE") ' set up advise for cell A2 
  2976. END FUNCTION 
  2977.  
  2978. Function GetData(value) 
  2979. Message("The value just typed in A1 = {value}") ' display the value 
  2980. END FUNCTION 
  2981.  
  2982. Function EndDDE() 
  2983. id = GetGlobalvar$("ChannelID") ' get the channel id 
  2984. DDEUnAdvise(id, "A1") ' unadvise on both cells 
  2985. DDEUnAdvise(id, "A2") 
  2986. DDETerminate(id) ' terminate the dde conversation 
  2987. FreeGlobalVar("ChannelID") ' free the global variable 
  2988. Message("DDE Session Terminated!") ' let the user know it worked 
  2989. END FUNCTION 
  2990.  
  2991. See also: 
  2992.  
  2993.     DDEExecute 
  2994.     DDEInitiate 
  2995.     DDEPoke 
  2996.     DDEReceive$ 
  2997.     DDETerminate 
  2998.     DDEUnAdvise 
  2999.     Exec 
  3000.     GetMacPath$ 
  3001.     GetRunningMacroFile$ 
  3002.  
  3003.  
  3004.  
  3005. ΓòÉΓòÉΓòÉ 65. DDEExecute ΓòÉΓòÉΓòÉ
  3006.  
  3007. This function gives a command to an application using Dynamic Data Exchange 
  3008. (DDE). Before using this function, a conversation with the other application 
  3009. must be started using the DDEInitiate function. The command given to the linked 
  3010. application is defined by that application. 
  3011.  
  3012.  
  3013. Syntax 
  3014. DDEExecute(ChannelID, Command) 
  3015. ChannelID is the channel ID of the DDE conversation. 
  3016. Command is the command, in square brackets, to give to the linked application. 
  3017.  
  3018. Return Value 
  3019. 0  if the command was successfully sent to the other application. 
  3020. -1 if the application refused the command or if an invalid ChannelID was used. 
  3021.  
  3022. Example 
  3023. FUNCTION Example() 
  3024. ' This example commands 123w to open the file EMPLOYEE.WK3 
  3025.  
  3026. ' start a dde conversation with 123w 
  3027. id = DDEInitiate("123w", "Untitled") 
  3028. IF id = 0 
  3029.     ' launch app if unable to connect 
  3030.     Exec("c:\123w\123w.exe", "") 
  3031.     ' contact one more time 
  3032.     id = DDEInitiate("123w", "Untitled") 
  3033.     IF id = 0 
  3034.        ' failed to contact 
  3035.        Message("Unable to contact server application.") 
  3036.        EXIT FUNCTION 
  3037.     ENDIF 
  3038. ENDIF 
  3039. onerror endit ' set up an error address 
  3040. filename = "Employee.wk3" ' assign a file to a variable 
  3041. ' assign a command to a variable 
  3042. command = "[[RUN(""/FR{filename}~"")]" 
  3043. DDEExecute(id, command) ' command 123w to execute the command 
  3044. endit: 
  3045. DDETerminate(id) ' terminate the conversation 
  3046. END FUNCTION 
  3047.  
  3048. See also: 
  3049.  
  3050.     ActivateApp 
  3051.     DDEAdvise 
  3052.     DDEInitiate 
  3053.     DDEPoke 
  3054.     DDEReceive$ 
  3055.     DDETerminate 
  3056.     DDEUnAdvise 
  3057.     Exec 
  3058.  
  3059.  
  3060. ΓòÉΓòÉΓòÉ 66. DDEInitiate ΓòÉΓòÉΓòÉ
  3061.  
  3062. This function starts a conversation with another application using Dynamic Data 
  3063. Exchange (DDE). The application must be capable of communicating using the DDE 
  3064. protocol. This function must be used prior to any other DDE activity with an 
  3065. application. 
  3066.  
  3067.  
  3068. Syntax 
  3069. DDEInitiate(App, Data) 
  3070. App is the application that is the target of the DDE conversation. 
  3071. Data is defined by the other application, but usually is the name of the 
  3072. application's data file you want to access. 
  3073.  
  3074. Return Value 
  3075. A positive number if the ChannelID of the conversation was successfully 
  3076. established. 
  3077. 0  (FALSE) if the conversation could not be started. This was because the 
  3078. application was not running, did not have the Topic open, or does not support 
  3079. DDE. 
  3080.  
  3081. Example 
  3082. FUNCTION Example() 
  3083. Mac = GetRunningMacroFile$() 
  3084. id = DDEInitiate("123W", "Untitled") 
  3085. IF id = 0 
  3086.     Exec("123W.EXE","") ' No id, try to start 123W 
  3087.     id = DDEInitiate("123W", "Untitled") 
  3088.        IF id = 0 
  3089.            Message("Could not initiate a conversation with 1-2-3!") 
  3090.            Exit Function 
  3091.        ENDIF 
  3092. ENDIF 
  3093. ' Poke data into spreadsheet 
  3094. Address = "A2"    ' This could be a named range 
  3095. Value = 30 
  3096. DDEPoke(id,Address,Value) 
  3097. DDEPoke(id, "A1", "200") 
  3098. DDETerminate(Id)  ' Terminate the conversation 
  3099. END FUNCTION 
  3100.  
  3101. See also: 
  3102.  
  3103.     DDEAdvise 
  3104.     DDEExecute 
  3105.     DDEPoke 
  3106.     DDEReceive$ 
  3107.     DDETerminate 
  3108.     DDEUnAdvise 
  3109.     Exec 
  3110.  
  3111.  
  3112.  
  3113. ΓòÉΓòÉΓòÉ 67. DDELinks ΓòÉΓòÉΓòÉ
  3114.  
  3115. This function displays the Link Options dialog box. This function is equivalent 
  3116. to choosing Edit/Link Options. Links cannot be adjusted automatically using a 
  3117. macro. When the dialog box displays, the user can view and adjust them manually 
  3118. and then choose Update or Cancel to return to the macro. 
  3119.  
  3120.  
  3121. Syntax 
  3122. DDELinks(Flag, Count[, LinkSpecPairs][, App, Data, Item]) 
  3123. Flag is the action taken. 
  3124.     1 - Unlink 
  3125.     2 - Update 
  3126.     3 - Stop 
  3127.     4 - Change 
  3128.     5 - Create 
  3129.     Create is probably the most commonly used value. 
  3130. Count is the number of LinkSpecPairs. Each pair consists of the internal ID and 
  3131. the Type (text or frame). 
  3132.  
  3133. Return Value 
  3134. 1  (TRUE) if the  links dialog box was successfully displayed. 
  3135. 0  (UserCancel) if the user canceled the function. 
  3136.  
  3137. Example 
  3138. FUNCTION Example() 
  3139. ' this command was initiated with a DDE link from cell A2 in a 1-2-3 
  3140. ' file called FILE0001.WK3 into an Ami Pro document 
  3141. ' called TESTFILE.SAM.This document was opened and initially DDE links 
  3142. ' were not updated. 
  3143.  
  3144. flag=2 'update link 
  3145. numlinks=1 'number of link to change with this statement 
  3146. whichlink=1   'the number of the link to change 
  3147. linktype="Text"   'the kind of link to change 
  3148. DDELinks(flag, numlinks, whichlink, linktype) 
  3149. END FUNCTION 
  3150.  
  3151. See also: 
  3152.  
  3153.     Copy 
  3154.     Cut 
  3155.     Paste 
  3156.  
  3157.  
  3158. ΓòÉΓòÉΓòÉ 68. DDEPoke ΓòÉΓòÉΓòÉ
  3159.  
  3160. This function is used to send data from Ami Pro to another application or to a 
  3161. bookmark. Before using this function, a conversation with the other application 
  3162. must be started using the DDEInitiate function. 
  3163.  
  3164.  
  3165. If you name an existing text bookmark in a DDEPoke message, Ami Pro replaces 
  3166. the contents of the bookmark with the poked data. 
  3167.  
  3168. Syntax 
  3169. DDEPoke(ChannelID, Location, Data) 
  3170. ChannelID is the channel ID of the Dynamic Data Exchange (DDE) conversation. 
  3171. Location is the location in the other application to poke the data or the name 
  3172. of the bookmark. 
  3173. Data is the data to send to the other application. 
  3174.  
  3175. Return Value 
  3176. 1  (TRUE) if the other application accepted the data sent by Ami Pro. 
  3177. 0  (FALSE) if the other application could not be contacted or if an invalid 
  3178. ChannelID was used. 
  3179.  
  3180. Example 
  3181. FUNCTION Example() 
  3182. Mac = GetRunningMacroFile$() 
  3183. id = DDEInitiate("123W", "Untitled") 
  3184. IF id = 0 
  3185.     ' No id, try to start 123W 
  3186.     Exec("123W.EXE","") 
  3187.     id = DDEInitiate("123W", "Untitled") 
  3188.        IF id = 0 
  3189.            Message("Could not initiate a conversation with 1-2-3!") 
  3190.            Exit Function 
  3191.        ENDIF 
  3192. ENDIF 
  3193.  
  3194. ' Poke data into spreadsheet 
  3195. Address = "A2"    ' This could be a named range 
  3196. Value = 30 
  3197. DDEPoke(id,Address,Value) 
  3198. DDEPoke(id, "A1", "200") 
  3199. DDETerminate(Id)  ' Terminate the conversation 
  3200. END FUNCTION 
  3201.  
  3202. See also: 
  3203.  
  3204.     DDEAdvise 
  3205.     DDEExecute 
  3206.     DDEInitiate 
  3207.     DDEReceive$ 
  3208.     DDETerminate 
  3209.     DDEUnAdvise 
  3210.     Exec 
  3211.  
  3212.  
  3213. ΓòÉΓòÉΓòÉ 69. DDEReceive ΓòÉΓòÉΓòÉ
  3214.  
  3215. This function receives up to 250 characters from an application using Dynamic 
  3216. Data Exchange (DDE). Before using this function, a conversation with the other 
  3217. application must be started using the DDEInitiate function. When this function 
  3218. is used, Ami Pro waits until the other application processes the request and 
  3219. then receives the data. 
  3220.  
  3221.  
  3222. Syntax 
  3223. DDEReceive$(ChannelID, Item) 
  3224. ChannelID is the channel ID of the DDE conversation. 
  3225. Item describes the information requested from the linked application. 
  3226.  
  3227. Return Value 
  3228. A null string ("") if the application could not send the data. 
  3229. The data requested from the other application. 
  3230.  
  3231. Example 
  3232. FUNCTION Example() 
  3233. id = DDEInitiate("123W", "Untitled") 
  3234. IF id = 0 
  3235.     Exec("C:\123W\123W.EXE", 1) 
  3236.     FOR I = 1 to 10 
  3237.        id = DDEInitiate("123W", "Untitled") 
  3238.        IF id > 0 
  3239.            OK = TRUE 
  3240.            BREAK 
  3241.        ENDIF 
  3242.     NEXT 
  3243.     IF not OK 
  3244.        Message("Could not initiate a conversation with 1-2-3!") 
  3245.        EXIT FUNCTION 
  3246.     ENDIF 
  3247. ENDIF 
  3248. Principal = Query$("What is the principal of the loan?") 
  3249. Interest = Query$("What is the annual interest rate (12% = .12)?") / 12 
  3250. Term = Query$("What is the term in months?") 
  3251. IF Interest > 1 
  3252.     Interest = Interest / 100 
  3253. ELSEIF Right$(Interest, 1) = "%" 
  3254.     Interest = Left$(Interest, (Len(Interest) - 1)) / 100 
  3255. ENDIF 
  3256. DDEExecute(id, "[[RUN(""+@PMT({Principal},{Interest},{Term})~"")]") 
  3257. Value = DDEReceive$(id, "A1") 
  3258. DDETerminate(id) 
  3259. Message(Value) 
  3260. END FUNCTION 
  3261.  
  3262. See also: 
  3263.  
  3264.     DDEAdvise 
  3265.     DDEExecute 
  3266.     DDEInitiate 
  3267.     DDEPoke 
  3268.     DDETerminate 
  3269.     DDEUnAdvise 
  3270.     Exec 
  3271.  
  3272.  
  3273. ΓòÉΓòÉΓòÉ 70. DDETerminate ΓòÉΓòÉΓòÉ
  3274.  
  3275. This function ends a conversation with an application using Dynamic Data 
  3276. Exchange (DDE). When this function is used, Ami Pro closes the link with the 
  3277. other application. If more information is needed after this function is used, a 
  3278. new conversation must be started. 
  3279.  
  3280.  
  3281. Syntax 
  3282. DDETerminate(ChannelID) 
  3283. ChannelID is the channel ID of the DDE conversation. 
  3284.  
  3285. Return Value 
  3286. 1  (TRUE) if the conversation was successfully concluded. 
  3287. 0  (FALSE) if the conversation was not concluded or if an invalid ChannelID was 
  3288. used. 
  3289.  
  3290. Example 
  3291. FUNCTION Example() 
  3292. Mac = GetRunningMacroFile$() 
  3293. id = DDEInitiate("123W", "Untitled") 
  3294. IF id = 0 
  3295.     ' No id, try to start 123W 
  3296.     Exec("123W.EXE","") 
  3297.     id = DDEInitiate("123W", "Untitled") 
  3298.        IF id = 0 
  3299.            Message("Could not initiate a conversation with 1-2-3!") 
  3300.            Exit Function 
  3301.        ENDIF 
  3302. ENDIF 
  3303.  
  3304. ' Poke data into spreadsheet 
  3305. Address = "A2"    ' This could be a named range 
  3306. Value = 30 
  3307. DDEPoke(id,Address,Value) 
  3308. DDEPoke(id, "A1", "200") 
  3309. DDETerminate(Id)  ' Terminate the conversation 
  3310. END FUNCTION 
  3311.  
  3312. See also: 
  3313.  
  3314.     DDEAdvise 
  3315.     DDEExecute 
  3316.     DDEInitiate 
  3317.     DDEPoke 
  3318.     DDEReceive$ 
  3319.     DDEUnAdvise 
  3320.     Exec 
  3321.  
  3322.  
  3323. ΓòÉΓòÉΓòÉ 71. DDEUnAdvise ΓòÉΓòÉΓòÉ
  3324.  
  3325. This function is used to reset the notification status set up using the 
  3326. DDEAdvise function. When this function is used, the other application on the 
  3327. current Dynamic Data Exchange (DDE) channel no longer notifies Ami Pro when 
  3328. data changes have occurred. 
  3329.  
  3330.  
  3331. Syntax 
  3332. DDEUnAdvise(ChannelID, Item) 
  3333. ChannelID is the channel ID of the DDE conversation. 
  3334. Item describes the information requested from the linked application. 
  3335.  
  3336. Return Value 
  3337. 1  (TRUE) if the other application responded to the Ami Pro request. 
  3338. 0  (FALSE) if the other application could not be contacted or if an invalid 
  3339. ChannelID was used. 
  3340.  
  3341. Example 
  3342. FUNCTION Example() 
  3343. MacFile = GetRunningMacroFile$() 
  3344. DECLARE GetNumber() 
  3345. id = DDEInitiate("123W", "Untitled") 
  3346. IF id = 0 
  3347.     Exec("123W.EXE", 1) 
  3348.     FOR I = 1 to 10 
  3349.        id = DDEInitiate("123W", "Untitled") 
  3350.        IF id > 0 
  3351.            OK = TRUE 
  3352.            BREAK 
  3353.        ENDIF 
  3354.     NEXT 
  3355.     IF not OK 
  3356.        Message("Could not initiate a conversation with 1-2-3!") 
  3357.        EXIT FUNCTION 
  3358.     ENDIF 
  3359. ENDIF 
  3360. AllocGlobalVar("ChannelNumber", 1) 
  3361. SetGlobalVar("ChannelNumber", id) 
  3362. DDEPoke(id, "A1", "12345") 
  3363. DDEAdvise(id, "A1", "{MacFile}!GetNumber") 
  3364. GoTo endit 
  3365. toast: 
  3366. DDEUnAdvise(id, "A1") 
  3367. FreeGlobalVar("ChannelNumber") 
  3368. DDETerminate(id) 
  3369. endit: 
  3370. END FUNCTION 
  3371.  
  3372. FUNCTION GetNumber() 
  3373. id = GetGlobalVar$("ChannelNumber") 
  3374. FreeGlobalVar("ChannelNumber") 
  3375. Value = DDEReceive$(id, "A1") 
  3376. DDEUnAdvise(id, "A1") 
  3377. DDETerminate(id) 
  3378. Message("The contents of cell A1 is {Value}") 
  3379. END FUNCTION 
  3380.  
  3381. See also: 
  3382.  
  3383.     DDEAdvise 
  3384.     DDEExecute 
  3385.     DDEInitiate 
  3386.     DDEPoke 
  3387.     DDEReceive$ 
  3388.     DDETerminate 
  3389.     Exec 
  3390.  
  3391.  
  3392. ΓòÉΓòÉΓòÉ 72. Decide ΓòÉΓòÉΓòÉ
  3393.  
  3394. This function displays a standard message box with a Help button, the specified 
  3395. prompt and title, and Yes and No push buttons. It waits for the user to select 
  3396. a push button and then returns the ID of the button pressed. 
  3397.  
  3398.  
  3399. Syntax 
  3400. Decide(Prompt[, Title]) 
  3401. prompt is a string used as a prompt to the user. It can be a maximum of 80 
  3402. characters. 
  3403. Title is the title for the message box. The default is "Ami Pro Macro." 
  3404.  
  3405. Return Value 
  3406.     DecideYes (1) - Yes 
  3407.     DecideNo (0) - No 
  3408.  
  3409. Example 
  3410. FUNCTION Example() 
  3411. again: 
  3412. result = Decide("See this message again?") 
  3413. IF result = 1 
  3414.     GoTo again 
  3415. ENDIF 
  3416. END FUNCTION 
  3417.  
  3418. See also: 
  3419.  
  3420.     DialogBox 
  3421.     Message 
  3422.     Query$ 
  3423.     UserControl 
  3424.  
  3425.  
  3426. ΓòÉΓòÉΓòÉ 73. DefineStyle ΓòÉΓòÉΓòÉ
  3427.  
  3428. This function takes the attributes of the selected text and applies it to the 
  3429. currently selected style. This function is equivalent to choosing Style Define 
  3430. Style. 
  3431.  
  3432.  
  3433. Syntax 
  3434. DefineStyle() 
  3435.  
  3436. Return Value 
  3437. 1  (TRUE) if the style was changed. 
  3438. 0  (UserCancel) if the user canceled the function. 
  3439.  
  3440. Example 
  3441. FUNCTION Example() 
  3442. ' Type some text and apply an attribute 
  3443. Type ("This is some text") 
  3444. Type ("[ShiftCtrlLeft]")    ' Shade one word 
  3445. Bold() 
  3446. Italic() 
  3447. DefineStyle()     ' Apply the attributes to the current style 
  3448. END FUNCTION 
  3449.  
  3450. See also: 
  3451.  
  3452.     CreateStyle 
  3453.     ModifyAlignment 
  3454.     ModifyBreaks 
  3455.     ModifyEffects 
  3456.     ModifyFont 
  3457.     ModifyLines 
  3458.     ModifyReflow 
  3459.     ModifySelect 
  3460.     ModifySpacing 
  3461.     ModifyStyle 
  3462.     ModifyTable 
  3463.     SaveAsNewStyle 
  3464.     StyleManagement 
  3465.  
  3466.  
  3467.  
  3468.  
  3469. ΓòÉΓòÉΓòÉ 74. DeleteColumnRow ΓòÉΓòÉΓòÉ
  3470.  
  3471. This function deletes a column or row from a table. This function is equivalent 
  3472. to choosing Table Delete Column Row. 
  3473.  
  3474.  
  3475. Syntax 
  3476. DeleteColumnRow(Which) 
  3477. Which determines whether to delete the current column or the current row. This 
  3478. parameter should be set to one of the following values: 
  3479.     Column (1) - Delete the current column 
  3480.     Row (0) - Delete the current row 
  3481.  
  3482. To display a dialog box that allows the user to decide whether to delete a 
  3483. column or row: DeleteColumnRow 
  3484.  
  3485. Return Value 
  3486. 1  (TRUE) if the column or row was deleted. 
  3487. 0  (UserCancel/FALSE) if the user canceled the function or if no action was 
  3488. taken. 
  3489.  
  3490. Example 
  3491. FUNCTION Example() 
  3492. DeleteColumnRow(Column) 
  3493. END FUNCTION 
  3494.  
  3495. See also: 
  3496.  
  3497.     InsertColumnRow 
  3498.     SizeColumnRow 
  3499.  
  3500.  
  3501.  
  3502. ΓòÉΓòÉΓòÉ 75. DeleteEntireTable ΓòÉΓòÉΓòÉ
  3503.  
  3504. This function deletes the selected table. This function is equivalent to 
  3505. choosing Table Delete Entire Table. 
  3506.  
  3507.  
  3508. Syntax 
  3509. DeleteEntireTable() 
  3510.  
  3511. Return Value 
  3512. 0  (NoAction) if no action is taken. The table may not exist or may not be 
  3513. selected. 
  3514. 1  (True) if the table is deleted. 
  3515. -2  (GeneralFailure) if the function failed. 
  3516.  
  3517. Example 
  3518. FUNCTION Example() 
  3519. DeleteEntireTable() 
  3520. END FUNCTION 
  3521.  
  3522. See also: 
  3523.  
  3524.     DeleteColumnRow 
  3525.     InsertColumnRow 
  3526.     SizeColumnRow 
  3527.     TableLayout 
  3528.     TableLines 
  3529.     Tables 
  3530.  
  3531.  
  3532. ΓòÉΓòÉΓòÉ 76. DeleteMenu ΓòÉΓòÉΓòÉ
  3533.  
  3534. This function deletes a menu from a menu bar. 
  3535.  
  3536.  
  3537. Syntax 
  3538. DeleteMenu(BarID, Menu) 
  3539. BarID is the identification number of the menu bar and must always be 1. 
  3540. Menu is the name of the pull down menu to be deleted. This name must match the 
  3541. name of the pull down menu you want to delete, including any ampersand (&) 
  3542. characters. An ampersand is placed before a character that has an underline. 
  3543.  
  3544. Return Value 
  3545. 1  (TRUE) if the menu was successfully deleted. 
  3546. 0  (FALSE) if the menu could not be deleted or if an invalid BarID or Menu name 
  3547. was used. 
  3548.  
  3549. Example 
  3550. FUNCTION Example() 
  3551. ' get the name of this macro 
  3552. Mac = GetRunningMacroFile$() 
  3553. Menu = "&Custom" 
  3554. DeleteMenu(1,Menu) 
  3555. AddMenu(1,Menu)   'Add a menu called Custom 
  3556. ' add menu items 
  3557. AddMenuItem(1,Menu,"New...",New,"") 
  3558. AddMenuItem(1,Menu,"My Copy",Copy,"") 
  3559. AddMenuItem(1,Menu,"-","","") 
  3560. AddMenuItem(1,Menu,"Remove {Menu}","{Mac}!Remove()","Remove {Menu} menu.") 
  3561. End Function 
  3562.  
  3563. Function Remove() 
  3564. DeleteMenu(1,"&Custom") 
  3565. END FUNCTION 
  3566.  
  3567. See also: 
  3568.  
  3569.     AddMenu 
  3570.     AddMenuItem 
  3571.     ChangeMenuAction 
  3572.     CheckMenuItem 
  3573.     DeleteMenuItem 
  3574.     GrayMenuItem 
  3575.     RenameMenuItem 
  3576.  
  3577.  
  3578. ΓòÉΓòÉΓòÉ 77. DeleteMenuItem ΓòÉΓòÉΓòÉ
  3579.  
  3580. This function deletes a menu item from a menu or a cascade menu. 
  3581.  
  3582.  
  3583. Syntax 
  3584. DeleteMenuItem(BarID, Menu[, CascadeMenu], Item) 
  3585. BarID is the identification number of the menu bar and must always be 1. 
  3586. Menu is the name of the pull down where the item to be deleted is located. This 
  3587. name must match the name of the pull down menu, including any ampersand (&) 
  3588. characters. An ampersand is placed before a character that has an underline. 
  3589. CascadeMenu is the optional name of the cascade menu where the item to be 
  3590. deleted is located. This name must match the name of the cascade menu, 
  3591. including any ampersand (&) characters. An ampersand is placed before a 
  3592. character that has an underline. 
  3593. ItemName is the name of the menu item to be deleted. This name must match. If 
  3594. the menu item has a shortcut key, you must press TAB, type a ^, and then type 
  3595. the appropriate letter as part of the item name. 
  3596.  
  3597. Return Value 
  3598. 1 (TRUE) if the item was successfully deleted. 
  3599. 0 (FALSE) if the item could not be deleted or if an invalid BarID, MenuName, or 
  3600. ItemName was used. 
  3601.  
  3602. Example 
  3603. FUNCTION Example() 
  3604. RMac = GetRunningMacroFile$() ' get the name of the running macro 
  3605. DeleteMenuItem(1, "&File", "&Print... ^P") 
  3606. OnCancel RestoreIt ' set a goto address in case the user cancels 
  3607. UserControl("The Print menu item is gone. Select Resume to restore.") 
  3608. RestoreIt: 
  3609. ' put the the menu back 
  3610. InsertMenuItem(1, "&File", 17, "&Print...    ^P", fileprint, "Print the current 
  3611.  document.") 
  3612. END FUNCTION 
  3613.  
  3614. See also: 
  3615.  
  3616.     AddMenu 
  3617.     AddMenuItem 
  3618.     ChangeMenuAction 
  3619.     CheckMenuItem 
  3620.     DeleteMenu 
  3621.     GrayMenuItem 
  3622.     RenameMenuItem 
  3623.  
  3624.  
  3625. ΓòÉΓòÉΓòÉ 78. DialogBox ΓòÉΓòÉΓòÉ
  3626.  
  3627. You can create a dialog box in the Dialog Editor by drawing push buttons, group 
  3628. boxes, radio buttons, check boxes, text boxes, edit boxes, list boxes, combo 
  3629. boxes, and static text directly onto an editing screen. After you create and 
  3630. save your dialog box in the Dialog Editor, you can include it in or call it 
  3631. from an Ami Pro macro. 
  3632.  
  3633.  
  3634. The dialog box you create in the Dialog Editor is modal. That means the user 
  3635. can make choices from the dialog box, but no other action can take place until 
  3636. either OK or CANCEL has been chosen. You must include either an OK button, a 
  3637. CANCEL button, or both in the dialog box to return control to the macro. 
  3638.  
  3639. The exception to this is when you assign a callback to a particular control. If 
  3640. the value of a control that has a callback assigned to it ever changes, then a 
  3641. macro function specified in SetDialogCallback is instantly executed, even 
  3642. though the dialog box is still displayed. This allows you to validate data 
  3643. entered in a dialog box. 
  3644.  
  3645. You can use FillList to supply the contents of a list box prior displaying the 
  3646. dialog box. You can use FillEditto supply the contents of any edit box or list 
  3647. box or to supply the state of a button prior to displaying the dialog box. Once 
  3648. the dialog box display is complete, you can use GetDialogField$ to retrieve the 
  3649. contents of the dialog box fields. 
  3650.  
  3651. If you copy the dialog box into an Ami Pro macro, the formatting information 
  3652. for the dialog box must be contained between the DIALOG and END DIALOG 
  3653. statements. 
  3654.  
  3655. Syntax 
  3656. DialogBox(ResourceFile, DialogBoxName) 
  3657. ResourceFile is the file name of the external file which contains the dialog 
  3658. box, for example, SMARTFLD.DLG. If the dialog box was created using the Dialog 
  3659. Editor and is the only dialog box in the file, this parameter should be the 
  3660. null string (""). If the dialog box was created using the Dialog Editor and 
  3661. resides in the currently running macro file, this parameter should be a period 
  3662. ("."). 
  3663. DialogBoxName is the name of the dialog box to be accessed. If the dialog box 
  3664. was created using the Dialog Editor and is the only dialog box in an external 
  3665. file, this parameter should be set to the name of the file. 
  3666.  
  3667. Return Value 
  3668. The ID of the push button pressed. 
  3669. 0  (UserCancel) if the user canceled the function. 
  3670. -1  (NotFound) if the resource file was not found. 
  3671.  
  3672. Example 
  3673. FUNCTION Example() 
  3674. Filledit(20,1)       ' Turn apples on 
  3675. Filledit(8000,"Bob") ' Put text in Edit Box 
  3676. Filledit(9001,"*.sam") 
  3677. Box = DialogBox(".","ExampleBox") 
  3678. IF Box<>1 
  3679.     EXIT FUNCTION 
  3680. ENDIF 
  3681. Store = GetdialogField$(22)    ' Retrieve Combo Box 
  3682. File = GetdialogField$(9001)       ' Retrieve List Box result 
  3683. Name = GetDialogField$(8000)   ' Retrieve Edit Box 
  3684. Dir = GetCurrentDir$()      ' Get current directory 
  3685. Message("Goto Store = {Store} Name = {Name} File = {File}") 
  3686. END FUNCTION 
  3687.  
  3688. DIALOG ExampleBox 
  3689. -2134376448 10 71 44 115 98 "" "" "Sample Dialog Box" 
  3690. FONT 8 "Helv" 
  3691. 69 3 40 14 1 1342373889 "button" "OK" 0 
  3692. 69 19 40 14 2 1342373888 "button" "Cancel" 0 
  3693. 6 24 52 56 9001 1352728579 "listbox" "" 0 
  3694. 6 13 40 10 7999 1342177280 "static" "" 0 
  3695. 6 4 40 10 1001 1342177280 "static" "&Files:" 0 
  3696. 69 37 37 12 20 1342242825 "button" "&Apples" 0 
  3697. 69 49 42 12 21 1342242825 "button" "&Oranges" 0 
  3698. 6 83 45 12 22 1342242819 "button" "&Goto Store" 0 
  3699. 69 61 42 12 23 1342242825 "button" "&Soap" 0 
  3700. 69 82 43 12 8000 1350631552 "edit" "" 0 
  3701. END DIALOG 
  3702.  
  3703. See also: 
  3704.  
  3705.     Decide 
  3706.     DlgClearControl 
  3707.     DlgClose 
  3708.     DlgEnableControl 
  3709.     DlgGetListBoxCount 
  3710.     DlgGetListBoxLines 
  3711.     DlgHideControl 
  3712.     DlgKeyInterrupt 
  3713.     DlgLimitText 
  3714.     DlgSetCaption 
  3715.     FillEdit 
  3716.     FillList 
  3717.     GetDialogField$ 
  3718.     GetDLGItem 
  3719.     GetDLGItemText 
  3720.     GetMacPath$ 
  3721.     Message 
  3722.     Query$ 
  3723.     SetDLGCallBack 
  3724.     SetDLGItemText 
  3725.     UserControl 
  3726.     Using the Lotus Dialog Editor 
  3727.  
  3728.  
  3729. ΓòÉΓòÉΓòÉ 79. DlgClearControl ΓòÉΓòÉΓòÉ
  3730.  
  3731. This function clears the specified control ID from list boxes, combo boxes, and 
  3732. edit boxes that have been created using the Dialog Editor. 
  3733.  
  3734.  
  3735. Syntax 
  3736. DlgClearContro(Hdlg, ID) 
  3737. Hdlg identifies the dialog box handle. 
  3738. ID is the number the Dialog Editor automatically assigns to a control. An edit 
  3739. box can have an ID value from 8000 through 8999. A list box can have an ID 
  3740. value from 9000 through 9499. A combo box can have an ID value from 9500 
  3741. through 9999. 
  3742.  
  3743. Return Value 
  3744.  
  3745. Example 
  3746. Function Main() 
  3747. Mac = GetRunningMacroFile$() 
  3748. DocPath = GetDocPath$() 
  3749. SetDlgCallBack(0, "{Mac}!InitDlg") 
  3750. SetDlgCallBack(21, "{Mac}!ClearBox") 
  3751. FillEdit(9001, "{DocPath}*.sam") 
  3752. Box = DialogBox(".","OpenBox") 
  3753. End Function 
  3754.  
  3755. Function InitDlg(Hdlg) 
  3756. ' Init routine for the dialogbox - this is executed before the box is displayed 
  3757. DlgEnableControl(Hdlg, 1, 0)       ' grey the OK button 
  3758. End Function 
  3759.  
  3760. Function ClearBox(Hdlg, id, value) 
  3761. ' hit the Clear button to get here 
  3762. Message("Clear the listbox and enable the OK") 
  3763. DlgEnableControl(Hdlg, 1, 1) 
  3764. DlgClearControl(Hdlg, 9001) 
  3765. Message("Now close the box") 
  3766. DlgClose(Hdlg) 
  3767. End Function 
  3768.  
  3769. DIALOG OpenBox 
  3770. -2134376448   4   71 51 160 90 ""  "" "Listbox Example" 
  3771. 10  10 85  40 9001   1352728579"listbox" ""  0 
  3772. 6   60 40  14 1   1342373889"button"  "OK"   0 
  3773. 54  60 40  14 2   1342373888"button"  "Cancel"  0 
  3774. 99  60 40  14 21  1342373888"button"  "Clear"0 
  3775. END DIALOG 
  3776.  
  3777. See also: 
  3778.  
  3779.     DialogBox 
  3780.     DlgClose 
  3781.     DlgEnableControl 
  3782.     DlgGetListBoxCount 
  3783.     DlgGetListBoxLines 
  3784.     DlgHideControl 
  3785.     DlgKeyInterrupt 
  3786.     DlgLimitText 
  3787.     DlgSetCaption 
  3788.  
  3789.  
  3790.  
  3791.  
  3792. ΓòÉΓòÉΓòÉ 80. DlgClose ΓòÉΓòÉΓòÉ
  3793.  
  3794. This function closes a dialog box that has been created using the Dialog 
  3795. Editor. 
  3796.  
  3797.  
  3798. Syntax 
  3799. DlgClose(Hdlg) 
  3800. Hdlg identifies the dialog box handle. 
  3801.  
  3802. Return Value 
  3803.  
  3804. Example 
  3805. Function Main() 
  3806. Mac = GetRunningMacroFile$() 
  3807. DocPath = GetDocPath$() 
  3808. SetDlgCallBack(0, "{Mac}!InitDlg") 
  3809. SetDlgCallBack(21, "{Mac}!ClearBox") 
  3810. FillEdit(9001, "{DocPath}*.sam") 
  3811. Box = DialogBox(".","OpenBox") 
  3812. End Function 
  3813.  
  3814. Function InitDlg(Hdlg) 
  3815. ' Init routine for the dialogbox - this is executed before the box is displayed 
  3816. DlgEnableControl(Hdlg, 1, 0)       ' grey the OK button 
  3817. End Function 
  3818.  
  3819. Function ClearBox(Hdlg, id, value) 
  3820. ' hit the Clear button to get here 
  3821. Message("Clear the listbox and enable the OK") 
  3822. DlgEnableControl(Hdlg, 1, 1) 
  3823. DlgClearControl(Hdlg, 9001) 
  3824. Message("Now close the box") 
  3825. DlgClose(Hdlg) 
  3826. End Function 
  3827.  
  3828. DIALOG OpenBox 
  3829. -2134376448   4   71 51 160 90 ""  "" "Listbox Example" 
  3830. 10  10 85  40 9001   1352728579"listbox" ""  0 
  3831. 6   60 40  14 1   1342373889"button"  "OK"   0 
  3832. 54  60 40  14 2   1342373888"button"  "Cancel"  0 
  3833. 99  60 40  14 21  1342373888"button"  "Clear"0 
  3834. END DIALOG 
  3835.  
  3836. See also: 
  3837.  
  3838.     DialogBox 
  3839.     DlgClearControl 
  3840.     DlgEnableControl 
  3841.     DlgGetListBoxCount 
  3842.     DlgGetListBoxLines 
  3843.     DlgHideControl 
  3844.     DlgKeyInterrupt 
  3845.     DlgLimitText 
  3846.     DlgSetCaption 
  3847.  
  3848.  
  3849. ΓòÉΓòÉΓòÉ 81. DlgEnableControl ΓòÉΓòÉΓòÉ
  3850.  
  3851. This function enables or grays the specified control in list boxes, combo 
  3852. boxes, and edit boxes that have been created using the Dialog Editor. 
  3853.  
  3854.  
  3855. Syntax 
  3856. DlgEnableControl(Hdlg, ID, Enable) 
  3857. Hdlg identifies the dialog box handle. 
  3858. ID is the number the Dialog Editor automatically assigns to a control. An edit 
  3859. box can have an ID value from 8000 through 8999. A list box can have an ID 
  3860. value from 9000 through 9499. A combo box can have an ID value from 9500 
  3861. through 9999. 
  3862. Enable is either 0 if you want to gray a specific control, or 1 if you want to 
  3863. return the control to its normal state. 
  3864.  
  3865. Return Value 
  3866.  
  3867. Example 
  3868. Function Main() 
  3869. Mac = GetRunningMacroFile$() 
  3870. DocPath = GetDocPath$() 
  3871. SetDlgCallBack(0, "{Mac}!InitDlg") 
  3872. SetDlgCallBack(21, "{Mac}!ClearBox") 
  3873. FillEdit(9001, "{DocPath}*.sam") 
  3874. Box = DialogBox(".","OpenBox") 
  3875. End Function 
  3876.  
  3877. Function InitDlg(Hdlg) 
  3878. ' Init routine for the dialogbox - this is executed before the box is displayed 
  3879. DlgEnableControl(Hdlg, 1, 0)       ' grey the OK button 
  3880. End Function 
  3881.  
  3882. Function ClearBox(Hdlg, id, value) 
  3883. ' hit the Clear button to get here 
  3884. Message("Clear the listbox and enable the OK") 
  3885. DlgEnableControl(Hdlg, 1, 1) 
  3886. DlgClearControl(Hdlg, 9001) 
  3887. Message("Now close the box") 
  3888. DlgClose(Hdlg) 
  3889. End Function 
  3890.  
  3891. DIALOG OpenBox 
  3892. -2134376448   4   71 51 160 90 ""  "" "Listbox Example" 
  3893. 10  10 85  40 9001   1352728579"listbox" ""  0 
  3894. 6   60 40  14 1   1342373889"button"  "OK"   0 
  3895. 54  60 40  14 2   1342373888"button"  "Cancel"  0 
  3896. 99  60 40  14 21  1342373888"button"  "Clear"0 
  3897. END DIALOG 
  3898.  
  3899. See also: 
  3900.  
  3901.     DialogBox 
  3902.     DlgClearControl 
  3903.     DlgClose 
  3904.     DlgGetListBoxCount 
  3905.     DlgGetListBoxLines 
  3906.     DlgHideControl 
  3907.     DlgKeyInterrupt 
  3908.     DlgLimitText 
  3909.     DlgSetCaption 
  3910.  
  3911.  
  3912. ΓòÉΓòÉΓòÉ 82. DlgGetListBoxCount ΓòÉΓòÉΓòÉ
  3913.  
  3914. This function returns the number of items in the specified list boxes, combo 
  3915. boxes, and edit boxes that have been created using the Dialog Editor. 
  3916.  
  3917.  
  3918. Syntax 
  3919. DlgGetListBoxCoun(Hdlg, ID) 
  3920. Hdlg identifies the dialog box handle. 
  3921. ID is the number the Dialog Editor automatically assigns to a control. An edit 
  3922. box can have an ID value from 8000 through 8999. A list box can have an ID 
  3923. value from 9000 through 9499. A combo box can have an ID value from 9500 
  3924. through 9999. 
  3925.  
  3926. Return Value 
  3927. The number of items in the specified list boxes, combo boxes, and edit boxes. 
  3928.  
  3929. Example 
  3930. Function Main() 
  3931. Mac = GetRunningMacroFile$() 
  3932. Dim Name(3) 
  3933. Name(1) = "Charlie" 
  3934. Name(2) = "Nancy" 
  3935. Name(3) = "David" 
  3936. SetDlgCallBack(21, "{Mac}!GiveInfo") 
  3937. FillEdit(9000, &Name) 
  3938. Box = DialogBox(".","Demo") 
  3939. If Box <>1 
  3940.     ' if cancel then exit the macro 
  3941.     Exit Function 
  3942. Endif 
  3943. End Function 
  3944.  
  3945. Function GiveInfo(Hdlg, id, value) 
  3946. ' hit the info button to get here 
  3947. Count = DlgGetListBoxCount(Hdlg, 9000) 
  3948. Item1 = DlgGetListBoxLine$(Hdlg, 9000, 0)    'index is zero based 
  3949. Message("{Count} items in the listbox, item1 is {item1}") 
  3950. End Function 
  3951.  
  3952. DIALOG Demo 
  3953. -2134376448   4   71 51 160 90 ""  "" "Listbox Example" 
  3954. 10  10 85  40 9000   1352728579"listbox" ""  0 
  3955. 6   60 40  14 1   1342373889"button"  "OK"   0 
  3956. 54  60 40  14 2   1342373888"button"  "Cancel"  0 
  3957. 99  60 40  14 21  1342373888"button"  "Info..." 0 
  3958. END DIALOG 
  3959.  
  3960. See also: 
  3961.  
  3962.     DialogBox 
  3963.     DlgClearControl 
  3964.     DlgClose 
  3965.     DlgEnableControl 
  3966.     DlgGetListBoxLines 
  3967.     DlgHideControl 
  3968.     DlgKeyInterrupt 
  3969.     DlgLimitText 
  3970.     DlgSetCaption 
  3971.  
  3972.  
  3973.  
  3974.  
  3975. ΓòÉΓòÉΓòÉ 83. DlgGetListBoxLines ΓòÉΓòÉΓòÉ
  3976.  
  3977. This function retrieves one entry from the specified list box that has been 
  3978. created using the Dialog Editor. 
  3979.  
  3980.  
  3981. Syntax 
  3982. DlgGetListBoxLines$(hdlg, ID, Index) 
  3983. Hdlg identifies the dialog box handle. 
  3984. ID is the number the Dialog Editor automatically assigns to a control. A list 
  3985. box can have an ID value from 9000 through 9499. 
  3986. Index is the number of the item you want to retrieve. Index is 0 based, so the 
  3987. first item is equal to 0, the second item is equal to one, etc. 
  3988.  
  3989. Return Value 
  3990.  
  3991. Example 
  3992. Function Main() 
  3993. Mac = GetRunningMacroFile$() 
  3994. Dim Name(3) 
  3995. Name(1) = "Charlie" 
  3996. Name(2) = "Nancy" 
  3997. Name(3) = "David" 
  3998. SetDlgCallBack(21, "{Mac}!GiveInfo") 
  3999. FillEdit(9000, &Name) 
  4000. Box = DialogBox(".","Demo") 
  4001. If Box <>1 
  4002.     ' if cancel then exit the macro 
  4003.     Exit Function 
  4004. Endif 
  4005. End Function 
  4006.  
  4007. Function GiveInfo(Hdlg, id, value) 
  4008. ' hit the info button to get here 
  4009. Count = DlgGetListBoxCount(Hdlg, 9000) 
  4010. Item1 = DlgGetListBoxLine$(Hdlg, 9000, 0)    'index is zero based 
  4011. Message("{Count} items in the listbox, item1 is {item1}") 
  4012. End Function 
  4013.  
  4014. DIALOG Demo 
  4015. -2134376448   4   71 51 160 90 ""  "" "Listbox Example" 
  4016. 10  10 85  40 9000   1352728579"listbox" ""  0 
  4017. 6   60 40  14 1   1342373889"button"  "OK"   0 
  4018. 54  60 40  14 2   1342373888"button"  "Cancel"  0 
  4019. 99  60 40  14 21  1342373888"button"  "Info..." 0 
  4020. END DIALOG 
  4021.  
  4022. See also: 
  4023.  
  4024.     DialogBox 
  4025.     DlgClearControl 
  4026.     DlgClose 
  4027.     DlgEnableControl 
  4028.     DlgGetListBoxCount 
  4029.     DlgHideControl 
  4030.     DlgKeyInterrupt 
  4031.     DlgLimitText 
  4032.     DlgSetCaption 
  4033.  
  4034.  
  4035.  
  4036.  
  4037. ΓòÉΓòÉΓòÉ 84. DlgHideControl ΓòÉΓòÉΓòÉ
  4038.  
  4039. This function hides or shows the specified control in list boxes, combo boxes, 
  4040. and edit boxes that have been created using the Dialog Editor. 
  4041.  
  4042.  
  4043. Syntax 
  4044. DlgHideControl(Hdlg, ID, Hide) 
  4045. Hdlg identifies the dialog box handle. 
  4046. ID is the number the Dialog Editor automatically assigns to a control. An edit 
  4047. box can have an ID value from 8000 through 8999. A list box can have an ID 
  4048. value from 9000 through 9499. A combo box can have an ID value from 9500 
  4049. through 9999. 
  4050. Hide is either equal to 1 if you want to hide the control, or 0 if you want to 
  4051. display the control. 
  4052.  
  4053. Return Value 
  4054.  
  4055. Example 
  4056. Function Main() 
  4057. Mac = GetRunningMacroFile$() 
  4058. SetDlgCallBack(21, "{Mac}!Hide") 
  4059. SetDlgCallBack(8000, "{Mac}!InEdit") 
  4060. Box = DialogBox(".","Demo2") 
  4061. End Function 
  4062.  
  4063.  
  4064. Function InEdit(Hdlg, id, value) 
  4065. IgnoreKeyBoard(2)    ' don't allow the keyboard to cancel the macro 
  4066. Text = GetDlgITemText(Hdlg, 8000) 
  4067. DlgSetCaption(Hdlg, text) 
  4068. End Function 
  4069.  
  4070. Function Hide(Hdlg, id, value) 
  4071. DlgHideControl(Hdlg, 8000, 1)  ' hide the editboxk 
  4072. End Function 
  4073.  
  4074.  
  4075. DIALOG Demo2 
  4076. -2134376448   4   95 57 123 58 ""  "" "Editbox Example" 
  4077. 6   36 40  14 1   1342373889"button"  "OK"   0 
  4078. 52  36 44  14 21  1342373888"button"  "Hide editbox"   0 
  4079. 6   17 89  12 8000   1350631552"edit" "" 0 
  4080. 5   5  77  10 1000   1342177280"static"  "Enter some text:"   0 
  4081. END DIALOG 
  4082.  
  4083. See also: 
  4084.  
  4085.     DialogBox 
  4086.     DlgClearControl 
  4087.     DlgClose 
  4088.     DlgEnableControl 
  4089.     DlgGetListBoxCount 
  4090.     DlgGetListBoxLines 
  4091.     DlgKeyInterrupt 
  4092.     DlgLimitText 
  4093.     DlgSetCaption 
  4094.  
  4095.  
  4096.  
  4097. ΓòÉΓòÉΓòÉ 85. DlgKeyInterrupt ΓòÉΓòÉΓòÉ
  4098.  
  4099. This function sets a callback function that is "called" when the user presses 
  4100. the specified key while processing a macro dialog box. It should be used before 
  4101. the DialogBox statement and is in effect during that dialog box only. This 
  4102. function is passed the dialog box handle (HDLG) and the virtual key. 
  4103.  
  4104.  
  4105. Syntax 
  4106. DlgKeyInterrupt(Key, Function) 
  4107. Key is a virtual key, such as [F1] or [PgDown]. The [F1] key should be set if 
  4108. you are using the "AmiDialog" in the Dialog code. This allows you to imitate 
  4109. the help system. 
  4110. Function is the function that is executed when the specified key is pressed. 
  4111. This parameter may contain the macro file name or the function within that file 
  4112. to call. 
  4113.  
  4114. Return Value 
  4115. This function does not return a value. 
  4116.  
  4117. Example 
  4118. FUNCTION Example() 
  4119. ' run the HelpFun function if user hits F1 or Help button 
  4120. DlgKeyInterrupt([F1], "HelpFun") 
  4121. DialogBox(".", "QT") 'read dialog box from this file 
  4122. END FUNCTION 
  4123.  
  4124. FUNCTION HelpFun(hdlg, key) 
  4125. Message("This is help!") 
  4126. END FUNCTION 
  4127.  
  4128. DIALOG QT 
  4129. -2134376448 4 58 44 160 50 "" "AmiDialog" "Key Int Text" 
  4130. FONT 8 "Helv" 
  4131. 112 6 40 14 1 1342373889 "button" "OK" 0 
  4132. 112 24 40 14 2 1342373888 "button" "Cancel" 0 
  4133. 14 8 50 12 20 1342242825 "button" "Radio 1" 0 
  4134. 14 22 50 12 21 1342242825 "button" "Radio 2" 0 
  4135. END DIALOG 
  4136.  
  4137. See also: 
  4138.  
  4139.     DialogBox 
  4140.     DlgClearControl 
  4141.     DlgClose 
  4142.     DlgEnableControl 
  4143.     DlgGetListBoxCount 
  4144.     DlgGetListBoxLines 
  4145.     DlgHideControl 
  4146.     DlgLimitText 
  4147.     DlgSetCaption 
  4148.     KeyInterrupt 
  4149.     MouseInterrupt 
  4150.  
  4151.  
  4152. ΓòÉΓòÉΓòÉ 86. DlgLimitText ΓòÉΓòÉΓòÉ
  4153.  
  4154. This functions limits the length of the text string a user can enter in an edit 
  4155. box that has been created using the Dialog Editor. 
  4156.  
  4157.  
  4158. Syntax 
  4159. DlgLimitText(Hdlg, ID, Length) 
  4160. Hdlg identifies the dialog box handle. 
  4161. ID is the number the Dialog Editor automatically assigns to a control. An edit 
  4162. box can have an ID value from 8000 through 8999. 
  4163. Length is the number of characters the user is allowed to enter in the text 
  4164. string. 
  4165.  
  4166. Return Value 
  4167.  
  4168. Example 
  4169. Function Main() 
  4170. Mac = GetRunningMacroFile$() 
  4171. SetDlgCallBack(0, "{Mac}!InitDlg") 
  4172. Box = DialogBox(".","Demo2") 
  4173. If Box <>1 
  4174.     Exit Function 
  4175. Endif 
  4176. Text = GetDialogField$(8000) 
  4177. Message("User entered {Text}") 
  4178. End Function 
  4179.  
  4180. Function InitDlg(Hdlg) 
  4181. ' impose a text limit on the editbox 
  4182. ' this is executed before the dialog is displayed 
  4183. DlgLimitText(Hdlg, 8000, 12) 
  4184. End Function 
  4185.  
  4186. DIALOG Demo2 
  4187. -2134376448   4   95 57 123 58 ""  "" "Editbox Example" 
  4188. 6   36 40  14 1   1342373889"button"  "OK"   0 
  4189. 52  36 40  14 2   1342373888"button"  "Cancel"  0 
  4190. 6   17 89  12 8000   1350631552"edit" "" 0 
  4191. 5   5  77  10 1000   1342177280"static"  "Enter some text:"   0 
  4192. END DIALOG 
  4193.  
  4194. See also: 
  4195.  
  4196.     DialogBox 
  4197.     DlgClearControl 
  4198.     DlgClose 
  4199.     DlgEnableControl 
  4200.     DlgGetListBoxCount 
  4201.     DlgGetListBoxLines 
  4202.     DlgHideControl 
  4203.     DlgKeyInterrupt 
  4204.     DlgSetCaption 
  4205.  
  4206.  
  4207. ΓòÉΓòÉΓòÉ 87. DlgSetCaption ΓòÉΓòÉΓòÉ
  4208.  
  4209. This functions inserts a title string in a dialog box that has been created 
  4210. using the Dialog Editor. 
  4211.  
  4212.  
  4213. Syntax 
  4214. DlgSetCaption(Hdlg, Caption String) 
  4215. Hdlg identifies the dialog box handle. 
  4216. Caption String is the title string to display in the dialog box. 
  4217.  
  4218. Return Value 
  4219.  
  4220. Example 
  4221. Function Main() 
  4222. Mac = GetRunningMacroFile$() 
  4223. SetDlgCallBack(21, "{Mac}!Hide") 
  4224. SetDlgCallBack(8000, "{Mac}!InEdit") 
  4225. Box = DialogBox(".","Demo2") 
  4226. End Function 
  4227.  
  4228.  
  4229. Function InEdit(Hdlg, id, value) 
  4230. IgnoreKeyBoard(2)    ' don't allow the keyboard to cancel the macro 
  4231. Text = GetDlgITemText(Hdlg, 8000) 
  4232. DlgSetCaption(Hdlg, text) 
  4233. End Function 
  4234.  
  4235. Function Hide(Hdlg, id, value) 
  4236. DlgHideControl(Hdlg, 8000, 1)  ' hide the editboxk 
  4237. End Function 
  4238.  
  4239.  
  4240. DIALOG Demo2 
  4241. -2134376448   4   95 57 123 58 ""  "" "Editbox Example" 
  4242. 6   36 40  14 1   1342373889"button"  "OK"   0 
  4243. 52  36 44  14 21  1342373888"button"  "Hide editbox"   0 
  4244. 6   17 89  12 8000   1350631552"edit" "" 0 
  4245. 5   5  77  10 1000   1342177280"static"  "Enter some text:"   0 
  4246. END DIALOG 
  4247.  
  4248. See also: 
  4249.  
  4250.     DialogBox 
  4251.     DlgClearControl 
  4252.     DlgClose 
  4253.     DlgEnableControl 
  4254.     DlgGetListBoxCount 
  4255.     DlgGetListBoxLines 
  4256.     DlgHideControl 
  4257.     DlgKeyInterrupt 
  4258.     DlgLimitText 
  4259.  
  4260.  
  4261.  
  4262. ΓòÉΓòÉΓòÉ 88. DLLCall ΓòÉΓòÉΓòÉ
  4263.  
  4264. This function verifies that a Dynamic Link Library (DLL) function is available 
  4265. and loads it into memory. DLL functions are extremely powerful tools that 
  4266. provide access to OS/2 functions located in PMWIN.DLL, PMGPI.DLL, DOSCALL1.DLL, 
  4267. and PMPRF.DLL, and to user written functions. DLL functions are for the benefit 
  4268. of experienced programmers. 
  4269.  
  4270.  
  4271. Before using DLL functions, make sure that you know how to use them correctly. 
  4272. If DLL functions are used incorrectly, you may have problems with Ami Pro and 
  4273. OS/2 after their use. 
  4274.  
  4275. The parameter list, if described, must be a string containing letters 
  4276. specifying the variable type of the function's return value. This must be 
  4277. followed by one letter per parameter. 
  4278.  
  4279. Syntax 
  4280. DLLCall(Module, Function, Parameters) 
  4281. Module is the full path name and file name of the DLL. You must have .dll as 
  4282. the file name extension. 
  4283. Function is the ordinal number representing the DLL function to call. You 
  4284. should not use the name of the DLL function because Ami Pro assumes the 16 bit 
  4285. OS/2 1.3 function. The ordinal numbers for PMWIN.DLL, PMGPI.DLL, DOSCALL1.DLL, 
  4286. and PMPRF.DLL are located in the IBM OS/2 Programmer's Toolkit in the bseord.h 
  4287. file. 
  4288. Parameters are the types for the parameters of the function. The first 
  4289. parameter type is the type for the return value. All other parameters are in 
  4290. order for the types of parameters that pass to the function. 
  4291.     A - Boolean integer 
  4292.     B - Far pointer to double 
  4293.     C - Far pointer to string 
  4294.     E - Double 
  4295.     H - Unsigned integer 
  4296.     I - Integer 
  4297.     J - Unsigned long integer 
  4298.     L - Far pointer to word (Word Far *) 
  4299.     M - Far pointer to array or string (CHAR FAR * FAR *) 
  4300.     N - Far pointer to array or words (Word Far *) 
  4301.     O - Far pointer to a long (LONG FAR *) 
  4302. NOTE: You must not use spaces between the commas. 
  4303.  
  4304. Return Value 
  4305. The return value of the DLLCall function defined by the module that is called. 
  4306.  
  4307. Example 
  4308. FUNCTION testdll() 
  4309.                      'call the function WinQueryActiveWindow 
  4310. define GetActive()   DLLCall("e:\os2\dll\pmwin.dll,799,JJ",%1) 
  4311. active=GetActive(1) 
  4312. message("The active window handle is {active}") 
  4313. end function 
  4314.  
  4315. See also: 
  4316.  
  4317.     DLLFreeLib 
  4318.     DLLLoadLib 
  4319.     Exec 
  4320.  
  4321.  
  4322. ΓòÉΓòÉΓòÉ 89. DLLFreeLib ΓòÉΓòÉΓòÉ
  4323.  
  4324. This function unloads the library loaded by the DLLLoadLib function. 
  4325.  
  4326.  
  4327. Syntax 
  4328. DLLFreeLib(LibID) 
  4329. LibID is the ID returned by the DLLLoadLib function. 
  4330.  
  4331. Return Value 
  4332. 1  (TRUE) if the DLL was successfully freed. 
  4333. 0  (FALSE) if the DLL could not be freed. 
  4334.  
  4335. Example 
  4336. FUNCTION Example() 
  4337. Text = Query$("Enter text for window:")  'Get new title bar text 
  4338. hGetActiveWindow = DLLLoadLib("User", "GetActiveWindow", "H") 
  4339. ' Load DLL into memory 
  4340. hWnd = DLLCall(hGetActiveWindow)   'Call for active window handle 
  4341. hSetActiveText = DLLLoadLib("User", "SetWindowText", "IHC") 
  4342. ' Load DLL into memory 
  4343. DLLCall(hSetActiveText, hWnd, Text)   'Call to set title bar text 
  4344. DLLFreeLib(hGetActiveWindow)   'Free DLL 
  4345. DLLFreeLib(hSetActiveText)     'Free DLL 
  4346. END FUNCTION 
  4347.  
  4348. See also: 
  4349.  
  4350.     DLLCall 
  4351.     DLLLoadLib 
  4352.  
  4353.  
  4354. ΓòÉΓòÉΓòÉ 90. DLLLoadLib ΓòÉΓòÉΓòÉ
  4355.  
  4356. This function is used to verify that a Dynamic Link Library (DLL) function is 
  4357. available. It is also used to load DLL functions into memory so that they can 
  4358. be used later. Any DLL function can be used in your macro. The parameter list, 
  4359. if described, must be a string containing letters specifying the variable type 
  4360. of the function's return value. This must be followed by one letter per 
  4361. parameter. DLL functions located in PMWIN, PMGPI, PMPRF, and DOSCALL1 must be 
  4362. loaded. 
  4363.  
  4364.  
  4365. DLL functions are extremely powerful tools that provide access to OS/2 
  4366. functions and to specially written functions. They are for the benefit of 
  4367. experienced programmers. 
  4368.  
  4369. Before using these functions, make sure that you know how to use them 
  4370. correctly. If they are used incorrectly, you may have problems with Ami Pro and 
  4371. OS/2 after their use. 
  4372.  
  4373. Syntax 
  4374. DLLLoadLib(Module, Function, Parameters) 
  4375. Module  is the full path name and file name of the DLL. You must have .dll as 
  4376. the file name extension. 
  4377. Function is the name of the function within the DLL module to be accessed. 
  4378. Parameters is a string with the prototype parameters and return code for the 
  4379. function. 
  4380. These parameters are passed to the function when it is called. The letter codes 
  4381. for variable types are: 
  4382.     A - Boolean integer 
  4383.     B - Far pointer to double 
  4384.     C - Far pointer to string 
  4385.     E - Double 
  4386.     H - Unsigned integer 
  4387.     I - Integer 
  4388.     J - Unsigned long integer 
  4389.     L - Far pointer to word (Word Far *) 
  4390.     M - Far pointer to array or string (CHAR FAR * FAR *) 
  4391.     N - Far pointer to array or words (Word Far *) 
  4392.     O - Far pointer to a long (LONG FAR *) 
  4393.  
  4394. Return Value 
  4395. 1  (TRUE) if the DLL was successfully loaded. 
  4396. 0  (FALSE) if the DLL could not be loaded or could not be found. 
  4397.  
  4398. Example 
  4399. FUNCTION Example() 
  4400. Text = Query$("Enter text for window:")  'Get new title bar text 
  4401. hGetActiveWindow = DLLLoadLib("User", "GetActiveWindow", "H") 
  4402. ' Load DLL into memory 
  4403. hWnd = DLLCall(hGetActiveWindow)   'Call for active window handle 
  4404. hSetActiveText = DLLLoadLib("User", "SetWindowText", "IHC") 
  4405. ' Load DLL into memory 
  4406. DLLCall(hSetActiveText, hWnd, Text)   'Call to set title bar text 
  4407. DLLFreeLib(hGetActiveWindow)   'Free DLL 
  4408. DLLFreeLib(hSetActiveText)     'Free DLL 
  4409. END FUNCTION 
  4410.  
  4411. See also: 
  4412.  
  4413.     DLLCall 
  4414.     DLLFreeLib 
  4415.  
  4416.  
  4417. ΓòÉΓòÉΓòÉ 91. DocInfo ΓòÉΓòÉΓòÉ
  4418.  
  4419. This function enters new values in the current document's Document Info. This 
  4420. function is equivalent to choosing File Doc Info. The DocInfo function does not 
  4421. allow the user to examine the system fields in the document information, nor 
  4422. does it allow the macro to determine their values. 
  4423.  
  4424.  
  4425. Syntax 
  4426. DocInfo(Description, Keyword, Flag) 
  4427. Description is the text that replaces the contents of the Description field in 
  4428. the document description. 
  4429. Keyword is the text that replaces the contents of the Keyword field in the 
  4430. document description. 
  4431. Flag indicates whether or not a document is locked. It also indicates whether a 
  4432. frame macro should be executed when the user clicks on a frame. It is one of 
  4433. the following values: 
  4434.     DocResetFlag (0) - Do not lock the document and do not run frame macros 
  4435.     DocRunMacro (1) - Run frame macros 
  4436.     DocLock (2) - Lock for annotations (not available in OS/2) 
  4437.     DocRevLock (4) - Lock revision marking on 
  4438. Lock does not take effect until the document is saved. The notes functions 
  4439. available are editing, inserting, and deleting. 
  4440.  
  4441. To display the Document Info dialog box and allow the user to examine and fill 
  4442. out the document description: DocInfo 
  4443.  
  4444. Return Value 
  4445. 1  (TRUE) if the new document info fields were saved. 
  4446. 0  (UserCancel) if the user canceled the function. 
  4447.  
  4448. Example 
  4449. FUNCTION Example() 
  4450. descrip = "This is my doc description" 
  4451. keywords = "macro, docinfo" 
  4452. flag = DocRunMacro + DocLock 
  4453. DocInfo(descrip, keywords, flag) 
  4454. END FUNCTION 
  4455.  
  4456. See also: 
  4457.  
  4458.     DocInfoFields 
  4459.     GetDocInfo$ 
  4460.     InsertDocInfoField 
  4461.     InsertDocInfo 
  4462.     RenameDocInfoField 
  4463.  
  4464.  
  4465.  
  4466. ΓòÉΓòÉΓòÉ 92. DocInfoFields ΓòÉΓòÉΓòÉ
  4467.  
  4468. This function replaces the contents of the text in a user field. The user 
  4469. fields are located in the document information. This function is equivalent to 
  4470. choosing File Doc Info and choosing Fields. 
  4471.  
  4472.  
  4473. Syntax 
  4474. DocInfoFields(Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8) 
  4475. field1  is the text that replaces the contents of user field 1. 
  4476. field2  is the text that replaces the contents of user field 2. 
  4477. field3  is the text that replaces the contents of user field 3. 
  4478. field4  is the text that replaces the contents of user field 4. 
  4479. field5  is the text that replaces the contents of user field 5. 
  4480. field6  is the text that replaces the contents of user field 6. 
  4481. field7  is the text that replaces the contents of user field 7. 
  4482. field8  is the text that replaces the contents of user field 8. 
  4483.  
  4484. Return Value 
  4485. 1  (TRUE) if the info fields were successfully changed. 
  4486. 0  (UserCancel) if the user canceled the function. 
  4487. -2  (GeneralFailure) if the info fields were not changed. 
  4488.  
  4489. Example 
  4490. FUNCTION Example() 
  4491. Dim Field(8) 
  4492. For t = 1 to 8 
  4493.     Field(t) = Query$("Enter information for field({t})") 
  4494. Next 
  4495. DocInfoFields(Field(1), Field(2), Field(3), Field(4), Field(5), Field(6), 
  4496. Field(7), Field(8)) 
  4497. END FUNCTION 
  4498.  
  4499. See also: 
  4500.  
  4501.     DocInfo 
  4502.     GetDocInfo$ 
  4503.     InsertDocInfoField 
  4504.     InsertDocInfo 
  4505.     RenameDocInfoField 
  4506.  
  4507.  
  4508.  
  4509. ΓòÉΓòÉΓòÉ 93. DOSchdir ΓòÉΓòÉΓòÉ
  4510.  
  4511. This function makes the parameter the current DOS directory. This function does 
  4512. not change the drive. 
  4513.  
  4514.  
  4515. Syntax 
  4516. DOSchdir(Dir) 
  4517. Dir is the path you wish to make the current directory. 
  4518.  
  4519. Return Value 
  4520. 0  if the directory was successfully changed. 
  4521. -1  if the directory could not be changed or does not exist. 
  4522.  
  4523. Example 
  4524. FUNCTION Example() 
  4525. Dir = Query$("What directory do you want to change to?") 
  4526. IF -1 = DOSchdir(Dir) 
  4527.     Message("Could not change to {Dir}") 
  4528. ENDIF 
  4529. NewDir = GetCurrentDir$() 
  4530. Message("The current directory reported by DOS is: {NewDir}") 
  4531. END FUNCTION 
  4532.  
  4533. See also: 
  4534.  
  4535.     DOSCopyFile 
  4536.     DOSDelFile 
  4537.     DOSGetEnv$ 
  4538.     DOSGetFileAttr 
  4539.     DOSmkdir 
  4540.     DOSRename 
  4541.     DOSrmdir 
  4542.     DOSSetFileAttr 
  4543.     FileManagement 
  4544.  
  4545.  
  4546. ΓòÉΓòÉΓòÉ 94. DOSCopyFile ΓòÉΓòÉΓòÉ
  4547.  
  4548. This function copies an existing file. 
  4549.  
  4550.  
  4551. Syntax 
  4552. DOSCopyFile(OldFile, NewFile) 
  4553. OldFile is the name of the file to be copied. Use the path if the file to be 
  4554. copied is not in the current directory. 
  4555. NewFile is the name to which the file is being copied. Use the path if you do 
  4556. not want the file copied to the current working directory. 
  4557.  
  4558. Return Value 
  4559. 1  (TRUE) if the file was successfully copied. 
  4560. 0  (FALSE) if the file was not copied. 
  4561.  
  4562. Example 
  4563. FUNCTION Example() 
  4564. OpenFile = GetOpenFileName$() ' get the open file name including path 
  4565. Backupfile = "C:\curfile.bak" 
  4566. DOSCopyFile(OpenFile, Backupfile) ' make a backup copy of the open file 
  4567. DOSDelFile(Backupfile) ' delete the back up file 
  4568. END FUNCTION 
  4569.  
  4570. See also: 
  4571.  
  4572.     DOSchdir 
  4573.     DOSDelFile 
  4574.     DOSGetEnv$ 
  4575.     DOSGetFileAttr 
  4576.     DOSmkdir 
  4577.     DOSRename 
  4578.     DOSrmdir 
  4579.     DOSSetFileAttr 
  4580.     FileManagement 
  4581.  
  4582.  
  4583. ΓòÉΓòÉΓòÉ 95. DOSDelFile ΓòÉΓòÉΓòÉ
  4584.  
  4585. This function deletes an existing file. 
  4586.  
  4587.  
  4588. Syntax 
  4589. DOSDelFile(FileName) 
  4590. FileName is the name of the file to be deleted. If the file is not in the 
  4591. current directory, the path must be used. 
  4592.  
  4593. Return Value 
  4594. 0  if the file was deleted. 
  4595. -1 (NotFound) if the file was not deleted. 
  4596.  
  4597. Example 
  4598. FUNCTION Example() 
  4599. OpenFile = GetOpenFileName$() ' get the open file name including path 
  4600. Backupfile = "C:\curfile.bak" 
  4601. DOSCopyFile(OpenFile, Backupfile) ' make a backup copy of the open file 
  4602. DOSDelFile(Backupfile) ' delete the back up file 
  4603. END FUNCTION 
  4604.  
  4605. See also: 
  4606.  
  4607.     DOSchdir 
  4608.     DOSCopyFile 
  4609.     DOSGetEnv$ 
  4610.     DOSGetFileAttr 
  4611.     DOSmkdir 
  4612.     DOSRename 
  4613.     DOSrmdir 
  4614.     DOSSetFileAttr 
  4615.     FileManagement 
  4616.  
  4617.  
  4618.  
  4619.  
  4620. ΓòÉΓòÉΓòÉ 96. DOSGetEnv ΓòÉΓòÉΓòÉ
  4621.  
  4622. This function searches the DOS environment for the passed variable. 
  4623.  
  4624.  
  4625. Syntax 
  4626. DOSGetEnv$(Var) 
  4627. Var is the name of the environment variable to search for. 
  4628.  
  4629. Return Value 
  4630. The information stored in the environment variable if the variable is found. 
  4631. The null string ("") if the variable is not found. 
  4632.  
  4633. Example 
  4634. FUNCTION Example() 
  4635. Var = "Path" 
  4636. Path = DosGetEnv$(Var) 
  4637. Message(Path) 
  4638. END FUNCTION 
  4639.  
  4640. See also: 
  4641.  
  4642.     DOSchdir 
  4643.     DOSCopyFile 
  4644.     DOSDelFile 
  4645.     DOSGetFileAttr 
  4646.     DOSmkdir 
  4647.     DOSRename 
  4648.     DOSrmdir 
  4649.     DOSSetFileAttr 
  4650.     FileManagement 
  4651.  
  4652.  
  4653. ΓòÉΓòÉΓòÉ 97. DOSGetFileAttr ΓòÉΓòÉΓòÉ
  4654.  
  4655. This function returns the attributes for a specified file. 
  4656.  
  4657.  
  4658. Syntax 
  4659. DOSGetFileAttr(FileName) 
  4660. FileName is the name of the file for which the attributes are determined. If 
  4661. the file is not in the current directory, the path must be used. 
  4662.  
  4663. Return Value 
  4664. A bit number corresponding to the attributes for the specified file. The bit 
  4665. values that a file can have are: 
  4666.     1 - Read-only 
  4667.     2 - Hidden 
  4668.     4 - System 
  4669.     8 - Volume ID 
  4670.     16 - Subdirectory 
  4671.     32 - Archive 
  4672. These bit numbers are added together if more than one attribute is set for that 
  4673. file. Use the binary operator OR (|) or AND (&) to extract them. 
  4674. -1  if the attributes could not be found 
  4675.  
  4676. Example 
  4677. FUNCTION Main() 
  4678. Filledit(9001,"*.*") 
  4679. Box = DialogBox(".","GetAttrib") 
  4680. IF Box<>1 
  4681.     EXIT FUNCTION 
  4682. ENDIF 
  4683. Dir = GetCurrentDir$() 
  4684. Name = GetdialogField$(9001) 
  4685. FileName = StrCat$(Dir,Name) 
  4686. Attrib = DosGetFileAttr(Name) 
  4687. Message("{Name} is set as {Attrib}") 
  4688. END FUNCTION 
  4689.  
  4690. DIALOG GetAttrib 
  4691. -2134376448 4 90 34 110 85 "" "" "Get File Attributes" 
  4692. FONT 8 "HELV" 
  4693. 4 14 52 64 9001 1352728579 "listbox" "" 0 
  4694. 5 3 53 10 7999 1342177280 "static" "" 0 
  4695. 65 5 40 14 1 1342373889 "button" "OK" 0 
  4696. 65 22 40 14 2 1342373888 "button" "Cancel" 0 
  4697. END DIALOG 
  4698.  
  4699.  
  4700. See also: 
  4701.  
  4702.     DOSchdir 
  4703.     DOSCopyFile 
  4704.     DOSDelFile 
  4705.     DOSGetEnv$ 
  4706.     DOSmkdir 
  4707.     DOSRename 
  4708.     DOSrmdir 
  4709.     DOSSetFileAttr 
  4710.     FileManagement 
  4711.  
  4712.  
  4713. ΓòÉΓòÉΓòÉ 98. DOSmkdir ΓòÉΓòÉΓòÉ
  4714.  
  4715. This function creates a directory. 
  4716.  
  4717.  
  4718. Syntax 
  4719. DOSmkdir(Dir) 
  4720. Dir is the name of the directory to be created. 
  4721.  
  4722. Return Value 
  4723. 0  if the directory was created. 
  4724. -1  if the directory could not be created. 
  4725.  
  4726. Example 
  4727. FUNCTION Example() 
  4728. Dir = Query$("What is the name of the new directory?") 
  4729. IF -1 = DOSmkdir(Dir) 
  4730.     Message("Could not create directory {Dir}") 
  4731. ELSE 
  4732.     Message("Directory {Dir} created.") 
  4733. ENDIF 
  4734. END FUNCTION 
  4735.  
  4736. See also: 
  4737.  
  4738.     DOSchdir 
  4739.     DOSCopyFile 
  4740.     DOSDelFile 
  4741.     DOSGetEnv$ 
  4742.     DOSGetFileAttr 
  4743.     DOSRename 
  4744.     DOSrmdir 
  4745.     DOSSetFileAttr 
  4746.     FileManagement 
  4747.  
  4748.  
  4749. ΓòÉΓòÉΓòÉ 99. DOSRename ΓòÉΓòÉΓòÉ
  4750.  
  4751. This function renames an existing file. 
  4752.  
  4753.  
  4754. Syntax 
  4755. DOSRename(OldName, NewName) 
  4756. OldName is the name of the file to be renamed. If the file is not in the 
  4757. current directory, the path must be used. 
  4758. NewName is the name to which the file is being renamed. If you do not want this 
  4759. file to be placed in the current directory, the path must be used. 
  4760. The NewName file name must not exist in the specified directory. 
  4761.  
  4762. Return Value 
  4763. 0  if the file was renamed. 
  4764. Non zero number if the file could not be renamed or if the specified new file 
  4765. name exists. 
  4766.  
  4767. Example 
  4768. FUNCTION Example() 
  4769. Filename = Query$("What file (with path) do you want to perform an action on?") 
  4770. IF Decide("Do you want to Copy {Filename}?") 
  4771.     Filename2 = Query$("What file do you want to copy {Filename} to?") 
  4772.     IF 0 = DOSCopyFile(Filename, Filename2) 
  4773.        Message("Could not copy {Filename} to {Filename2}") 
  4774.     ENDIF 
  4775. ELSEIF Decide("Do you want to Rename {Filename}?") 
  4776.     Filename2 = Query$("What is the new name for {Filename}?") 
  4777.     IF 0 != DOSRename(Filename, Filename2) 
  4778.        Message("Could not rename {Filename} as {Filename2}") 
  4779.     ENDIF 
  4780. ELSEIF Decide("Do you want to Delete {Filename}?") 
  4781.     IF Decide("Are you SURE you want to Delete {Filename}?") 
  4782.        IF -1 = DOSDelFile(Filename) 
  4783.        Message("Could not delete {Filename}") 
  4784.        ENDIF 
  4785.     ENDIF 
  4786. ENDIF 
  4787. END FUNCTION 
  4788.  
  4789. See also: 
  4790.  
  4791.     DOSchdir 
  4792.     DOSCopyFile 
  4793.     DOSDelFile 
  4794.     DOSGetEnv$ 
  4795.     DOSGetFileAttr 
  4796.     DOSmkdir 
  4797.     DOSrmdir 
  4798.     DOSSetFileAttr 
  4799.     FileManagement 
  4800.  
  4801.  
  4802. ΓòÉΓòÉΓòÉ 100. DOSrmdir ΓòÉΓòÉΓòÉ
  4803.  
  4804. This function removes an existing directory. 
  4805.  
  4806.  
  4807. Syntax 
  4808. DOSrmdir(Dir) 
  4809. Dir is the name of the existing directory to be removed. 
  4810. The directory must be empty and cannot be the current working directory or the 
  4811. root directory. 
  4812.  
  4813. Return Value 
  4814. 0  if the directory was successfully removed. 
  4815. -1  if the directory could not be removed. 
  4816.  
  4817. Example 
  4818. FUNCTION Example() 
  4819. Dir = Query$("What is the name of the directory you want to delete?") 
  4820. IF Decide("Are you SURE you want to delete {Dir}?") 
  4821.     IF -1 = DOSrmdir(Dir) 
  4822.        Message("Could not remove {Dir}. The directory may not be empty.") 
  4823.     ELSE 
  4824.        Message("The directory {Dir} has been removed.") 
  4825.     ENDIF 
  4826. ENDIF 
  4827. END FUNCTION 
  4828.  
  4829. See also: 
  4830.  
  4831.     DOSchdir 
  4832.     DOSCopyFile 
  4833.     DOSDelFile 
  4834.     DOSGetEnv$ 
  4835.     DOSGetFileAttr 
  4836.     DOSmkdir 
  4837.     DOSRename 
  4838.     DOSSetFileAttr 
  4839.     FileManagement 
  4840.  
  4841.  
  4842. ΓòÉΓòÉΓòÉ 101. DOSSetFileAttr ΓòÉΓòÉΓòÉ
  4843.  
  4844. This function sets the attribute bits for an existing file. 
  4845.  
  4846.  
  4847. Syntax 
  4848. DOSSetFileAttr(FileName, Attr) 
  4849. FileName is the name of the file for which the attribute bits are to be set. If 
  4850. the file is not in the current directory, the path must be used. 
  4851. Attr is the number of the attribute to be set. The bit values that a file can 
  4852. have are: 
  4853.     1 - Read-only 
  4854.     2 - Hidden 
  4855.     4 - System 
  4856.     8 - Volume ID 
  4857.     16 - Subdirectory 
  4858.     32 - Archive 
  4859. To set more than one attribute, add the bit values for the attributes you want 
  4860. to set and use that number. 
  4861.  
  4862. Return Value 
  4863. 0  if the attributes were successfully set. 
  4864.  
  4865. Example 
  4866. FUNCTION Example() 
  4867. Filledit(9001,"*.*") 
  4868. Box = DialogBox(".","GetAttrib") 
  4869. IF Box<>1 
  4870.     Exit Function 
  4871. ENDIF 
  4872. Dir = GetCurrentDir$() 
  4873. Name = GetdialogField$(9001) 
  4874. FileName = StrCat$(Dir,Name) 
  4875. IF 0 = DosSetFileAttr(Name,1) 
  4876.     Message("{Name} is set as Read-Only") 
  4877. ENDIF 
  4878. END FUNCTION 
  4879.  
  4880. DIALOG GetAttrib 
  4881. -2134376448 4 90 34 110 85 "" "" "Get File Attributes" 
  4882. FONT 8 "HELV" 
  4883. 4 14 52 64 9001 1352728579 "listbox" "" 0 
  4884. 5 3 53 10 7999 1342177280 "static" "" 0 
  4885. 65 5 40 14 1 1342373889 "button" "OK" 0 
  4886. 65 22 40 14 2 1342373888 "button" "Cancel" 0 
  4887. END DIALOG 
  4888.  
  4889. See also: 
  4890.  
  4891.     DOSchdir 
  4892.     DOSCopyFile 
  4893.     DOSDelFile 
  4894.     DOSGetEnv$ 
  4895.     DOSGetFileAttr 
  4896.     DOSmkdir 
  4897.     DOSRename 
  4898.     DOSrmdir 
  4899.     FileManagement 
  4900.  
  4901.  
  4902. ΓòÉΓòÉΓòÉ 102. DraftMode ΓòÉΓòÉΓòÉ
  4903.  
  4904. This function changes the current document in Ami Pro from Layout Mode or 
  4905. Outline Mode to Draft Mode. This function is equivalent to choosing View Draft 
  4906. Mode. 
  4907.  
  4908.  
  4909. Syntax 
  4910. DraftMode() 
  4911.  
  4912. Return Value 
  4913. 1  (TRUE) if the  view  mode was changed. 
  4914. 0  (NoAction) if no action was taken because the document was already in Draft 
  4915. Mode. 
  4916.  
  4917. Example 
  4918. FUNCTION Example() 
  4919. DraftMode() 
  4920. Mode = GetMode() 
  4921. Message("Mode = {Mode}") 
  4922. END FUNCTION 
  4923.  
  4924. See also: 
  4925.  
  4926.     EnlargedView 
  4927.     FacingView 
  4928.     FullPageView 
  4929.     GetMode 
  4930.     GetViewLevel 
  4931.     LayoutMode 
  4932.     OutlineMode 
  4933.     StandardView 
  4934.  
  4935.  
  4936. ΓòÉΓòÉΓòÉ 103. EditFormula ΓòÉΓòÉΓòÉ
  4937.  
  4938. This function displays the  edit formula dialog box. This function is 
  4939. equivalent to choosing Table Edit Formula. This function does not automatically 
  4940. allow a macro to insert a formula into a cell. To insert a formula 
  4941. automatically, use the SetFormula function. 
  4942.  
  4943.  
  4944. Syntax 
  4945. EditFormula() 
  4946.  
  4947. Return Value 
  4948. 1  (TRUE) if the dialog box is displayed. 
  4949. 0  (UserCancel) if the user canceled the function. 
  4950.  
  4951. Example 
  4952. FUNCTION Example() 
  4953. OnKey([CtrlAlte], EditFormula, 0) 
  4954. Message("Press Ctrl+Alt+E to edit the formula in a table cell") 
  4955. END FUNCTION 
  4956.  
  4957. See also: 
  4958.  
  4959.     SetFormula 
  4960.  
  4961.  
  4962. ΓòÉΓòÉΓòÉ 104. ElevatorLeftRight ΓòÉΓòÉΓòÉ
  4963.  
  4964. This function scrolls the document to a new position in the file without moving 
  4965. the insertion point. This function is equivalent to dragging the slider box on 
  4966. the horizontal scroll bar left or right. 
  4967.  
  4968.  
  4969. This function may be used only through macro keystroke record. 
  4970.  
  4971. The parameter for this function is generated by OS/2 and can not be selected 
  4972. from a list of values. 
  4973.  
  4974. Syntax 
  4975. ElevatorLeftRight() 
  4976.  
  4977. Return Value 
  4978. This function does not return a value. 
  4979.  
  4980. Example 
  4981. FUNCTION Example() 
  4982. ElevatorLeftRight 
  4983. END FUNCTION 
  4984.  
  4985. See also: 
  4986.  
  4987.     CharLeft 
  4988.     CharRight 
  4989.     ElevatorUpDown 
  4990.     EndOfFile 
  4991.     LeftEdge 
  4992.     LineDown 
  4993.     LineUp 
  4994.     RightEdge 
  4995.     ScreenDown 
  4996.     ScreenLeft 
  4997.     ScreenRight 
  4998.     ScreenUp 
  4999.     TopOfFile 
  5000.  
  5001.  
  5002. ΓòÉΓòÉΓòÉ 105. ElevatorUpDown ΓòÉΓòÉΓòÉ
  5003.  
  5004. This function scrolls the document to a new position in the file without moving 
  5005. the insertion point. This function is equivalent to dragging the slider box on 
  5006. the vertical scroll bar up or down. 
  5007.  
  5008.  
  5009. This function may be used only through macro keystroke record. 
  5010.  
  5011. The parameter for this function is generated by OS/2 and can not be selected 
  5012. from a list of values. 
  5013.  
  5014. Syntax 
  5015. ElevatorUpDown() 
  5016.  
  5017. Return Value 
  5018. 1  (TRUE) if the document was able to scroll. 
  5019. -2  (GeneralFailure) if the document could not be scrolled. 
  5020.  
  5021. Example 
  5022. FUNCTION Example() 
  5023. ElevatorUpDown 
  5024. END FUNCTION 
  5025.  
  5026. See also: 
  5027.  
  5028.     CharLeft 
  5029.     CharRight 
  5030.     ElevatorLeftRight 
  5031.     EndOfFile 
  5032.     LeftEdge 
  5033.     LineDown 
  5034.     LineUp 
  5035.     RightEdge 
  5036.     ScreenDown 
  5037.     ScreenLeft 
  5038.     ScreenRight 
  5039.     ScreenUp 
  5040.     TopOfFile 
  5041.  
  5042.  
  5043. ΓòÉΓòÉΓòÉ 106. EndOfFile ΓòÉΓòÉΓòÉ
  5044.  
  5045. This function scrolls the document to the end of the file without moving the 
  5046. insertion point. This function is equivalent to dragging the slider box on the 
  5047. vertical scroll bar to the extreme bottom. 
  5048.  
  5049.  
  5050. Syntax 
  5051. EndOfFile() 
  5052.  
  5053. Return Value 
  5054. 1  (TRUE) if the document was able to scroll. 
  5055. -2  (GeneralFailure) if the document could not be scrolled. 
  5056.  
  5057. Example 
  5058. FUNCTION Example() 
  5059. Action = Query$("Move to (T)op of file, or (E)nd of file?") 
  5060. Action = UCASE$(Left$(Action, 1)) 
  5061. SWITCH Action 
  5062. CASE "T" 
  5063. message(TopOfFile()) 
  5064. CASE "E" 
  5065. message(EndOfFile()) 
  5066. default 
  5067. Message("""T"" or ""E"" will do just fine, please.") 
  5068. ENDSWITCH 
  5069. END FUNCTION 
  5070.  
  5071. See also: 
  5072.  
  5073.     CharLeft 
  5074.     CharRight 
  5075.     LeftEdge 
  5076.     LineDown 
  5077.     LineUp 
  5078.     RightEdge 
  5079.     ScreenDown 
  5080.     ScreenLeft 
  5081.     ScreenRight 
  5082.     ScreenUp 
  5083.     TopOfFile 
  5084.  
  5085.  
  5086. ΓòÉΓòÉΓòÉ 107. EnlargedView ΓòÉΓòÉΓòÉ
  5087.  
  5088. This function changes the current view level to  enlarged view. This function 
  5089. is equivalent to choosing View Enlarged View. 
  5090.  
  5091.  
  5092. Syntax 
  5093. EnlargedView() 
  5094.  
  5095. Return Value 
  5096. This function returns 1. 
  5097.  
  5098. Example 
  5099. FUNCTION Example() 
  5100. Message("Now switching to Enlarged View") 
  5101. EnlargedView() 
  5102. END FUNCTION 
  5103.  
  5104. See also: 
  5105.  
  5106.     AddFrame 
  5107.     AddFrameDLG 
  5108.     CustomView 
  5109.     FacingView 
  5110.     FullPageView 
  5111.     GetViewLevel 
  5112.     LayoutMode 
  5113.     StandardView 
  5114.  
  5115.  
  5116.  
  5117. ΓòÉΓòÉΓòÉ 108. Equations ΓòÉΓòÉΓòÉ
  5118.  
  5119. This function changes to equation mode. This function is equivalent to choosing 
  5120. Tools Equations. If a frame is selected, it is used. If no frame is selected, 
  5121. one is created. 
  5122.  
  5123.  
  5124. This function does not automatically enter equations. 
  5125.  
  5126. A macro must be edited to insert this non-recordable function. 
  5127.  
  5128. Syntax 
  5129. Equations() 
  5130.  
  5131. Return Value 
  5132. 1  (TRUE) if the equations mode was initiated. 
  5133. -2  (GeneralFailure) if the mode could not be initiated. 
  5134.  
  5135. Example 
  5136. FUNCTION Example() 
  5137. OnKey([Ctrlshifte], Equations, 0) 
  5138. Message("Press Ctrl+Shift+E to activate the equation editor.") 
  5139. END FUNCTION 
  5140.  
  5141. See also: 
  5142.  
  5143.     AddFrame 
  5144.     AddFrameDLG 
  5145.     OnKey 
  5146.  
  5147.  
  5148. ΓòÉΓòÉΓòÉ 109. EvalField ΓòÉΓòÉΓòÉ
  5149.  
  5150. This function passes a power field to the field manager for evaluation and then 
  5151. returns the result. 
  5152.  
  5153.  
  5154. Syntax 
  5155. EvalField(Field) 
  5156. Field is the power field you wish to evaluate. 
  5157.  
  5158. Return Value 
  5159. The result of the specified power field. 
  5160.  
  5161. Example 
  5162. FUNCTION Example() 
  5163. NumberOfPages = EvalField("NumPages") 
  5164. IF NumberOfPages > 1 'make plural 
  5165.     Adv = "are" 
  5166.     s = "s" 
  5167. ELSE              'make singular 
  5168.     Adv = "is" 
  5169.     s = "" 
  5170. ENDIF 
  5171. Message("There {Adv} {NumberOfPages} page{s} in this document.") 
  5172. END FUNCTION 
  5173.  
  5174. See also: 
  5175.  
  5176.     FieldAdd 
  5177.     FieldAuto 
  5178.     FieldCommand 
  5179.     FieldEvaluate 
  5180.     FieldLock 
  5181.     FieldNext 
  5182.     FieldPrev 
  5183.     FieldRemove 
  5184.     FieldToggleDisplay 
  5185.     FieldUpdateAll 
  5186.     FieldUpdate 
  5187.  
  5188.  
  5189. ΓòÉΓòÉΓòÉ 110. Exec ΓòÉΓòÉΓòÉ
  5190.  
  5191. This function executes a program. This function uses OS/2 to start the new 
  5192. program. This function is equivalent to typing the application's name at an 
  5193. OS/2 command prompt. 
  5194.  
  5195.  
  5196. Syntax 
  5197. Exec(App, Parameters[, State]) 
  5198. App is the name of the program, including extension, which should be executed. 
  5199. If the desired program has any parameters, they should be passed in Parameters. 
  5200. If the file to be executed is not in the path, you must supply the path. If the 
  5201. program has no parameters, a null string("") must be used. 
  5202. State is a number corresponding to the state that the window (if it is a OS/2 
  5203. application) should be displayed. This parameter can be one of the following: 
  5204.     1 - Exec and show the window normally 
  5205.     2 - Exec the program minimized 
  5206.     3 - Exec the program maximized 
  5207.  
  5208. Return Value 
  5209. A positive number greater than 32 if the program was executed successfully. 
  5210. If the program fails to execute, OS/2 returns one of the following error codes: 
  5211.     0 - An application parameter was invalid 
  5212.     1 - OS/2 could not recognize this type of program - check your App name 
  5213.     2 - OS/2 error, OS/2 could not exec program 
  5214.     3 - other OS/2 error 
  5215.     4 - OS/2 error occured making a DOS call 
  5216.  
  5217. Example 
  5218. FUNCTION Example() 
  5219. if appisrunning("E.EXE") 
  5220.     ActivateApp("E.EXE") 
  5221. else 
  5222.     Exec("E.EXE", "", 1) 
  5223. endif 
  5224. END FUNCTION 
  5225.  
  5226. See also: 
  5227.  
  5228.     ActivateApp 
  5229.     Appclose 
  5230.     AppGetAppCount 
  5231.     AppGetAppNames 
  5232.     AppGetWindowPos 
  5233.     AppHide 
  5234.     AppIsRunning 
  5235.     AppMaximize 
  5236.     AppMinimize 
  5237.     AppMove 
  5238.     AppRestore 
  5239.     AppSendMessage 
  5240.     AppSize 
  5241.     DDEExecute 
  5242.     DDEInitiate 
  5243.     GetMacPath$ 
  5244.  
  5245.  
  5246.  
  5247.  
  5248.  
  5249. ΓòÉΓòÉΓòÉ 111. FacingView ΓòÉΓòÉΓòÉ
  5250.  
  5251. This function changes the current view level to  facing pages View. This 
  5252. function is equivalent to choosing View Facing Pages. You can use the GetMode 
  5253. function to determine the current view mode. 
  5254.  
  5255.  
  5256. You must be in Layout Mode to call this funtion. 
  5257.  
  5258. Syntax 
  5259. FacingView() 
  5260.  
  5261. Return Value 
  5262. This function returns 1. 
  5263.  
  5264. Example 
  5265. FUNCTION Example() 
  5266. Mode = GetMode() 
  5267. IF Mode != 1 
  5268.     ' change to layout mode if not there 
  5269.     LayoutMode() 
  5270. ENDIF 
  5271. FacingView() 
  5272. END FUNCTION 
  5273.  
  5274. See also: 
  5275.  
  5276.     CustomView 
  5277.     EnlargedView 
  5278.     FullPageView 
  5279.     GetMode 
  5280.     GetViewLevel 
  5281.     LayoutMode 
  5282.     StandardView 
  5283.  
  5284.  
  5285.  
  5286.  
  5287. ΓòÉΓòÉΓòÉ 112. FastFormat ΓòÉΓòÉΓòÉ
  5288.  
  5289. This function extracts text formatting information from selected text and then 
  5290. applies that formatting to other main document text, table text, or text in a 
  5291. frame. Text formatting is any typeface, point size, color, attribute (bold, 
  5292. italic, underline, word underline), capitalization, or special effects. This 
  5293. function enables Fast Format if it is not enabled or disables it if it is 
  5294. enabled. This function is equivalent to choosing Text Fast Format. 
  5295.  
  5296.  
  5297. This function can be used to load the text formatting for use with the 
  5298. ApplyFormat function. 
  5299.  
  5300. Syntax 
  5301. FastFormat() 
  5302.  
  5303. Return Value 
  5304. This function returns 1. 
  5305.  
  5306. Example 
  5307. FUNCTION Example() 
  5308. FastFormat()   ' Enable Fast Formatting 
  5309. UserControl("Press Resume to cancel Fast Formatting") 
  5310. FastFormat()   ' Disable Fast Formatting 
  5311. END FUNCTION 
  5312.  
  5313. See also: 
  5314.  
  5315.     ApplyFormat 
  5316.  
  5317.  
  5318. ΓòÉΓòÉΓòÉ 113. fclose ΓòÉΓòÉΓòÉ
  5319.  
  5320. This function closes an ASCII file that has been opened by the fopen function. 
  5321. All open files must be closed by the macro that created them, otherwise 
  5322. unpredictable results occur. 
  5323.  
  5324.  
  5325. When using ASCII file functions, be careful to ensure that the file was opened 
  5326. correctly before performing additional ASCII file functions. If the fopen 
  5327. function was unable to open the desired file, unpredictable results can occur 
  5328. if the macro attempts to read or write to that file. 
  5329.  
  5330. Syntax 
  5331. fclose(Handle) 
  5332. Handle is the file handle of the file to close. 
  5333.  
  5334. Return Value 
  5335. This function does not return a value. 
  5336.  
  5337. Example 
  5338. FUNCTION Example() 
  5339. amidir = GetAmiDirectory$() 
  5340. ' opens for appending; creates this file if it doesn't exist 
  5341. id = fopen("{amidir}test.txt", "a") 
  5342. IF id = 0 
  5343.     exit function 
  5344. ENDIF 
  5345. Name=Query$("What is your name?") 
  5346. fputs(id, Name) 
  5347. Address= Query$("What is your address?") 
  5348. fwrite(id, Address) 
  5349. fwrite(id, "This is right after the address, with no carriage return.") 
  5350. fclose(id) 
  5351. Exec("E.EXE", "{amidir}TEST.TXT") 
  5352. END FUNCTION 
  5353.  
  5354. See also: 
  5355.  
  5356.     fgets$ 
  5357.     fopen 
  5358.     fputs 
  5359.     fread 
  5360.     fseek 
  5361.     ftell 
  5362.     fwrite 
  5363.  
  5364.  
  5365.  
  5366. ΓòÉΓòÉΓòÉ 114. fgets ΓòÉΓòÉΓòÉ
  5367.  
  5368. This function reads a line of text from the file opened by the fopen function. 
  5369. The line of text is read from the current file pointer position. When reading a 
  5370. line of text, the carriage return/line feed combination is stripped from the 
  5371. end of the line before the line is returned by the function. 
  5372.  
  5373.  
  5374. When using ASCII file functions, be careful to ensure that the file was opened 
  5375. correctly before performing additional ASCII file functions. If the fopen 
  5376. function was unable to open the desired file, unpredictable results can occur 
  5377. if the macro attempts to read or write to that file. 
  5378.  
  5379. Syntax 
  5380. fgets$(Handle) 
  5381. Handle is the file handle for the file returned by the fopen function. 
  5382.  
  5383. Return Value 
  5384. The line of text if the file pointer was not at the end of the file. 
  5385. -1  if the file pointer was at the end of the file. 
  5386.  
  5387. Example 
  5388. FUNCTION Example() 
  5389. ONERROR toast 
  5390. ONCANCEL toast 
  5391. DEFSTR id, Line; 
  5392. IF 0 != Assign(&id, fopen("c:\AUTOEXEC.BAT", "r")) 
  5393.     ' create a new file 
  5394.     New("_BASIC.STY", 0, 0) 
  5395.     WHILE -1 != Assign(&Line, fgets$(id)) 
  5396.        TYPE("{Line}[Enter]")'type all the text in 
  5397.     WEND 
  5398.     toast: 
  5399.     fclose(id) 
  5400. ELSE 
  5401.     Message("Could not open C:\AUTOEXEC.BAT!") 
  5402. ENDIF 
  5403. END FUNCTION 
  5404.  
  5405. See also: 
  5406.  
  5407.     fclose 
  5408.     fopen 
  5409.     fputs 
  5410.     fread 
  5411.     fseek 
  5412.     ftell 
  5413.     fwrite 
  5414.  
  5415.  
  5416.  
  5417. ΓòÉΓòÉΓòÉ 115. FieldAdd ΓòÉΓòÉΓòÉ
  5418.  
  5419. This function adds a power field. This function is equivalent to choosing Edit 
  5420. Power Fields Insert. 
  5421.  
  5422.  
  5423. Syntax 
  5424. FieldAdd(Field) 
  5425. Field is the name of the power field to add. To include a quote mark within the 
  5426. string, use "". 
  5427.  
  5428. Return Value 
  5429. The new ID if the power field was successfully added. 
  5430. -2  (GeneralFailure) if the Power field was not added. 
  5431.  
  5432. Example 
  5433. FUNCTION Example() 
  5434. ' add a power field that looks like <TOC 1 "Related Functions"> 
  5435. FieldAdd("TOC 1 ""Related Functions""") 
  5436. ' add a power field that looks like <Index "experience" #> 
  5437. FieldAdd("Index ""experience"" #") 
  5438. ' add a power field that looks like <CreateDate %DB> 
  5439. FieldAdd("CreateDate %DB") 
  5440. END FUNCTION 
  5441.  
  5442. See also: 
  5443.  
  5444.     FieldAuto 
  5445.     FieldCommand 
  5446.     FieldEvaluate 
  5447.     FieldLock 
  5448.     FieldNext 
  5449.     FieldPrev 
  5450.     FieldRemove 
  5451.     FieldToggleDisplay 
  5452.     FieldUpdateAll 
  5453.     FieldUpdate 
  5454.  
  5455.  
  5456. ΓòÉΓòÉΓòÉ 116. FieldAuto ΓòÉΓòÉΓòÉ
  5457.  
  5458. This function sets or clears the auto update bit for a power field. This 
  5459. function is equivalent to choosing Edit Power Fields Insert and choosing Auto 
  5460. run. 
  5461.  
  5462.  
  5463. Syntax 
  5464. FieldAuto(ID, Auto) 
  5465. ID is the ID for the power field to modify. 
  5466. Auto is the value of the update bit for the power field and is either a 1 (On) 
  5467. or a 0 (Off). 
  5468.  
  5469. Return Value 
  5470. 1  (TRUE) if the bit was set or cleared. 
  5471. 0  (NoAction) if no action was taken. 
  5472.  
  5473. Example 
  5474. FUNCTION Example() 
  5475. FieldCommand()       ' let the user make a power field 
  5476. both = FieldPrev() 
  5477. id = MOD(both, 0x10000) 'see FieldNext/FieldPrev for explanation 
  5478. FieldAuto(id, 1) 
  5479. END FUNCTION 
  5480.  
  5481. See also: 
  5482.  
  5483.     FieldAdd 
  5484.     FieldCommand 
  5485.     FieldEvaluate 
  5486.     FieldLock 
  5487.     FieldNext 
  5488.     FieldPrev 
  5489.     FieldRemove 
  5490.     FieldToggleDisplay 
  5491.     FieldUpdateAll 
  5492.     FieldUpdate 
  5493.  
  5494.  
  5495. ΓòÉΓòÉΓòÉ 117. FieldCommand ΓòÉΓòÉΓòÉ
  5496.  
  5497. This function displays the Insert Power Fields dialog box. This function is 
  5498. equivalent to choosing Edit Power Fields Insert. 
  5499.  
  5500.  
  5501. Syntax 
  5502. FieldCommand() 
  5503.  
  5504. Return Value 
  5505. This function does not return a value. 
  5506.  
  5507. Example 
  5508. FUNCTION Example() 
  5509. FieldCommand()       ' let the user insert a power field 
  5510. both = FieldPrev() 
  5511. id = MOD(both, 0x10000) 'see FieldNext/FieldPrev for explanation 
  5512. FieldAuto(id, 1) 
  5513. END FUNCTION 
  5514.  
  5515. See also: 
  5516.  
  5517.     FieldAdd 
  5518.     FieldAuto 
  5519.     FieldEvaluate 
  5520.     FieldLock 
  5521.     FieldNext 
  5522.     FieldPrev 
  5523.     FieldRemove 
  5524.     FieldToggleDisplay 
  5525.     FieldUpdateAll 
  5526.     FieldUpdate 
  5527.  
  5528.  
  5529. ΓòÉΓòÉΓòÉ 118. FieldEvaluate ΓòÉΓòÉΓòÉ
  5530.  
  5531. This function updates the field in the current location of the insertion point. 
  5532. This function is equivalent to choosing Edit Power Fields Update. 
  5533.  
  5534.  
  5535. Syntax 
  5536. FieldEvaluate() 
  5537.  
  5538. Return Value 
  5539. 1  (TRUE) if the field was updated. 
  5540. 0  (FALSE) if the field was not updated. 
  5541.  
  5542. Example 
  5543. FUNCTION Example() 
  5544. FieldNext()          ' go to the next power field 
  5545. FieldEvaluate()   ' update it 
  5546. END FUNCTION 
  5547.  
  5548. See also: 
  5549.  
  5550.     FieldAdd 
  5551.     FieldAuto 
  5552.     FieldCommand 
  5553.     FieldLock 
  5554.     FieldNext 
  5555.     FieldPrev 
  5556.     FieldRemove 
  5557.     FieldToggleDisplay 
  5558.     FieldUpdateAll 
  5559.     FieldUpdate 
  5560.  
  5561.  
  5562. ΓòÉΓòÉΓòÉ 119. FieldLock ΓòÉΓòÉΓòÉ
  5563.  
  5564. This function sets or clears the lock bit for a power field. This function is 
  5565. equivalent to choosing Edit Power Fields Insert and choosing Lock. 
  5566.  
  5567.  
  5568. Syntax 
  5569. FieldLock(ID, Lock) 
  5570. ID is the ID of the power field to modify. 
  5571. Lock is the value of the lock bit for the power field and is either a 1 (On) or 
  5572. a 0 (Off). 
  5573.  
  5574. Return Value 
  5575. This function does not return a value. 
  5576.  
  5577. Example 
  5578. FUNCTION Example() 
  5579. FieldCommand()       ' let the user make a power field 
  5580. both = FieldPrev() 
  5581. id = MOD(both, 0x10000) 'see FieldNext/FieldPrev for explanation 
  5582. FieldLock(id, 1) 
  5583. END FUNCTION 
  5584.  
  5585. See also: 
  5586.  
  5587.     FieldAdd 
  5588.     FieldAuto 
  5589.     FieldCommand 
  5590.     FieldEvaluate 
  5591.     FieldNext 
  5592.     FieldPrev 
  5593.     FieldRemove 
  5594.     FieldToggleDisplay 
  5595.     FieldUpdateAll 
  5596.     FieldUpdate 
  5597.  
  5598.  
  5599.  
  5600. ΓòÉΓòÉΓòÉ 120. FieldNext FieldPrev ΓòÉΓòÉΓòÉ
  5601.  
  5602. These functions go backward to the previous power field or forward to the next 
  5603. power field. This function is equivalent to choosing Edit Power Fields Next 
  5604. Field or Edit Power Fields Prev Field. 
  5605.  
  5606.  
  5607. Syntax 
  5608. FieldNext() 
  5609. FieldPrev() 
  5610.  
  5611. Return Value 
  5612. 0  (NoAction) if no action was taken. 
  5613. The ID of the next/previous Power Field is a bit number. To extract the ID: 
  5614. both = FieldNext()   ' or both = FieldPrev() 
  5615. ID = Mod(both, 0x10000) 
  5616.  
  5617. Example 
  5618. FUNCTION Example() 
  5619. FieldCommand() 
  5620. both = FieldPrev()   ' or use FieldNext here 
  5621. id = MOD(both, 0x10000) 
  5622. FieldAuto(id, 1) 
  5623. FieldLock(id, 1) 
  5624. END FUNCTION 
  5625.  
  5626. See also: 
  5627.  
  5628.     FieldAdd 
  5629.     FieldAuto 
  5630.     FieldCommand 
  5631.     FieldEvaluate 
  5632.     FieldLock 
  5633.     FieldRemove 
  5634.     FieldToggleDisplay 
  5635.     FieldUpdateAll 
  5636.     FieldUpdate 
  5637.  
  5638.  
  5639. ΓòÉΓòÉΓòÉ 121. FieldRemove ΓòÉΓòÉΓòÉ
  5640.  
  5641. This function removes a power field. 
  5642.  
  5643.  
  5644. Syntax 
  5645. FieldRemove(ID, 8) 
  5646. ID identifies the power field. You can obtain the ID of a power field by using 
  5647. FieldNext or FieldPrev. 
  5648. 8 tells the function to remove the index entry. 
  5649.  
  5650. Return Value 
  5651. This function returns 1. 
  5652.  
  5653. Example 
  5654. FUNCTION Example() 
  5655. Both = FieldNext() 
  5656. id = MOD(Both, 0x10000)     ' see Field Next/Field Prev for explanation 
  5657. FieldRemove(id, 8) 
  5658. END FUNCTION 
  5659.  
  5660. See also: 
  5661.  
  5662.     FieldAdd 
  5663.     FieldAuto 
  5664.     FieldCommand 
  5665.     FieldEvaluate 
  5666.     FieldLock 
  5667.     FieldNext 
  5668.     FieldPrev 
  5669.     FieldToggleDisplay 
  5670.     FieldUpdateAll 
  5671.     FieldUpdate 
  5672.  
  5673.  
  5674.  
  5675.  
  5676. ΓòÉΓòÉΓòÉ 122. FieldToggleDsplay ΓòÉΓòÉΓòÉ
  5677.  
  5678. This function toggles the power field display on or off. This function is 
  5679. equivalent to choosing View Show Power Fields or View Hide Power Fields. 
  5680.  
  5681.  
  5682. Syntax 
  5683. FieldToggleDisplay() 
  5684.  
  5685. Return Value 
  5686. This function returns 1. 
  5687.  
  5688. Example 
  5689. FUNCTION Example() 
  5690. UserControl("Click Resume to show power fields.") 
  5691. FieldToggleDisplay() 
  5692. END FUNCTION 
  5693.  
  5694. See also: 
  5695.  
  5696.     FieldAdd 
  5697.     FieldAuto 
  5698.     FieldCommand 
  5699.     FieldEvaluate 
  5700.     FieldLock 
  5701.     FieldNext 
  5702.     FieldPrev 
  5703.     FieldRemove 
  5704.     FieldUpdateAll 
  5705.     FieldUpdate 
  5706.  
  5707.  
  5708.  
  5709.  
  5710.  
  5711. ΓòÉΓòÉΓòÉ 123. FieldUpdate ΓòÉΓòÉΓòÉ
  5712.  
  5713. This function updates an existing power field. This function is equivalent to 
  5714. choosing Edit Power Fields Update. 
  5715.  
  5716.  
  5717. Syntax 
  5718. FieldUpdate(ID, 0, Field) 
  5719. ID is the ID of the power field to update. 
  5720. Field is the name of the power field to update. 
  5721.  
  5722. Return Value 
  5723. 1  (TRUE) if the Power  field was successfully updated. 
  5724. -7  (CouldNotFind) if the Power Field could not be located. 
  5725.  
  5726. Example 
  5727. FUNCTION Example() 
  5728. id = FieldAdd("NumPages")      ' add Numpages power field 
  5729. both = FieldPrev() 
  5730. id = MOD(both, 0x10000)     ' see Field Next/Field Prev for explanation 
  5731. FieldUpdate(id, type, "NumPages")     ' updates the Numpages power field 
  5732. END FUNCTION 
  5733.  
  5734. See also: 
  5735.  
  5736.     FieldAdd 
  5737.     FieldAuto 
  5738.     FieldCommand 
  5739.     FieldEvaluate 
  5740.     FieldLock 
  5741.     FieldNext 
  5742.     FieldPrev 
  5743.     FieldRemove 
  5744.     FieldToggleDisplay 
  5745.     FieldUpdateAll 
  5746.  
  5747.  
  5748.  
  5749. ΓòÉΓòÉΓòÉ 124. FieldUpdateAll ΓòÉΓòÉΓòÉ
  5750.  
  5751. This function updates all power fields in the current document. This function 
  5752. is equivalent to choosing Edit Power Fields Update All. 
  5753.  
  5754.  
  5755. Syntax 
  5756. FieldUpdateAll() 
  5757.  
  5758. Return Value 
  5759. 1  (TRUE) if all of the power fields were successfully updated. 
  5760.  
  5761. Example 
  5762. FUNCTION Example() 
  5763. UserControl("Click Resume to update all power fields.") 
  5764. FieldUpdateAll() 
  5765. END FUNCTION 
  5766.  
  5767. See also: 
  5768.  
  5769.     FieldAdd 
  5770.     FieldAuto 
  5771.     FieldCommand 
  5772.     FieldEvaluate 
  5773.     FieldLock 
  5774.     FieldNext 
  5775.     FieldPrev 
  5776.     FieldRemove 
  5777.     FieldToggleDisplay 
  5778.     FieldUpdate 
  5779.  
  5780.  
  5781.  
  5782. ΓòÉΓòÉΓòÉ 125. FileChanged ΓòÉΓòÉΓòÉ
  5783.  
  5784. This function reads and optionally sets the file-changed flag internal to Ami 
  5785. Pro. The file-changed flag determines whether Ami Pro asks the user to save the 
  5786. document before displaying a new document or exiting the program. 
  5787.  
  5788.  
  5789. Syntax 
  5790. FileChanged(Action, NewValue) 
  5791. Action determines whether to read or set the file changed flag. If the Action 
  5792. parameter is 1 (TRUE), the state of the flag changes to the second parameter. 
  5793. If the Action parameter is 0 (FALSE), the parameter is not changed and NewValue 
  5794. is ignored. 
  5795. NewValue is the new value used for the file changed flag. This should be set to 
  5796. a 1 (changed) or a 0 (not changed). 
  5797.  
  5798. Return Value 
  5799. A positive number if the file had been changed prior to using the function. 
  5800. 0  (FALSE) if the file had not been changed. 
  5801. Changing the value of the file changed parameter does not affect the return 
  5802. value of the function until the subsequent function call. 
  5803.  
  5804. Example 
  5805. FUNCTION Example() 
  5806. TYPE("After typing this text, the file will be marked unchanged and then 
  5807. closed.") 
  5808. FileChanged(1, 0) 
  5809. FileClose() 
  5810. END FUNCTION 
  5811.  
  5812. See also: 
  5813.  
  5814.     FileClose 
  5815.     FileOpen 
  5816.     FilePrint 
  5817.     SaveAs 
  5818.     Save 
  5819.  
  5820.  
  5821.  
  5822. ΓòÉΓòÉΓòÉ 126. FileClose ΓòÉΓòÉΓòÉ
  5823.  
  5824. This function closes the active document in Ami Pro. This function is 
  5825. equivalent to choosing File Close. 
  5826.  
  5827.  
  5828. Syntax 
  5829. FileClose() 
  5830.  
  5831. Return Value 
  5832. 1  (TRUE) if the file was successfully closed. 
  5833. -2  if the file was not closed. 
  5834.  
  5835. Example 
  5836. FUNCTION Example() 
  5837. FileClose()       'Close the current file. 
  5838. END FUNCTION 
  5839.  
  5840. See also: 
  5841.  
  5842.     FileChanged 
  5843.     FileOpen 
  5844.     FilePrint 
  5845.     SaveAs 
  5846.     Save 
  5847.  
  5848.  
  5849. ΓòÉΓòÉΓòÉ 127. FileManagement ΓòÉΓòÉΓòÉ
  5850.  
  5851. This function opens the Ami Pro File Manager. This function is equivalent to 
  5852. choosing File File Management. File Management functions cannot be run directly 
  5853. with this macro function. It opens the Ami Pro File Manager, then immediately 
  5854. returns control to the macro. The user can do file management functions, close 
  5855. the window, and return to word processing. 
  5856.  
  5857.  
  5858. If later functions in the macro involve screen display, these functions cause 
  5859. the Ami Pro window to obscure the Ami Pro File Management window as the macro 
  5860. continues to run. Either have the macro pause with a UserControl box or allow 
  5861. this function to be the last function in the macro. 
  5862.  
  5863. A macro must be edited to insert this non-recordable function. 
  5864.  
  5865. Syntax 
  5866. FileManagement() 
  5867.  
  5868. Return Value 
  5869. 1  (TRUE) if the File Manager was started. 
  5870. -2  (GeneralFailure) if the File Manager could not be started. 
  5871. -6  (NoMemory) if the function failed because of insufficient memory. 
  5872.  
  5873. Example 
  5874. FUNCTION Example() 
  5875. OnKey([CtrlAltf], FileManagement, 0) 
  5876. Message("Press Ctrl+Alt+F to execute the Ami Pro File Manager.") 
  5877. END FUNCTION 
  5878.  
  5879. See also: 
  5880.  
  5881.     DOSchdir 
  5882.     DOSCopyFile 
  5883.     DOSDelFile 
  5884.     DOSGetEnv$ 
  5885.     DOSGetFileAttr 
  5886.     DOSmkdir 
  5887.     DOSRename 
  5888.     DOSrmdir 
  5889.     DOSSetFileAttr 
  5890.     OnKey 
  5891.     UserControl 
  5892.  
  5893.  
  5894.  
  5895. ΓòÉΓòÉΓòÉ 128. FileOpen ΓòÉΓòÉΓòÉ
  5896.  
  5897. This function opens a document in Ami Pro. This function is equivalent to 
  5898. choosing File Open. 
  5899.  
  5900.  
  5901. Syntax 
  5902. FileOpen(FileName, Options, App) 
  5903. FileName is the name of the document to open. If the file to be opened is not 
  5904. in the current directory or document directory, the path must be used. To open 
  5905. the 'Untitled' file, use the null string ("") as the file name. 
  5906. Options is a bit number corresponding to the options for the file you open. To 
  5907. use more than one of the options, add them together. Options can be one or more 
  5908. of the following: 
  5909.     1 - Ami Pro file 
  5910.     5 - ASCII file 
  5911.     8 - Import/Insert 
  5912.     16 - Non-Ami Pro or Non-ASCII file 
  5913.     128 - Close current file 
  5914. App is the file type of the file. The file type must appear as it does in the 
  5915. amipro3.ini file or the list of file types in the Open dialog box. To open an 
  5916. Ami Pro file, use the null string ("") here. 
  5917.  
  5918. To display the Open dialog box and allow the user to choose the file to open: 
  5919. FileOpen 
  5920.  
  5921. Return Value 
  5922. 1  (TRUE) if the file was opened. 
  5923. 0  (UserCancel) if the user canceled the function. 
  5924. -2  (GeneralFailure) if the file was not opened. 
  5925. 2   if the user created a file that did not exist. 
  5926.  
  5927. Example 
  5928. FUNCTION Example() 
  5929. Filename = Query$("What file do you want to open?") 
  5930. FileOpen("{Filename}", 1, "") 
  5931. END FUNCTION 
  5932.  
  5933. See also: 
  5934.  
  5935.     ASCIIOptions 
  5936.     FileChanged 
  5937.     FilePrint 
  5938.     GetOpenFileCount 
  5939.     GetOpenFileName$ 
  5940.     GetOpenFileNames 
  5941.     New 
  5942.     SaveAs 
  5943.     Save 
  5944.  
  5945.  
  5946.  
  5947.  
  5948.  
  5949. ΓòÉΓòÉΓòÉ 129. FilePrint ΓòÉΓòÉΓòÉ
  5950.  
  5951. This function allows printing the current document to a printer. This function 
  5952. is equivalent to choosing File Print. Before using this function, your macro 
  5953. should ensure that the document you want to print is active. 
  5954.  
  5955.  
  5956. Syntax 
  5957. FilePrint(Copies, StartPage, EndPage, Flag) 
  5958. Copies is the number of copies of the document to print. 
  5959. StartPage is the page number to start printing. This parameter is ignored if 
  5960. the PrintAll option is used, but must still be present. 
  5961. EndPage is the page number after which to stop printing. This parameter is 
  5962. ignored if the PrintAll option is used, but must still be present. 
  5963. Flag is a number that defines the value of other print options, and may be one 
  5964. or more of the following: 
  5965.     PrintAll (1) - Prints all pages of document, ignoring StartPage and 
  5966.     EndPage. 
  5967.     PrintEven (512) - Prints only the even pages of the document. 
  5968.     PrintOdd (1024) - Prints only the odd pages of the document. 
  5969.     PrintBoth (1536) - Prints both even and odd pages of the document. 
  5970.     4096 - Prints only the current page. 
  5971. The desired options should be added together to make up the value of the  flag 
  5972. parameter. 
  5973.  
  5974. To display the Print dialog box and allow the user to set print options: 
  5975. FilePrint 
  5976.  
  5977. Return Value 
  5978. 1  (TRUE) if the print job was successfully completed. 
  5979. 0  (UserCancel) if the user canceled the function. 
  5980. -2  (GeneralFailure) if the print job failed. 
  5981.  
  5982. Example 
  5983. FUNCTION Example() 
  5984. ' print all of the current file with defaults 
  5985. FilePrint(1, 1, 9999, 1537) 
  5986. END FUNCTION 
  5987.  
  5988. See also: 
  5989.  
  5990.     Merge 
  5991.     PrintOptions 
  5992.     PrintSetup 
  5993.  
  5994.  
  5995. ΓòÉΓòÉΓòÉ 130. FillEdit ΓòÉΓòÉΓòÉ
  5996.  
  5997. This function is used to fill the contents of an object that displays in a 
  5998. dialog box called by the DialogBox function. If the object is an edit box or 
  5999. static text with an 8000-8999 ID, the text specified in the  value parameter 
  6000. fills the edit box. If the object is a radio button or check box, the 
  6001. expression specified in the  value parameter is evaluated and the button is 
  6002. activated if the result of the evaluation is TRUE. If the result of the 
  6003. evaluation is FALSE, the button is not activated. If the object is a list box 
  6004. or a combo box (ID of 9000-9999), the text specified as the  value parameter is 
  6005. passed. An array can be passed to a list or combo box, filling the list with 
  6006. the contents of the array. To do so, use indirection (&) and the name of the 
  6007. array to pass. 
  6008.  
  6009. You can use this function to put a wildcard pattern into a combo box or a list 
  6010. box or to append other selection criteria. 
  6011.  
  6012. Syntax 
  6013. FillEdit (ID, Value) 
  6014. ID is the number of the object that receives the value. 
  6015. Value is either a text string, an expression that evaluates to TRUE or FALSE, 
  6016. or the address of an existing array. It can be any combination of the following 
  6017. values: 
  6018.     1 - Read-only 
  6019.     2 - Hidden 
  6020.     4 - System 
  6021.     16 - Disk volume label 
  6022.     32 - Directories 
  6023.     16384 - Drives 
  6024.     32768 - Files of specified type only 
  6025.  
  6026. Return Value 
  6027. This function does not return a value. 
  6028.  
  6029. Example 
  6030. FUNCTION Example() 
  6031. ' 32768 + 16384 + 16 = 49168 
  6032. ' this displays only drives and directories 
  6033. FillEdit(9001, "c:\*.*,49168") 
  6034. dialogBox(".", "DirsOnly") 
  6035. END FUNCTION 
  6036.  
  6037. DIALOG DirsOnly 
  6038. -2134376448 3 52 48 160 90 "" "" "DirsOnly" 
  6039. 32 20 60 64 9001 1352728579 "listbox" "" 0 
  6040. 112 4 40 14 1 1342373889 "button" "OK" 0 
  6041. 112 22 40 14 2 1342373888 "button" "Cancel" 0 
  6042. END DIALOG 
  6043.  
  6044. See also: 
  6045.  
  6046.     DialogBox 
  6047.     FillList 
  6048.     GetDialogField$ 
  6049.     GetDlgItem 
  6050.     GetDlgItemText 
  6051.     SetDlgCallback 
  6052.     SetDlgItemText 
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058. ΓòÉΓòÉΓòÉ 131. FindFirst ΓòÉΓòÉΓòÉ
  6059.  
  6060. This function finds files that match the FileSpec given to the function. All 
  6061. files or a subset of files in a directory can be found. The FindFirst$ function 
  6062. retrieves the first matching file and must be used before the FindNext$ 
  6063. function. FindNext$ finds other files that match the FileSpec. 
  6064.  
  6065.  
  6066. Syntax 
  6067. FindFirst$(FileSpec, Attr) 
  6068. FileSpec describes the file specification desired. It may include a drive 
  6069. and/or directory name, if desired. The file name portion of the FileSpec can 
  6070. include the wildcard characters asterisk (*) and question mark (?). 
  6071. Attr is a number that represents the type of file desired. The possible 
  6072. attributes are: 
  6073.     A_Normal (0) - Normal  Files 
  6074.     A_ReadOnly (1) - Read-only  Files 
  6075.     A_Hidden (2) - Hidden  Files 
  6076.     A_System (4) - System  Files 
  6077.     A_Vollabel (8) -Disk's  Volume Label 
  6078.     A_Directory (16) - Directories 
  6079.     A_Archive (32) - Archived files 
  6080. The values listed above may be added together to retrieve different file types. 
  6081.  
  6082. Return Value 
  6083. A string with the matching file. 
  6084. The null string ("") if no files are matched. 
  6085.  
  6086. Example 
  6087. FUNCTION Example() 
  6088. Filename = Query$("What file do you want to open?") 
  6089. ' check to see if the file exists 
  6090. IF FindFirst$(Filename, 0) 
  6091.     FileOpen("{Filename}", 1, "") 
  6092. ELSE 
  6093.     Message("Could not find {Filename}.") 
  6094. ENDIF 
  6095. END FUNCTION 
  6096.  
  6097. See also: 
  6098.  
  6099.     fclose 
  6100.     fgets$ 
  6101.     FindNext$ 
  6102.     fputs 
  6103.     fread 
  6104.     fseek 
  6105.     ftell 
  6106.     fwrite 
  6107.  
  6108.  
  6109.  
  6110. ΓòÉΓòÉΓòÉ 132. FindNext ΓòÉΓòÉΓòÉ
  6111.  
  6112. This function finds files that match the FileSpec given to the FindFirst$ 
  6113. function. All files or a subset of files in a directory can be found. The 
  6114. FindFirst$ function retrieves the first matching file and must be used before 
  6115. the FindNext$ function. FindNext$ finds other files that match the FileSpec. 
  6116.  
  6117.  
  6118. Syntax 
  6119. FindNext$() 
  6120.  
  6121. Return Value 
  6122. A string with the matching file. 
  6123. The null string ("") if no files are matched. 
  6124.  
  6125. Example 
  6126. FUNCTION Example() 
  6127. DIR = Query$("What directory to report on?") 
  6128. ' see if the file exists 
  6129. File = FindFirst$("{DIR}*.*", 0) 
  6130. ' Type the file names 
  6131. WHILE File <> "" 
  6132.     TYPE ("{File}[Enter]") 
  6133.     File = FindNext$() 
  6134. WEND 
  6135. END FUNCTION 
  6136.  
  6137. See also: 
  6138.  
  6139.     fclose 
  6140.     fgets$ 
  6141.     FindFirst$ 
  6142.     FindNext$ 
  6143.     fputs 
  6144.     fread 
  6145.     fseek 
  6146.     ftell 
  6147.     fwrite 
  6148.  
  6149.  
  6150.  
  6151.  
  6152. ΓòÉΓòÉΓòÉ 133. FindReplace ΓòÉΓòÉΓòÉ
  6153.  
  6154. This function allows the user to view the Find & Replace dialog box. This 
  6155. function is equivalent to choosing Edit Find & Replace. This function does not 
  6156. automatically replace words. If automatic Find & Replace is desired, use the 
  6157. Replace function instead. 
  6158.  
  6159. A macro must be edited to insert this non-recordable function. 
  6160.  
  6161. Syntax 
  6162. FindReplace() 
  6163.  
  6164. Return Value 
  6165. 1  (TRUE) if the Find & Replace function was started. 
  6166. 0  (UserCancel) if the user canceled the function. 
  6167.  
  6168. Example 
  6169. FUNCTION Example() 
  6170. FindReplace() 
  6171. END FUNCTION 
  6172.  
  6173. See also: 
  6174.  
  6175.     GoToCmd 
  6176.     Replace 
  6177.  
  6178.  
  6179.  
  6180.  
  6181. ΓòÉΓòÉΓòÉ 134. FontChange ΓòÉΓòÉΓòÉ
  6182.  
  6183. This function sets the font, family, color, and size to be used for selected 
  6184. text. This function is equivalent to choosing Text Font. 
  6185.  
  6186.  
  6187. Syntax 
  6188. FontChange(Name, PitchFamily, Color, Size) 
  6189. Name is the name of the font to use. The name of the font is the font name, as 
  6190. seen in the Font list box in the menu. 
  6191. PitchFamily is a combination of the pitch of the font and the typestyle 
  6192. parameters. 
  6193. Pitch is one of the following values: 
  6194.     False (0) - Not  Specified 
  6195.     FixedPitch (1) - This is a fixed pitch font 
  6196.     VariablePitch (2) - This is a proportional font 
  6197. Family is one of the following typeface families: 
  6198.     False (0) - Not  Specified 
  6199.     Roman (16) - Roman-like typestyle; proportional pitch, serif 
  6200.     Swiss (32) - Swiss-like typestyle; proportional pitch, sans serif 
  6201.     Modern (48) - Modern-like typestyle; fixed pitch, could be either serif or 
  6202.     sans serif 
  6203.     Script (64) - Script-like typestyle, such as Brush or Park Avenue 
  6204.     Decorative (80) - Decorative typeface, such as Old English 
  6205. One value for Pitch and one value for family should be added together to make 
  6206. up the PitchFamily parameter. This parameter is used to determine another font 
  6207. if the font named is not available on the printer. 
  6208. Color is a numeric representation of the color of the font. It is one of the 
  6209. following values: 
  6210.     White (16777215) - White 
  6211.     Cyan (16776960) - Light  Blue 
  6212.     Yellow (65535) - Yellow 
  6213.     Magenta (16711935) - Purple 
  6214.     Green (65280) - Green 
  6215.     Red (255) - Red 
  6216.     Blue (16711680) - Blue 
  6217.     Black (0) - Black 
  6218. Size is expressed in twips (1 inch = 1440 twips). An 8 point font is 160 twips. 
  6219. 10 point is 200 twips; 12 point is 240 twips, etc. The formula to determine 
  6220. twips from point size is pointsize * 20. 
  6221.  
  6222. To display the dialog box to allow the user to select the desired font: 
  6223. FontChange 
  6224.  
  6225. Return Value 
  6226. 1  (TRUE) if the font was changed. 
  6227. 0  (UserCancel) if the user canceled the function. 
  6228.  
  6229. Example 
  6230. FUNCTION Example() 
  6231. DEFSTR Name, Color, Size, Family; 
  6232. ' get the current font information 
  6233. GetCurFontInfo(&Name, &Color, &Size, &Family) 
  6234. ' increase pointsize by two and calculate the twips 
  6235. Size = ((Size / 20) + 2) * 20 
  6236. ' change font 
  6237. FontChange(Name, Family, Color, Size) 
  6238. END FUNCTION 
  6239.  
  6240. See also: 
  6241.  
  6242.     FontFaceChange 
  6243.     FontPointSizeChange 
  6244.     FontRevert 
  6245.     ModifyFont 
  6246.     NormalText 
  6247.     Spacing 
  6248.  
  6249.  
  6250.  
  6251.  
  6252.  
  6253. ΓòÉΓòÉΓòÉ 135. FontFaceChange ΓòÉΓòÉΓòÉ
  6254.  
  6255. This function changes the selected font for the active document. This function 
  6256. is equivalent to choosing a font from the status bar. Through the status bar, 
  6257. the user can only select from the fonts available on the printer. Using this 
  6258. function, any type of font can be requested. When it is time to display or 
  6259. print the font, Ami Pro selects the closest matching font to the specification 
  6260. given. 
  6261.  
  6262.  
  6263. Syntax 
  6264. FontFaceChange(Name) 
  6265. Name is the name of the font to be used. The font name is selected from the 
  6266. list of names displayed in the FontName section of the status bar. 
  6267.  
  6268. Return Value 
  6269. 1  (TRUE) if the Font Face was changed. 
  6270. 0  (NoAction) if no action was taken because the font was not available. 
  6271.  
  6272. Example 
  6273. FUNCTION Example() 
  6274. FontName = Query$("Please enter a font name.") 
  6275. ReturnValue = FontFaceChange(FontName) 
  6276. IF ReturnValue = 0 
  6277.     Message("Font ""{FontName}"" not available!") 
  6278. ENDIF 
  6279. END FUNCTION 
  6280.  
  6281. See also: 
  6282.  
  6283.     FontChange 
  6284.     FontPointSizeChange 
  6285.     FontRevert 
  6286.     ModifyFont 
  6287.     NormalText 
  6288.  
  6289.  
  6290. ΓòÉΓòÉΓòÉ 136. FontPointSizeChange ΓòÉΓòÉΓòÉ
  6291.  
  6292. This function changes the point size of the selected font for the active 
  6293. document. This function is equivalent to choosing a point size from the status 
  6294. bar. 
  6295.  
  6296.  
  6297. Syntax 
  6298. FontPointSizeChange(Size) 
  6299. Size is the point size to use. The point size is selected from the list of 
  6300. sizes displayed in the pointsize section of the status bar. 
  6301.  
  6302. Return Value 
  6303. This function returns 1. 
  6304.  
  6305. Example 
  6306. FUNCTION Example() 
  6307. PointSize = Query$("Please enter a new point size.") 
  6308. FontPointSizeChange(PointSize) 
  6309. Message("The new point size is {PointSize}") 
  6310. END FUNCTION 
  6311.  
  6312. See also: 
  6313.  
  6314.     FontChange 
  6315.     FontFaceChange 
  6316.     FontRevert 
  6317.     ModifyFont 
  6318.     NormalText 
  6319.  
  6320.  
  6321. ΓòÉΓòÉΓòÉ 137. FontRevert ΓòÉΓòÉΓòÉ
  6322.  
  6323. This function changes the text font to the font defined by the current 
  6324. paragraph style. This function is equivalent to choosing Text Font and 
  6325. selecting the Revert to s tyle check box. 
  6326.  
  6327.  
  6328. Syntax 
  6329. FontRevert() 
  6330.  
  6331. To display the Font dialog box and allow the user to select the font that 
  6332. should be used for text: FontChange 
  6333.  
  6334. Return Value 
  6335. This function does not return a value. 
  6336.  
  6337. Example 
  6338. FUNCTION Example() 
  6339. WHILE CurShade$() = "" 
  6340.     UserControl("Select the text to revert back to the style...") 
  6341. WEND 
  6342. FontRevert() 
  6343. END FUNCTION 
  6344.  
  6345. See also: 
  6346.  
  6347.     FontChange 
  6348.     FontFaceChange 
  6349.     FontPointSizeChange 
  6350.     ModifyFont 
  6351.     NormalText 
  6352.  
  6353.  
  6354. ΓòÉΓòÉΓòÉ 138. Footnotes ΓòÉΓòÉΓòÉ
  6355.  
  6356. This function sets the options for footnotes, as well as allowing the user to 
  6357. edit, insert, or remove footnotes. This function is equivalent to choosing 
  6358. Tools Footnotes. 
  6359.  
  6360.  
  6361. Syntax 
  6362. Footnotes(Function, Options, StartNum, Length, Indent) 
  6363. Function is the desired footnote function. The  function parameter is one of 
  6364. the following values: 
  6365.     InsFootnote (1) - Insert new footnote 
  6366.     EditFootnote (2) - Edit existing footnote 
  6367.     SetOptions (3) - Set footnote options only 
  6368. Options are the desired footnote options. Options are one or more of the 
  6369. following options: 
  6370.     Gather (1) - Make the footnotes appear at the end of the document as 
  6371.     endnotes 
  6372.     Reset (2) - Reset the footnote numbering on each page 
  6373.     CustomLength (4) - The footnote separator line is a custom length, rather 
  6374.     than the length of the margins 
  6375. Options should be added together if more than one option is desired. 
  6376. StartNum is the starting footnote number. 
  6377. Length is the length of the footnote line in twips (1 inch = 1440 twips). 
  6378. Indent is the indention of the footnote line from the left margin in twips. 
  6379. If the Custom length option is chosen, the Length parameter should be set to 
  6380. the length of the line. If the length of the line is not customized, this value 
  6381. should be set to 0. The Indent parameter should be set to the desired indent 
  6382. from the left margin. If no indent is desired, the value for Indent should be 
  6383. 0. 
  6384. To determine the Length and Indent parameters, multiply the desired number of 
  6385. inches by 1440 to determine the value in twips. 
  6386.  
  6387. To display the dialog box and allow the user to select the footnote functions 
  6388. and options: Footnotes 
  6389.  
  6390. Return Value 
  6391. 1 (TRUE) if the footnote function was completed. 
  6392. 0  (UserCancel) if the user canceled the function. 
  6393. -2  (GeneralFailure) if the function could not be completed. 
  6394.  
  6395. Example 
  6396. FUNCTION Example() 
  6397. ReturnValue = FootNotes(InsFootnote, Gather, 1, 0, 0) 
  6398. IF ReturnValue != 1 
  6399.     SWITCH ReturnValue 
  6400.     CASE 0 
  6401.        Message("Footnote function was canceled.") 
  6402.     CASE -2 
  6403.        Message("GeneralFailure! Could not insert Footnote.") 
  6404.     ENDSWITCH 
  6405. ENDIF 
  6406. END FUNCTION 
  6407.  
  6408. See also: 
  6409.  
  6410.     GoToCmd 
  6411.  
  6412.  
  6413. ΓòÉΓòÉΓòÉ 139. FormatDate ΓòÉΓòÉΓòÉ
  6414.  
  6415. This function takes a date (in seconds) from January 1, 1970, and creates a 
  6416. formatted string. 
  6417.  
  6418.  
  6419. Syntax 
  6420. FormatDate$(Date, Style) 
  6421. Date is the date to be converted in seconds format. 
  6422. Style is one of the formats listed below: 
  6423.     a - 2/18/91 
  6424.     b - February 18, 1991 
  6425.     B - FEBRUARY 18, 1991 
  6426.     c - 18 February 1991 
  6427.     C - 18 FEBRUARY 1991 
  6428.     d - Monday, February 18, 1991 
  6429.     D - MONDAY, FEBRUARY 18, 1991 
  6430.     e - February 18 
  6431.     E - FEBRUARY 18 
  6432.     f - Monday, February 18 
  6433.     F - MONDAY, FEBRUARY 18 
  6434.     g - 2/18 
  6435.     h - 2/18/1991 
  6436.     i - 18. February 
  6437.     I - 18. FEBRUARY 
  6438.     j - 18. February 1991 
  6439.     k - 1991 February 18 
  6440.     K - 1991 FEBRUARY 18 
  6441.     l - February, 1991 
  6442.     L - FEBRUARY, 1991 
  6443.  
  6444. Return Value 
  6445. The date converted to the selected style. 
  6446.  
  6447. Example 
  6448. FUNCTION Example() 
  6449. Born = Query$("What is your Birthday (MM/DD/YYYY)?") 
  6450. Date = FormatDate$(Now(), "h") 'current date 
  6451. Time = FormatTime$(Now(), 6)   'current time 
  6452. Days = DateDiff(Born, Date) ' how many days old 
  6453. TextDate = FormatDate$(Now(), "d")    'format the date 
  6454. Message("It is now {Time} on {TextDate}. You are {Days} days old.") 
  6455. END FUNCTION 
  6456.  
  6457. See also: 
  6458.  
  6459.     FormatTime$ 
  6460.     InsertDate 
  6461.     Now 
  6462.  
  6463.  
  6464. ΓòÉΓòÉΓòÉ 140. FormatNum ΓòÉΓòÉΓòÉ
  6465.  
  6466. This function formats a number to a string, adds an optional prefix at the 
  6467. beginning, the specified number of digits to the right of the decimal point, 
  6468. and an optional suffix at the end. The decimal point character and thousands 
  6469. separator character are taken from the Country Settings option in the System 
  6470. Setup. 
  6471.  
  6472.  
  6473. Syntax 
  6474. FormatNum$(Prefix, Suffix, Decimals, Number) 
  6475. Prefix is a string that is placed at the beginning of the formatted number. 
  6476. Suffix is a string that is placed at the end of the formatted number. 
  6477. Decimals is the number of decimal places to use in the number. 
  6478. Number is the number to format, without commas, prefix, or suffix. 
  6479.  
  6480. Return Value 
  6481. The string with the formatted number. 
  6482.  
  6483. Example 
  6484. FUNCTION Example() 
  6485. Again: 
  6486. Number = Query$("How much was the sale?") 
  6487. Where = Query$("Where was the sale made (E)ngland or (A)merica?") 
  6488. ' get the first character and make lowercase 
  6489. Where = lcase$(Left$(Where, 1)) 
  6490. IF Where = "e" 
  6491.     Prefix = "" 
  6492.     Suffix = "╨│" 
  6493. ELSEIF Where = "a" 
  6494.     Prefix = "$" 
  6495.     Suffix = "" 
  6496. ELSE 
  6497.     Message("Please choose ""E"" or ""A"".") 
  6498.     GoTo again 
  6499. ENDIF 
  6500. NewNumber = FormatNum$(Prefix, Suffix, 2, Number) 
  6501. Message("The sale was for {NewNumber}.") 
  6502. END FUNCTION 
  6503.  
  6504. See also: 
  6505.  
  6506.     Instr 
  6507.     IsNumeric 
  6508.     LCASE$ 
  6509.     LEN 
  6510.     MID$ 
  6511.     strcat$ 
  6512.     strchr 
  6513.     strfield$ 
  6514.     UCASE$ 
  6515.  
  6516.  
  6517. ΓòÉΓòÉΓòÉ 141. FormatSeq ΓòÉΓòÉΓòÉ
  6518.  
  6519. This function formats the Number parameter to a specified paragraph style as 
  6520. defined in the Style parameter. 
  6521.  
  6522.  
  6523. Syntax 
  6524. FormatSeq$(Number, Style) 
  6525. Number is the number you want to format, without commas, prefixes or suffixes. 
  6526. Style can be one of the paragraph styles listed below: 
  6527.     1 - 1, 2, 3... 
  6528.     2 - I, II, III... 
  6529.     3 - i, ii, iii... 
  6530.     4 - A, B, C... 
  6531.     5 - a, b, c... 
  6532.  
  6533. Return Value 
  6534. The number in the paragraph style specified. 
  6535.  
  6536. Example 
  6537. FUNCTION Example() 
  6538. Number = Query$("Enter a number to be formatted into the Roman Numeral 
  6539. equivalent:", "1992") 
  6540. Number = FormatSeq$(Number, 3) 
  6541. Message("The Roman Numeral equivalent is ""{Number}"".") 
  6542. END FUNCTION 
  6543.  
  6544. See also: 
  6545.  
  6546.     FormatNum$ 
  6547.     ModifyStyle 
  6548.  
  6549.  
  6550. ΓòÉΓòÉΓòÉ 142. FormatTime ΓòÉΓòÉΓòÉ
  6551.  
  6552. This function takes the time (in seconds) and formats it to a specified style. 
  6553.  
  6554.  
  6555. Syntax 
  6556. FormatTime$(Time, Style) 
  6557. Time is the time to be formatted. 
  6558. Style is one of the formats listed below: 
  6559.     1 - 22:28 
  6560.     2 - 9:00AM 
  6561.     3 - 09:00AM 
  6562.     4 - 9:00A 
  6563.     5 - 09:00A 
  6564.     6 - 9:00am 
  6565.     7 - 09:00am 
  6566.     8 - 9:00a 
  6567.     9 - 09:00a 
  6568.  
  6569. Return Value 
  6570. The time in the format specified. 
  6571.  
  6572. Example 
  6573. FUNCTION Example() 
  6574. Born = Query$("What is your Birthday (MM/DD/YYYY)?") 
  6575. Date = FormatDate$(Now(), "h") 'current date 
  6576. Time = FormatTime$(Now(), 6)   'current time 
  6577. Days = DateDiff(Born, Date) ' how many days old 
  6578. TextDate = FormatDate$(Now(), "d")    'format the date 
  6579. Message("It is now {Time} on {TextDate}. You are {Days} days old.") 
  6580. END FUNCTION 
  6581.  
  6582. See also: 
  6583.  
  6584.     FormatDate$ 
  6585.     InsertDate 
  6586.     Now 
  6587.  
  6588.  
  6589. ΓòÉΓòÉΓòÉ 143. fputs ΓòÉΓòÉΓòÉ
  6590.  
  6591. This function writes a line of ASCII text to the file opened by the fopen 
  6592. function. The line of text is written at the end of the file. When writing a 
  6593. line of text, a carriage return/line feed combination is added to the end of 
  6594. each line before it is written to the file. 
  6595.  
  6596.  
  6597. When using ASCII file functions, be careful to ensure that the file was opened 
  6598. correctly before performing additional ASCII file functions. If the fopen 
  6599. function was unable to open the desired file, unpredictable results can occur 
  6600. if the macro attempts to read or write to that file. 
  6601.  
  6602. Syntax 
  6603. fputs(Handle, Text) 
  6604. Handle is the file handle for the file returned by the fopen function. 
  6605. Text is a line of text to be written to the file. 
  6606.  
  6607. Return Value 
  6608. This function does not return a value. 
  6609.  
  6610. Example 
  6611. FUNCTION Example() 
  6612. amidir = GetAmiDirectory$() 
  6613. ' opens for appending; creates this file if it doesn't exist 
  6614. id = fopen("{amidir}test.txt", "a") 
  6615. IF id = 0 
  6616.     exit function 
  6617. ENDIF 
  6618. Name=Query$("What is your name?") 
  6619. fputs(id, Name) 
  6620. Address= Query$("What is your address?") 
  6621. fwrite(id, Address) 
  6622. fwrite(id, "This is right after the address, with no carriage return.") 
  6623. fclose(id) 
  6624. Exec("E.EXE", "{amidir}TEST.TXT") 
  6625. END FUNCTION 
  6626.  
  6627. See also: 
  6628.  
  6629.     fclose 
  6630.     fgets$ 
  6631.     fopen 
  6632.     fread 
  6633.     fseek 
  6634.     ftell 
  6635.     fwrite 
  6636.  
  6637.  
  6638.  
  6639.  
  6640. ΓòÉΓòÉΓòÉ 144. FrameLayout ΓòÉΓòÉΓòÉ
  6641.  
  6642. This function displays the Modify Frame Layout dialog box. This function is 
  6643. equivalent to choosing Frame Modify Frame Layout. This function does not 
  6644. automatically modify the  frame layout. 
  6645.  
  6646.  
  6647. Syntax 
  6648. FrameLayout() 
  6649.  
  6650. Return Value 
  6651. 1  (TRUE) if the  frame layout was modified. 
  6652. 0  (UserCancel) if the user canceled the function. 
  6653. -2  (GeneralFailure) if the Frame  layout was not modified. 
  6654.  
  6655. Example 
  6656. FUNCTION Example() 
  6657. ' create the frame 
  6658. AddFrame(1440, -1440, 2880, -2880) 
  6659. IF Decide("Do you want to choose the frame layout options?") 
  6660.     FrameLayout() 'frame layout dialog box 
  6661. ELSE 
  6662.     FrameModInit()      'set up for changes 
  6663.     Border = (1440 / 5) 
  6664.     FrameModBorders(1440, 1440, 1440, 1440, Border, Border, Border, Border, 0) 
  6665.     FrameModLines(20, 3, 1, 0, 16777215, 0, 0, 0, 100, 100) 
  6666.     FrameModType(Opaque, 0, "") 
  6667.     FrameModFinish() 'apply changes 
  6668. ENDIF 
  6669. END FUNCTION 
  6670.  
  6671. See also: 
  6672.  
  6673.     AddFrame 
  6674.     AddFrameDlg 
  6675.     BringFrameToFront 
  6676.     FrameModBorders 
  6677.     FrameModColumns 
  6678.     FrameModFinish 
  6679.     FrameModInit 
  6680.     FrameModLines 
  6681.     FrameModType 
  6682.     IsFrameSelected 
  6683.     ModifyLayout 
  6684.     ModifyStyle 
  6685.     SendFrameToBack 
  6686.     SetFrameDefaults 
  6687.  
  6688.  
  6689.  
  6690. ΓòÉΓòÉΓòÉ 145. FrameModBorders ΓòÉΓòÉΓòÉ
  6691.  
  6692. This function allows you to change the size and placement of the selected 
  6693. frame. This function is equivalent to choosing Frame Modify Frame Layout and 
  6694. choosing Size & Pos. 
  6695.  
  6696.  
  6697. You must call the FrameModInit function before using this function. Before the 
  6698. frame modifications take effect, the FrameModFinish function must be called. 
  6699.  
  6700. Syntax 
  6701. FrameModBorders(Width, Height, Top, Left, LeftMargin, TopMargin, RightMargin, 
  6702. BottomMargin, 0) 
  6703. Width is the desired width of the frame. 
  6704. Height is the desired height of the frame. 
  6705. Top is the distance from the top of the page (vertical starting position). 
  6706. Left is the distance from the left side of the page (horizontal starting 
  6707. position). 
  6708. LeftMargin is the desired left margin of the frame. 
  6709. TopMargin is the desired top margin of the frame. 
  6710. RightMargin is the desired right margin of the frame. 
  6711. BottomMargin is the desired bottom margin of the frame. 
  6712. The value for all parameters must be given in twips (1 inch = 1440 twips). 
  6713. Multiply the desired number of inches by 1440 to determine the value in twips. 
  6714.  
  6715. Return Value 
  6716. 1  (TRUE) if the frame was changed. 
  6717. -2  (GeneralFailure) if the frame was not changed. 
  6718.  
  6719. Example 
  6720. FUNCTION Example() 
  6721. ' create the frame 
  6722. AddFrame(1440, -1440, 2880, -2880) 
  6723. IF Decide("Do you want to choose the frame layout options?") 
  6724.     FrameLayout() 'frame layout dialog box 
  6725. ELSE 
  6726.     FrameModInit()      'set up for changes 
  6727.     Border = (1440 / 5) 
  6728.     FrameModBorders(1440, 1440, 1440, 1440, Border, Border, Border, Border, 0) 
  6729.     FrameModLines(20, 3, 1, 0, 16777215, 0, 0, 0, 100, 100) 
  6730.     FrameModType(Opaque, 0, "") 
  6731.     FrameModFinish() 'apply changes 
  6732. ENDIF 
  6733. END FUNCTION 
  6734.  
  6735. See also: 
  6736.  
  6737.     AddFrame 
  6738.     AddFrameDLG 
  6739.     BringFrameToFront 
  6740.     FrameLayout 
  6741.     FrameModColumns 
  6742.     FrameModFinish 
  6743.     FrameModInit 
  6744.     FrameModLines 
  6745.     FrameModType 
  6746.     IsFrameSelected 
  6747.     SendFrameToBack 
  6748.  
  6749.  
  6750.  
  6751.  
  6752. ΓòÉΓòÉΓòÉ 146. FrameModColumns ΓòÉΓòÉΓòÉ
  6753.  
  6754. This function allows you to change the columns and tabs of the selected frame. 
  6755. This function is equivalent to choosing Frame Modify Frame Layout and choosing 
  6756. Cols & Tabs. 
  6757.  
  6758.  
  6759. You must call the FrameModInit function before using this function. Before the 
  6760. frame modifications take effect, the FrameModFinish function must be called. 
  6761.  
  6762. Syntax 
  6763. FrameModColumns(Options, GutterLine, Color, NumCols[, Cols], NumTabs[, Tabs]) 
  6764. Options is a flag parameter and can have one or more of the following values: 
  6765.     (0) - No column balance and no line between columns 
  6766.     (1) - Column balance on 
  6767.     (2) - Line between columns 
  6768. GutterLine determines the type of line between the columns. Available lines 
  6769. styles are: 
  6770.     Hairline (1) - Hairline 
  6771.     OnePoint (2) - One point rule 
  6772.     TwoPoint (3) - Two point rule 
  6773.     ThreePoint (4) - Three point rule 
  6774.     FourPoint (5) - Four point rule 
  6775.     FivePoint (6) - Five point rule 
  6776.     SixPoint (7) - Six point rule 
  6777.     DoubleOnePoint (8) - Parallel one point rules 
  6778.     DoubleTwoPoint (9) - Parallel two point rules 
  6779.     ThreeLines (10) - Hairline above and below a two point rule 
  6780.     HairBelow (11) - Hairline below a three point rule 
  6781.     HairAbove (12) - Hairline above a three point rule 
  6782. Color is the color of the line between the columns and can be one of the 
  6783. following: 
  6784.     White (16777215) - White 
  6785.     Cyan (16776960) - Light blue 
  6786.     Yellow (65535) - Yellow 
  6787.     Magenta (16711935) - Purple 
  6788.     Green (65280) - Green 
  6789.     Red (255) - Red 
  6790.     Blue (16711680) - Blue 
  6791.     Black (0) - Black 
  6792.     DarkGray (12566463) - 90% gray scale 
  6793.     MediumGray (8355711) - 50% gray scale 
  6794.     LightGray (4144959) - 20% gray scale 
  6795.     VeryLightGray (1644825) - 10% gray scale 
  6796. NumCols is the number of columns to use in the frame. 
  6797. Cols are pairs of numbers that represent the twip offset to the left and right 
  6798. margin for each column. There should be a pair of offsets for each column. 
  6799. NumTabs is how many tab pairs follow. The pairs are the type of tabs, followed 
  6800. by the offset from the left margin. 
  6801. Tabs are pairs of numbers that represent the type of tab and its offset from 
  6802. the left margin. The tab type can be one of the following: 
  6803.     TabLeft (1) - Left tab 
  6804.     TabCenter (2) - Center tab 
  6805.     TabRight (3) - Right tab 
  6806.     TabNumeric (4) - Numeric tab 
  6807. You can enter one of the following values, using the bitwise operator OR (|): 
  6808.     0x4000 - for dashed leaders 
  6809.     0x8000 - for dot leaders 
  6810.     0xc000 - for underline leaders 
  6811.  
  6812. Return Value 
  6813. 1  (TRUE) if the lines are modified. 
  6814. -2  (GeneralFailure) if the lines are not modified. 
  6815.  
  6816. Example 
  6817. FUNCTION Example() 
  6818. AddFrame(1440 -1440 2880 -2880) 
  6819. FrameModInit() 
  6820. ' no column, no lines between columns, one point rule gutter line 
  6821. ' black line between columns, one column, no tabs 
  6822. FrameModColumns(0 2 0 1 48 -176 0) 
  6823. FrameModFinish() 
  6824. END FUNCTION 
  6825.  
  6826. See also: 
  6827.  
  6828.     AddFrame 
  6829.     AddFrameDlg 
  6830.     BringFrameToFront 
  6831.     FrameLayout 
  6832.     FrameModBorders 
  6833.     FrameModFinish 
  6834.     FrameModInit 
  6835.     FrameModLines 
  6836.     FrameModType 
  6837.     IsFrameSelected 
  6838.     SendFrameToBack 
  6839.  
  6840.  
  6841. ΓòÉΓòÉΓòÉ 147. FrameModFinish ΓòÉΓòÉΓòÉ
  6842.  
  6843. This function applies all of your changes made when modifying the frame layout. 
  6844. This function is the last of a series of functions recorded when modifying the 
  6845. frame layout through Frame Modify Frame Layout. This function is equivalent to 
  6846. accepting changes entered by choosing Frame Modify Frame Layout. 
  6847.  
  6848.  
  6849. You must call the FrameModInit function before you call FrameModFinish. 
  6850.  
  6851. Syntax 
  6852. FrameModFinish() 
  6853.  
  6854. Return Value 
  6855. 1  (TRUE) if the frame was changed. 
  6856. -2  (GeneralFailure) if the frame was not changed. 
  6857.  
  6858. Example 
  6859. FUNCTION Example() 
  6860. ' create the frame 
  6861. AddFrame(1440, -1440, 2880, -2880) 
  6862. IF Decide("Do you want to choose the frame layout options?") 
  6863.     FrameLayout() 'frame layout dialog box 
  6864. ELSE 
  6865.     FrameModInit()      'set up for changes 
  6866.     Border = (1440 / 5) 
  6867.     FrameModBorders(1440, 1440, 1440, 1440, Border, Border, Border, Border, 0) 
  6868.     FrameModLines(20, 3, 1, 0, 16777215, 0, 0, 0, 100, 100) 
  6869.     FrameModType(Opaque, 0, "") 
  6870.     FrameModFinish() 'apply changes 
  6871. ENDIF 
  6872. END FUNCTION 
  6873.  
  6874. See also: 
  6875.  
  6876.     AddFrame 
  6877.     AddFrameDLG 
  6878.     BringFrameToFront 
  6879.     FrameLayout 
  6880.     FrameModBorders 
  6881.     FrameModInit 
  6882.     FrameModLines 
  6883.     FrameModType 
  6884.     IsFrameSelected 
  6885.     SendFrameToBack 
  6886.  
  6887.  
  6888. ΓòÉΓòÉΓòÉ 148. FrameModInit ΓòÉΓòÉΓòÉ
  6889.  
  6890. This function prepares Ami Pro to accept changes to the currently selected 
  6891. frame when modifying the frame layout. This function is equivalent to 
  6892. initializing changes made when choosing Frame Modify Frame Layout. 
  6893.  
  6894.  
  6895. You must have a frame selected before calling this function. 
  6896.  
  6897. You must call the FrameModFinish function after you call FrameModInit. 
  6898.  
  6899. Syntax 
  6900. FrameModInit() 
  6901.  
  6902. Return Value 
  6903. 1 (TRUE) if the frame was changed. 
  6904. -6  (NoMemory) if the function failed because of insufficient memory. 
  6905.  
  6906. Example 
  6907. FUNCTION Example() 
  6908. ' create the frame 
  6909. AddFrame(1440, -1440, 2880, -2880) 
  6910. IF Decide("Do you want to choose the frame layout options?") 
  6911.     FrameLayout() 'frame layout dialog box 
  6912. ELSE 
  6913.     FrameModInit()      'set up for changes 
  6914.     Border = (1440 / 5) 
  6915.     FrameModBorders(1440, 1440, 1440, 1440, Border, Border, Border, Border, 0) 
  6916.     FrameModLines(20, 3, 1, 0, 16777215, 0, 0, 0, 100, 100) 
  6917.     FrameModType(Opaque, 0, "") 
  6918.     FrameModFinish() 'apply changes 
  6919. ENDIF 
  6920. END FUNCTION 
  6921.  
  6922. See also: 
  6923.  
  6924.     AddFrame 
  6925.     AddFrameDLG 
  6926.     BringFrameToFront 
  6927.     FrameLayout 
  6928.     FrameModBorders 
  6929.     FrameModFinish 
  6930.     FrameModLines 
  6931.     FrameModType 
  6932.     IsFrameSelected 
  6933.     SendFrameToBack 
  6934.  
  6935.  
  6936. ΓòÉΓòÉΓòÉ 149. FrameModLines ΓòÉΓòÉΓòÉ
  6937.  
  6938. This function applies modifications to the lines around, the background color, 
  6939. the shadow color, and the shadow placement of the selected frame. This function 
  6940. is equivalent to choosing Frame Modify Frame Layout and choosing Lines & 
  6941. shadows. 
  6942.  
  6943.  
  6944. You must call the FrameModInit function before you use this function. Before 
  6945. the frame modifications take effect, the FrameModFinish function must be 
  6946. called. 
  6947.  
  6948. Syntax 
  6949. FrameModLines(BorderWhere, PosType, ThickType, ShadeType, BackType, 
  6950. ShadowColor, ShadowLeft, ShadowTop, ShadowRight, ShadowBottom) 
  6951. BorderWhere is the lines around a frame. It is one of the following values: 
  6952.     1 - All 
  6953.     2 - Left 
  6954.     4 - Right 
  6955.     8 - Top 
  6956.     16 - Bottom 
  6957. PosType is the position of the border around a frame. It is one of the 
  6958. following values: 
  6959.     1 - Middle 
  6960.     2 - Inside 
  6961.     3 - Outside 
  6962.     4 - Close to inside 
  6963.     5 - Close to outside 
  6964. You can only choose one value for the PosType parameter. 
  6965. ThickType is the thickness of the border. It is one of the following values: 
  6966.     Hairline (1) - Hairline 
  6967.     OnePoint (2) - One point rule 
  6968.     TwoPoint (3) - Two point rule 
  6969.     ThreePoint (4) - Three point rule 
  6970.     FourPoint (5) - Four point rule 
  6971.     FivePoint (6) - Five point rule 
  6972.     SixPoint (7) - Six point rule 
  6973.     DoubleOnePoint (8) - Parallel one point rule 
  6974.     DoubleTwoPoint (9) - Parallel two point rule 
  6975.     ThreeLines (10) - Hairline above and below a two point rule 
  6976.     HairBelow (11) - Hairline below a three point rule 
  6977.     HairAbove (12) - Hairline above a three point rule 
  6978. ShadeType sets the line color. It can be one of the following values: 
  6979.     Black - 0 
  6980.     Blue - 16727905 
  6981.     Cyan - 16776960 
  6982.     Green - 65280 
  6983.     Magenta - 16711935 
  6984.     MedBlue - 16744448 
  6985.     Orange - 33279 
  6986.     Pink - 8388863 
  6987.     Purple - 16711809 
  6988.     Red - 255 
  6989.     White - 16777215 
  6990.     Yellow - 65535 
  6991. BackType sets the background color. It can be one of the values listed under 
  6992. ShadeType. 
  6993. ShadowColor sets the color for the frame shadow. It can be one of the values 
  6994. listed under ShadeType. 
  6995. ShadowLeft is the distance that the shadow is offset from the left side of the 
  6996. frame in twips (1 inch = 1440 twips). It can be one of the following values or 
  6997. a custom value: 
  6998.     None (0) - No shadow 
  6999.     Shallow (57) - Shallow shadow 
  7000.     Normal (100) - Normal shadow 
  7001.     Deep (172) - Deep shadow 
  7002. ShadowTop is the distance that the shadow is offset from the top of the frame 
  7003. in twips (1 inch = 1440 twips). It can be one of the values listed under 
  7004. ShadowLeft or a custom value. 
  7005. ShadowRight is the distance that the shadow is offset from the right side of 
  7006. the frame in twips (1 inch = 1440 twips). It can be one of the values listed 
  7007. under ShadowLeft or a custom value. 
  7008. ShadowBottom is the distance that the shadow is offset from the bottom of the 
  7009. frame in twips (1 inch = 1440 twips). It can be one of the values listed under 
  7010. ShadowLeft or a custom value. 
  7011.  
  7012. Return Value 
  7013. 1  (TRUE) if the lines are modified. 
  7014. -2  (GeneralFailure) if the lines are not modified. 
  7015.  
  7016. Example 
  7017. FUNCTION Example() 
  7018. ' create the frame 
  7019. AddFrame(1440, -1440, 2880, -2880) 
  7020. IF Decide("Do you want to choose the frame layout options?") 
  7021.     FrameLayout() 'frame layout dialog box 
  7022. ELSE 
  7023.     FrameModInit()      'set up for changes 
  7024.     Border = (1440 / 5) 
  7025.     FrameModBorders(1440, 1440, 1440, 1440, Border, Border, Border, Border, 0) 
  7026.     FrameModLines(20, 3, 1, 0, 16777215, 0, 0, 0, 100, 100) 
  7027.     FrameModType(Opaque, 0, "") 
  7028.     FrameModFinish() 'apply changes 
  7029. ENDIF 
  7030. END FUNCTION 
  7031.  
  7032. See also: 
  7033.  
  7034.     AddFrame 
  7035.     AddFrameDLG 
  7036.     FrameLayout 
  7037.     FrameModBorders 
  7038.     FrameModFinish 
  7039.     FrameModInit 
  7040.     FrameModType 
  7041.     IsFrameSelected 
  7042.  
  7043.  
  7044. ΓòÉΓòÉΓòÉ 150. FrameModType ΓòÉΓòÉΓòÉ
  7045.  
  7046. This function allows you to set the options for wrapping, placement, and 
  7047. roundness of the frame. You can also set any macro that is associated with the 
  7048. selected frame. This function is equivalent to choosing Frame Modify Frame 
  7049. Layout and choosing Type. 
  7050.  
  7051.  
  7052. You must call the FrameModInit function before calling this function. Before 
  7053. the frame modifications take effect, the FrameModFinish function must be 
  7054. called. 
  7055.  
  7056. Syntax 
  7057. FrameModType(Type, Rounded, MacroName) 
  7058. Type is a setting based on how the text should wrap around a frame, whether a 
  7059. frame is transparent or opaque, where it is placed on a page, and whether a 
  7060. macro is assigned to a frame. It is one of the following values: 
  7061.     TextFrame (512) - Is always used in combination with other values. It is a 
  7062.     required value. 
  7063.     Opaque (64) - Hides text or picture behind frame. 
  7064.     Transparent(0) - Displays text or pictures behind frame. 
  7065.     Wraparound (128) - Displays text above, below, to the left, or to the right 
  7066.     of the frame. 
  7067.     NoWrapBeside (131072) - Displays text above and below frame, but not to the 
  7068.     left or right of the frame. 
  7069.     If you do not specify Wraparound or NoWrapBeside, the frame uses the 
  7070.     default setting of no wrap around. 
  7071.     AnchorFrame (524288) - Used to anchor frame in its current position or to a 
  7072.     carriage return. You can not use any repeat values with this value. 
  7073.     RepeatFrame (256) - Repeats frame on multiple pages. To repeat on all 
  7074.     pages, do not use in combination with RepeatEven or RepeatOdd. 
  7075.     RepeatEven (4194304) - Repeats frame on even pages. Use with the 
  7076.     RepeatFrame value. 
  7077.     RepeatOdd (8192) - Repeats frame on odd pages. Use with the RepeatFrame 
  7078.     value. 
  7079.     Borders (65536) - Uses if frame has borders. 
  7080.     RunMacro (134217728) - Executes a macro each time the frame is selected. 
  7081. You can add the values together to get the Type parameter. For example, 
  7082. FrameModeType(Opaque+TextFrame, 0, ""), or FrameModeType(576, 0, ""). 
  7083. Rounded is the percentage that the corners are rounded (0% = square and 100% = 
  7084. circle). 
  7085. MacroName is the name of the macro to run when the frame is selected. 
  7086.  
  7087. Return Value 
  7088. 1  (TRUE) if the frame was modified. 
  7089. -2  (GeneralFailure) if the frame was not modified. 
  7090.  
  7091. Example 
  7092. FUNCTION Example() 
  7093. ' create the frame 
  7094. AddFrame(1440, -1440, 2880, -2880) 
  7095. IF Decide("Do you want to choose the frame layout options?") 
  7096.     FrameLayout() 'frame layout dialog box 
  7097. ELSE 
  7098.     FrameModInit()      'set up for changes 
  7099.     Border = (1440 / 5) 
  7100.     FrameModBorders(1440, 1440, 1440, 1440, Border, Border, Border, Border, 0) 
  7101.     FrameModLines(20, 3, 1, 0, 16777215, 0, 0, 0, 100, 100) 
  7102.     FrameModType(Opaque, 0, "") 
  7103.     FrameModFinish() 'apply changes 
  7104. ENDIF 
  7105. END FUNCTION 
  7106.  
  7107. See also: 
  7108.  
  7109.     AddFrame 
  7110.     AddFrameDLG 
  7111.     FrameLayout 
  7112.     FrameModBorders 
  7113.     FrameModFinish 
  7114.     FrameModInit 
  7115.     FrameModLines 
  7116.     IsFrameSelected 
  7117.  
  7118.  
  7119. ΓòÉΓòÉΓòÉ 151. fread ΓòÉΓòÉΓòÉ
  7120.  
  7121. This function reads a specified number of bytes from the open file. This 
  7122. function is not line oriented. 
  7123.  
  7124.  
  7125. When using ASCII file functions, ensure that the file was opened correctly 
  7126. before performing additional ASCII file functions. If the fopen function was 
  7127. unable to open the desired file, unpredictable results can occur if the macro 
  7128. attempts to read or write to that file. If you are reading binary information, 
  7129. zeroes can confuse this function. You must read binary files one byte at a 
  7130. time. If the empty string ("") is returned, it indicates a binary zero. 
  7131.  
  7132. Syntax 
  7133. fread(Handle, Length) 
  7134. Handle is the file ID returned by the fopen function. 
  7135. Len is the number of bytes to read from the file. 
  7136.  
  7137. Return Value 
  7138. The data requested from the file. 
  7139. -1  if the file pointer is at the end of the file. 
  7140.  
  7141. Example 
  7142. FUNCTION Example() 
  7143. DEFSTR string; 
  7144. id = fopen("test.txt", "w") 
  7145. IF id != 0 
  7146.     Name = Query$("What is your name?") 
  7147.     fwrite(id, Name) 
  7148.     fwrite(id, BracketsToBin([Enter])) 
  7149.     fputs(id, Query$("What is your address?")) 
  7150.     fclose(id) 
  7151. ENDIF 
  7152. Exec("NOTEPAD.EXE", "TEST.TXT") 
  7153. UserControl("Click Resume to continue...") 
  7154. AppClose("Editor - TEST.TXT") 
  7155. id2 = fopen("test.txt", "r") 
  7156. IF id2 != 0 
  7157.     NameLength = len(Name) 
  7158.     fseek(id2, 0, 0) 
  7159.     Name = fread(id2, NameLength) 
  7160.     EnterKey = BinToBrackets(fread(id2, 2)) 
  7161.     AddressBegins = ftell(id2) 
  7162.     Address = fgets$(id2) 
  7163.     Message("Your name is {Name}.") 
  7164.     Message("Your address is {Address}.") 
  7165.     Message("EnterKey = {EnterKey}") 
  7166.     Message("The address begins at the {AddressBegins} byte.") 
  7167.     fclose(id2) 
  7168. ENDIF 
  7169. END FUNCTION 
  7170.  
  7171. See also: 
  7172.  
  7173.     BinToBrackets 
  7174.     BracketsToBin 
  7175.     fclose 
  7176.     fopen 
  7177.     fseek 
  7178.     ftell 
  7179.     fwrite 
  7180.  
  7181.  
  7182. ΓòÉΓòÉΓòÉ 152. FreeGlobalVar ΓòÉΓòÉΓòÉ
  7183.  
  7184. This function frees allocated memory assigned to a global variable. Global 
  7185. variables retain their values until they are freed or you exit Ami Pro, as 
  7186. opposed to regular variables, which are lost once the function they were 
  7187. created in is finished. 
  7188.  
  7189.  
  7190. Syntax 
  7191. FreeGlobalVar(Name) 
  7192. Name is the string or number of the existing global variable being freed. 
  7193.  
  7194. Return Value 
  7195. 1  (TRUE) if the global variable was successfully freed. 
  7196. 0  (FALSE) if no global variable with the requested ID number or name exists. 
  7197.  
  7198. Example 
  7199. FUNCTION Example() 
  7200. AllocGlobalVar("Name", 1) 
  7201. AllocGlobalVar("Computer", 1) 
  7202. AllocGlobalVar("Software", 1) 
  7203. Name = Query$("What is your name?") 
  7204. Computer= Query$("What kind of computer do you have?") 
  7205. Software= Query$("What is your favorite piece of software?") 
  7206. SetGlobalVar("Name", Name) 
  7207. SetGlobalVar("Computer", Computer) 
  7208. SetGlobalVar("Software", Software) 
  7209. CALL Example2()'Call the following function 
  7210. END FUNCTION 
  7211.  
  7212. FUNCTION Example2() 
  7213. NumGlobs=GetGlobalVarCount() 
  7214. DIM TempArray(Numglobs) 
  7215. GetGlobalVarNames(&TempArray) 
  7216. FOR i = 1 to NumGlobs 
  7217.     VarName=TempArray(i) 
  7218.     VarContents=GetGlobalVar$(VarName) 
  7219.     TYPE ("Item {i}, {VarName}, is {VarContents}.[ENTER]") 
  7220.     FreeGlobalVar(VarName) 
  7221. NEXT 
  7222. END FUNCTION 
  7223.  
  7224. See also: 
  7225.  
  7226.     AllocGlobalVar 
  7227.     GetGlobalArray$ 
  7228.     GetGlobalVar$ 
  7229.     SetGlobalArray 
  7230.     SetGlobalVar 
  7231.     Using Variables 
  7232.  
  7233.  
  7234.  
  7235.  
  7236. ΓòÉΓòÉΓòÉ 153. fseek ΓòÉΓòÉΓòÉ
  7237.  
  7238. This function moves the file pointer to another location in the file. The file 
  7239. pointer is the location in the file from which the next text is read. 
  7240.  
  7241.  
  7242. The fseek function only works reliably when seeking to a location that is zero 
  7243. bytes from one of the starting locations, or to a location that is a value 
  7244. returned by the ftell function, starting from the beginning of the file. 
  7245.  
  7246. When using ASCII file functions, ensure that the file was opened correctly 
  7247. before performing additional ASCII file functions. If the fopen function was 
  7248. unable to open the desired file, unpredictable results can occur if the macro 
  7249. attempts to read or write to that file. 
  7250.  
  7251. Syntax 
  7252. fseek(Handle, Location, StartPoint) 
  7253. Handle is the file handle for the file returned by the fopen function. 
  7254. Location is the number of characters to move the file pointer. It must be a 
  7255. positive integer. 
  7256. StartPoint is the offset in the file to begin moving the file pointer from. 
  7257. Possible offsets are: 
  7258.     FBegin (0) - The start of the file 
  7259.     FCurrent (1) - The current file pointer location 
  7260.     FEnd (2) - The end of the file 
  7261.  
  7262. Return Value 
  7263. This function does not return a value. 
  7264.  
  7265. Example 
  7266. FUNCTION Example() 
  7267. file = Query$("find size of which file?") 
  7268. id = fopen(file, "r")   'fopen file read-only 
  7269. fseek(id, 0, 2)   'seek to the end of the file 
  7270. pos = ftell(id)   'report position of pointer 
  7271. Message("Size of {file} is {pos} bytes.") 
  7272. END FUNCTION 
  7273.  
  7274. See also: 
  7275.  
  7276.     fclose 
  7277.     fgets$ 
  7278.     fopen 
  7279.     fputs 
  7280.     fread 
  7281.     ftell 
  7282.     fwrite 
  7283.  
  7284.  
  7285.  
  7286.  
  7287.  
  7288. ΓòÉΓòÉΓòÉ 154. ftell ΓòÉΓòÉΓòÉ
  7289.  
  7290. This function finds the location of the file pointer in the currently open 
  7291. file. The file pointer is the location in the file where the next text is read 
  7292. from or where the previous text was written to. 
  7293.  
  7294.  
  7295. When using ASCII file functions, be careful to ensure that the file was opened 
  7296. correctly before performing additional ASCII file functions. If the fopen 
  7297. function was unable to open the desired file, unpredictable results can occur 
  7298. if the macro attempts to read or write to that file. 
  7299.  
  7300. Syntax 
  7301. ftell(Handle) 
  7302. Handle is the file handle for the file returned by the fopen function. 
  7303.  
  7304. Return Value 
  7305. The current location in the file. 
  7306.  
  7307. Example 
  7308. FUNCTION Example() 
  7309. file = Query$("find size of which file?") 
  7310. id = fopen(file, "r")   'fopen file read-only 
  7311. fseek(id, 0, 2)   'seek to the end of the file 
  7312. pos = ftell(id)   'report position of pointer 
  7313. Message("Size of {file} is {pos} bytes.") 
  7314. END FUNCTION 
  7315.  
  7316. See also: 
  7317.  
  7318.     fclose 
  7319.     fgets$ 
  7320.     fopen 
  7321.     fputs 
  7322.     fread 
  7323.     fseek 
  7324.     fwrite 
  7325.  
  7326.  
  7327.  
  7328.  
  7329. ΓòÉΓòÉΓòÉ 155. FullPageView ΓòÉΓòÉΓòÉ
  7330.  
  7331. This function changes the current view level to Full Page View. This function 
  7332. is equivalent to choosing View Full Page. 
  7333.  
  7334.  
  7335. You must be in Layout Mode to call this function. 
  7336.  
  7337. Syntax 
  7338. FullPageView() 
  7339.  
  7340. Return Value 
  7341. This function returns 1. 
  7342.  
  7343. Example 
  7344. FUNCTION Example() 
  7345. FullPageView() 
  7346. END FUNCTION 
  7347.  
  7348. See also: 
  7349.  
  7350.     CustomView 
  7351.     EnlargedView 
  7352.     FacingView 
  7353.     GetViewLevel 
  7354.     LayoutMode 
  7355.     StandardView 
  7356.  
  7357.  
  7358. ΓòÉΓòÉΓòÉ 156. fwrite ΓòÉΓòÉΓòÉ
  7359.  
  7360. This function writes data to the open file. Unlike the fputs function, this one 
  7361. does not append a carriage return/line feed to the end of the file and is not 
  7362. line oriented. 
  7363.  
  7364.  
  7365. When using ASCII file functions, be careful to ensure that the file was opened 
  7366. correctly before performing additional ASCII file functions. If the fopen 
  7367. function was unable to open the desired file, unpredictable results can occur 
  7368. if the macro attempts to read or write to that file. 
  7369.  
  7370. Syntax 
  7371. fwrite(Handle, Data[, Length]) 
  7372. Handle is the file ID handle returned by the fopen function. 
  7373. Data is the string data to place in the file. 
  7374. Len is the optional length of the string to send. If Len is less than the 
  7375. actual length of the string data, the data is cut off at the Len position. If 
  7376. Len is greater than the length of the string data, the remaining positions are 
  7377. padded with spaces. 
  7378.  
  7379. Return Value 
  7380. This function does not return a value. 
  7381.  
  7382. Example 
  7383. FUNCTION Example() 
  7384. amidir = GetAmiDirectory$() 
  7385. ' opens for appending; creates this file if it doesn't exist 
  7386. id = fopen("{amidir}test.txt", "a") 
  7387. IF id = 0 
  7388.     exit function 
  7389. ENDIF 
  7390. Name=Query$("What is your name?") 
  7391. fputs(id, Name) 
  7392. Address= Query$("What is your address?") 
  7393. fwrite(id, Address) 
  7394. fwrite(id, "This is right after the address, with no carriage return.") 
  7395. fclose(id) 
  7396. Exec("E.EXE", "{amidir}TEST.TXT") 
  7397. END FUNCTION 
  7398.  
  7399. See also: 
  7400.  
  7401.     BinToBrackets 
  7402.     BracketsToBin 
  7403.     fclose 
  7404.     fopen 
  7405.     fputs 
  7406.     fread 
  7407.     fseek 
  7408.     ftell 
  7409.     fwrite 
  7410.  
  7411.  
  7412. ΓòÉΓòÉΓòÉ 157. Generate ΓòÉΓòÉΓòÉ
  7413.  
  7414. This function generates a table of contents and/or an index for the current 
  7415. document. This function is equivalent to choosing Tools Generate TOC or Tools 
  7416. Generate Index. You need to specify an output file and Options before you can 
  7417. generate a TOC using this function. You need to specify an output file and 
  7418. whether to use Alphabetical separators before you can generate an Index using 
  7419. this function. 
  7420.  
  7421.  
  7422. To set the output file for the table of contents, use the SetTOCFile function 
  7423. prior to calling Generate. To set the output file for the index, use the 
  7424. SetIndexFile function prior to calling Generate. 
  7425.  
  7426. Syntax 
  7427. Generate(Which) 
  7428. Which may be one of the following: 
  7429.     GenTOC (101) - Generate the TOC 
  7430.     GenIndex (102) - Generate the Index 
  7431.     GenBoth (100) - Generate both the TOC and the Index 
  7432. This parameter can be zero. If you are in a master document, no index or TOC is 
  7433. generated. The files open and the page numbers update. 
  7434.  
  7435. To display the dialog box and allow the user to decide which table(s) to 
  7436. generate: Generate 
  7437.  
  7438. Return Value 
  7439. 1   (TRUE) if the table was generated. 
  7440. 0   (UserCancel) if the user canceled the function. 
  7441.  -2  (GeneralFailure) if the table could not be generated. 
  7442.  
  7443. Example 
  7444. FUNCTION Example() 
  7445. Generate(100) 
  7446. END FUNCTION 
  7447.  
  7448. See also: 
  7449.  
  7450.     MarkIndexWord 
  7451.     SetIndexFile 
  7452.     SetTOCFile 
  7453.  
  7454.  
  7455. ΓòÉΓòÉΓòÉ 158. GetAmiDirectory ΓòÉΓòÉΓòÉ
  7456.  
  7457. This function returns the path from which Ami Pro is currently running. 
  7458.  
  7459.  
  7460. Syntax 
  7461. GetAmiDirectory$() 
  7462.  
  7463. Return Value 
  7464. A string containing the path where Ami Pro is currently running, with a 
  7465. trailing backslash. 
  7466.  
  7467. Example 
  7468. FUNCTION Example() 
  7469. AmiDir = GetAmiDirectory$() 
  7470. CurDir = GetCurrentDir$() 
  7471. DocPath = GetDocPath$() 
  7472. StylePath = GetStylePath$() 
  7473. MacPath = GetMacPath$() 
  7474. Message("Ami Pro is in {AmiDir}.") 
  7475. Message("DOS reports the current directory is {CurDir}.") 
  7476. Message("Ami Pro's default doc path is {DocPath}.") 
  7477. Message("Ami Pro's default macro path is {MacPath}.") 
  7478. Message("Ami Pro's default style path is {StylePath}.") 
  7479. END FUNCTION 
  7480.  
  7481. See also: 
  7482.  
  7483.     GetBackPath$ 
  7484.     GetDocPath$ 
  7485.     GetHomeDirectory$ 
  7486.     GetMacPath$ 
  7487.     GetStylePath$ 
  7488.  
  7489.  
  7490. ΓòÉΓòÉΓòÉ 159. GetBackPath ΓòÉΓòÉΓòÉ
  7491.  
  7492. This function returns the default path for backup files. 
  7493.  
  7494.  
  7495. Syntax 
  7496. GetBackPath$() 
  7497.  
  7498. Return Value 
  7499. A string with the current default document backup path, with a trailing 
  7500. backslash. 
  7501.  
  7502. Example 
  7503. FUNCTION Example() 
  7504. AmiDir = GetAmiDirectory$() 
  7505. CurDir = GetCurrentDir$() 
  7506. DocPath = GetDocPath$() 
  7507. StylePath = GetStylePath$() 
  7508. BackPath = GetBackPath$() 
  7509. MacPath = GetMacPath$() 
  7510. Message("Ami Pro is in {AmiDir}.") 
  7511. Message("DOS reports the current directory is {CurDir}.") 
  7512. Message("Ami Pro's default doc path is {DocPath}.") 
  7513. Message("Ami Pro's default macro path is {MacPath}.") 
  7514. Message("Ami Pro's default style path is {StylePath}.") 
  7515. Message("Ami Pro's default backup path is {BackPath}.") 
  7516. END FUNCTION 
  7517.  
  7518. See also: 
  7519.  
  7520.     GetAmiDirectory$ 
  7521.     GetCurrentDir$ 
  7522.     GetDocPath$ 
  7523.     GetHomeDirectory$ 
  7524.     GetMacPath$ 
  7525.     GetStylePath$ 
  7526.     SetBackPath 
  7527.     SetDocPath 
  7528.     SetStylePath 
  7529.  
  7530.  
  7531.  
  7532. ΓòÉΓòÉΓòÉ 160. GetBookMarkCount ΓòÉΓòÉΓòÉ
  7533.  
  7534. This function is used to dimension the arrays for the GetBookMarkNames 
  7535. function. 
  7536.  
  7537.  
  7538. Syntax 
  7539. GetBookMarkCount() 
  7540.  
  7541. Return Value 
  7542. The number of bookmarks in the current document. 
  7543.  
  7544. Example 
  7545. FUNCTION Example() 
  7546. MacFile = GetRunningMacroFile$() 
  7547. Count = GetBookMarkCount() 
  7548. IF Count > 0 
  7549.     DIM BookMarks(Count) 
  7550.     GetBookMarkNames(&BookMarks) 
  7551.     DeleteMenu(1, "&BookMarks") 
  7552.     AddMenu(1, "&BookMarks") 
  7553.     FOR I = 1 to Count 
  7554.        ThisBookMark = BookMarks(I) 
  7555.        AddMenuItem(1, "&BookMarks", ThisBookMark, "{MacFile}!Example2( 
  7556.  {ThisBookMark})", ThisBookMark) 
  7557.     NEXT 
  7558. ELSE 
  7559.     Message("No bookmarks in this document!") 
  7560. ENDIF 
  7561. END FUNCTION 
  7562.  
  7563. FUNCTION Example2(Bkmk) 
  7564. BookPage = GetBookMarkPage(Bkmk) 
  7565. Message("Now going to {Bkmk} on page {BookPage}.") 
  7566. MarkBookMark(Bkmk, FindBookMark) 
  7567. END FUNCTION 
  7568.  
  7569. See also: 
  7570.  
  7571.     GetBookMarkNames 
  7572.     GoToCmd 
  7573.     MarkBookMark 
  7574.  
  7575.  
  7576.  
  7577.  
  7578.  
  7579. ΓòÉΓòÉΓòÉ 161. GetBookMarkNames ΓòÉΓòÉΓòÉ
  7580.  
  7581. This function shows the names of the arrays that are to receive the bookmark 
  7582. names. 
  7583.  
  7584.  
  7585. Syntax 
  7586. GetBookMarkNames(&Array) 
  7587. &Array is the names of the arrays. Note the use of indirection (&). 
  7588.  
  7589. Return Value 
  7590. The number of bookmark names. 
  7591.  
  7592. Example 
  7593. FUNCTION Example() 
  7594. MacFile = GetRunningMacroFile$() 
  7595. Count = GetBookMarkCount() 
  7596. IF Count > 0 
  7597.     DIM BookMarks(Count) 
  7598.     GetBookMarkNames(&BookMarks) 
  7599.     DeleteMenu(1, "&BookMarks") 
  7600.     AddMenu(1, "&BookMarks") 
  7601.     FOR I = 1 to Count 
  7602.        ThisBookMark = BookMarks(I) 
  7603.        AddMenuItem(1, "&BookMarks", ThisBookMark, "{MacFile}!Example2( 
  7604.  {ThisBookMark})", ThisBookMark) 
  7605.     NEXT 
  7606. ELSE 
  7607.     Message("No bookmarks in this document!") 
  7608. ENDIF 
  7609. END FUNCTION 
  7610.  
  7611. FUNCTION Example2(Bkmk) 
  7612. BookPage = GetBookMarkPage(Bkmk) 
  7613. Message("Now going to {Bkmk} on page {BookPage}.") 
  7614. MarkBookMark(Bkmk, FindBookMark) 
  7615. END FUNCTION 
  7616.  
  7617. See also: 
  7618.  
  7619.     GetBookMarkCount 
  7620.     GoToCmd 
  7621.     MarkBookMark 
  7622.  
  7623.  
  7624.  
  7625. ΓòÉΓòÉΓòÉ 162. GetBookMarkPage ΓòÉΓòÉΓòÉ
  7626.  
  7627. This function finds the page number where the specified bookmark begins. This 
  7628. number is relative only to the current document. If the file is one file of a 
  7629. master document, you must use the PhysicalToLogical function to determine the 
  7630. printed page number. 
  7631.  
  7632.  
  7633. Syntax 
  7634. GetBookMarkPage(Name) 
  7635. Name is the name of the bookmark (in the current document) whose page you want 
  7636. to find. 
  7637.  
  7638. Return Value 
  7639. The page number on which the specified bookmark begins. 
  7640. -2  if the bookmark could not be found. 
  7641.  
  7642. Example 
  7643. FUNCTION Example() 
  7644. MacFile = GetRunningMacroFile$() 
  7645. Count = GetBookMarkCount() 
  7646. IF Count > 0 
  7647.     DIM BookMarks(Count) 
  7648.     GetBookMarkNames(&BookMarks) 
  7649.     DeleteMenu(1, "&BookMarks") 
  7650.     AddMenu(1, "&BookMarks") 
  7651.     FOR I = 1 to Count 
  7652.        ThisBookMark = BookMarks(I) 
  7653.        AddMenuItem(1, "&BookMarks", ThisBookMark, "{MacFile}!Example2( 
  7654.  {ThisBookMark})", ThisBookMark) 
  7655.     NEXT 
  7656. ELSE 
  7657.     Message("No bookmarks in this document!") 
  7658. ENDIF 
  7659. END FUNCTION 
  7660.  
  7661. FUNCTION Example2(Bkmk) 
  7662. BookPage = GetBookMarkPage(Bkmk) 
  7663. Message("Now going to {Bkmk} on page {BookPage}.") 
  7664. MarkBookMark(Bkmk, FindBookMark) 
  7665. END FUNCTION 
  7666.  
  7667. See also: 
  7668.  
  7669.     GetBookMarkNames 
  7670.     GetBookMarkCount 
  7671.     GetPageNo 
  7672.     GoToCmd 
  7673.     MarkBookMark 
  7674.     PhysicalToLogical 
  7675.  
  7676.  
  7677.  
  7678.  
  7679.  
  7680. ΓòÉΓòÉΓòÉ 163. GetCurFontInfo ΓòÉΓòÉΓòÉ
  7681.  
  7682. This function returns information about the current font at the insertion 
  7683. point. 
  7684.  
  7685.  
  7686. Syntax 
  7687. GetCurFontInfo(&Name, &Color, &Size, &PitchFamily) 
  7688. Name is the name of the font. 
  7689. Color is the color of the font. 
  7690. Size is the size of the font in twips (1 inch = 1440 twips). 
  7691. PitchFamily is the bit value containing Pitch and Family. To extract these, use 
  7692. the bitwise operator OR (|). 
  7693. Note the use of indirection (&). 
  7694.  
  7695. Return Value 
  7696. This function does not return a value. 
  7697.  
  7698. Example 
  7699. FUNCTION Example() 
  7700. DEFSTR Name, Color, Size, Family; 
  7701. ' get the current font information 
  7702. GetCurFontInfo(&Name, &Color, &Size, &Family) 
  7703. ' increase pointsize by two and calculate the twips 
  7704. Size = ((Size / 20) + 2) * 20 
  7705. ' change font 
  7706. FontChange(Name, Family, Color, Size) 
  7707. END FUNCTION 
  7708.  
  7709. See also: 
  7710.  
  7711.     FontChange 
  7712.     FontFaceChange 
  7713.     FontPointSizeChange 
  7714.     FontRevert 
  7715.  
  7716.  
  7717. ΓòÉΓòÉΓòÉ 164. GetCurFrameBorders ΓòÉΓòÉΓòÉ
  7718.  
  7719. This function finds the frame border information for the selected frame. 
  7720.  
  7721.  
  7722. Syntax 
  7723. GetCurFrameBorders(&Width, &Height, &Top, &Left, &LeftMargin, &TopMargin, 
  7724. &RightMargin, &BottomMargin) 
  7725. Width is the width of the selected frame. 
  7726. Height is the height of the selected frame. 
  7727. Top is the vertical starting position of the frame. 
  7728. Left is the horizontal starting position of the frame. 
  7729. LeftMargin is the size of the left border of the frame. 
  7730. TopMargin is the size of the top border of the frame. 
  7731. RightMargin is the size of the right border of the frame. 
  7732. BottomMargin is the size of the bottom border of the frame. 
  7733. All values are returned in twips (1 inch = 1440 twips). 
  7734. Note the use of indirection (&). 
  7735.  
  7736. Return Value 
  7737. This function does not return a value. 
  7738.  
  7739. Example 
  7740. FUNCTION Example() 
  7741. DEFSTR Width, Height, Top, Left, LM, TM, RM, BM, Units; 
  7742. ' you must have a frame selected 
  7743. WHILE not IsFrameSelected() 
  7744.     UserControl("Please select a frame and choose Resume.") 
  7745. WEND 
  7746. ' get the frame info 
  7747. GetCurFrameBorders(&Width, &Height, &Top, &Left, &LM, &TM, &RM, &BM, &Units) 
  7748. Message("The frame's dimensions are {Width} x {Height}.") 
  7749. Message("The frame starts {Top} twips from the top of the page.") 
  7750. Message("The frame starts {Left} twips from the left edge of the page.") 
  7751. Message("The margins (in twips) of the frame are (T,B,L,R): {TM}, {BM}, {LM}, 
  7752. {RM}") 
  7753. END FUNCTION 
  7754.  
  7755. See also: 
  7756.  
  7757.     AddFrame 
  7758.     AddFrameDlg 
  7759.     FrameLayout 
  7760.     FrameModBorders 
  7761.     FrameModColumns 
  7762.     FrameModFinish 
  7763.     FrameModInit 
  7764.     FrameModLines 
  7765.     FrameModType 
  7766.  
  7767.  
  7768. ΓòÉΓòÉΓòÉ 165. GetCurFrameLines ΓòÉΓòÉΓòÉ
  7769.  
  7770. This function finds information pertaining to the lines and shadows of the 
  7771. selected frame. 
  7772.  
  7773.  
  7774. Syntax 
  7775. GetCurFrameLines(&BorderWhere, &PosType, &ThickType, &ShadeType, &BackType, 
  7776. &ShadowColor, &ShadowLeft, &ShadowTop, &ShadowRight, &ShadowBottom) 
  7777. BorderWhere is the lines around a frame. It is one of the following values: 
  7778.     1 - All 
  7779.     2 - Left 
  7780.     4 - Right 
  7781.     8 - Top 
  7782.     16 - Bottom 
  7783. PosType is the position of the border around a frame. It is one of the 
  7784. following values: 
  7785.     1 - Middle 
  7786.     2 - Inside 
  7787.     3 - Outside 
  7788.     4 - Close to Inside 
  7789.     5 - Close to outside 
  7790. You can only choose one value for the PosType parameter. 
  7791. ThickType is the thickness of the border. It is one of the following values: 
  7792.     Hairline (1) - Hairline 
  7793.     OnePoint (2) - One point rule 
  7794.     TwoPoint (3) - Two point rule 
  7795.     ThreePoint (4) - Three point rule 
  7796.     FourPoint (5) - Four point rule 
  7797.     FivePoint (6) - Five point rule 
  7798.     SixPoint (7) - Six point rule 
  7799.     DoubleOnePoint (8) - Parallel one point rule 
  7800.     DoubleTwoPoint (9) - Parallel two point rule 
  7801.     ThreeLines (10) - Hairline above and below a two point rule 
  7802.     HairBelow (11) - Hairline below a three point rule 
  7803.     HairAbove (12) - Hairline above a three point rule 
  7804. ShadeType sets the line color. It can be one of the following values: 
  7805.     Black - 0 
  7806.     Blue - 16727905 
  7807.     Cyan - 16776960 
  7808.     Green - 65280 
  7809.     Magenta - 16711935 
  7810.     MedBlue - 16744448 
  7811.     Orange - 33279 
  7812.     Pink - 8388863 
  7813.     Purple - 16711809 
  7814.     Red - 255 
  7815.     White - 16777215 
  7816.     Yellow - 65535 
  7817. BackType sets the background color. It can be one of the values listed under 
  7818. ShadeType. 
  7819. ShadowColor sets the color for the frame shadow. It can be one of the values 
  7820. listed under ShadeType. 
  7821. ShadowLeft is the distance that the shadow is offset from the left side of the 
  7822. frame in twips (1 inch = 1440 twips). It can be one of the following values or 
  7823. a custom value: 
  7824.     None (0) - No shadow 
  7825.     Shallow (57) - Shallow shadow 
  7826.     Normal (100) - Normal shadow 
  7827.     Deep (172) - Deep shadow 
  7828. ShadowTop is the distance that the shadow is offset from the top of the frame 
  7829. in twips (1 inch = 1440 twips). It can be one of the values listed under 
  7830. ShadowLeft or a custom value. 
  7831. ShadowRight is the distance that the shadow is offset from the right side of 
  7832. the frame in twips (1 inch = 1440 twips). It can be one of the values listed 
  7833. under ShadowLeft or a custom value. 
  7834. ShadowBottom is the distance that the shadow is offset from the bottom of the 
  7835. frame in twips (1 inch = 1440 twips). It can be one of the values listed under 
  7836. ShadowLeft or a custom value. 
  7837. Note  The Use Of Indirection (&). 
  7838.  
  7839. Return Value 
  7840. This function does not return a value. 
  7841.  
  7842. Example 
  7843. FUNCTION Example() 
  7844. DEFSTR Border, Pos, Thick, Shade, Background, ShadowColor, SL, ST, SR, SB; 
  7845. ' you must have a frame selected 
  7846. WHILE not IsFrameSelected() 
  7847.     UserControl("Please select or create frame.") 
  7848. WEND 
  7849. ' get the frame info 
  7850. GetCurFrameLines(&Border, &Pos, &Thick, &Shade, &Background, &ShadowColor, &SL, 
  7851. &ST, &SR, &SB) 
  7852. TYPE("[ESC]Frame Border: {Border}[Enter]Frame Pos: {Pos}[Enter]") 
  7853. TYPE("Line Thickness: {Thick}[Enter]Line Shading: {Shade}[Enter]") 
  7854. TYPE("Shadow Background: {Background}[Enter]Bkgrnd Color: 
  7855. {ShadowColor}[Enter]") 
  7856. TYPE("Shadow Left: {SL}[Enter]Shadow Right: {SR}[Enter]") 
  7857. TYPE("Shadow Top: {ST}[Enter]Shadow Bottom: {SB}[Enter]") 
  7858. END FUNCTION 
  7859.  
  7860. See also: 
  7861.  
  7862.     AddFrame 
  7863.     AddFrameDlg 
  7864.     FrameLayout 
  7865.     FrameModBorders 
  7866.     FrameModColumns 
  7867.     FrameModFinish 
  7868.     FrameModInit 
  7869.     FrameModLines 
  7870.     FrameModType 
  7871.  
  7872.  
  7873.  
  7874. ΓòÉΓòÉΓòÉ 166. GetCurFrameType ΓòÉΓòÉΓòÉ
  7875.  
  7876. This function finds information about the type of frame, the roundness of the 
  7877. frame, and the macro assigned to the frame. 
  7878.  
  7879.  
  7880. Syntax 
  7881. GetCurFrameType(&Type, &Rounded, &MacroName) 
  7882. Type is the frame type. 
  7883. Rounded is the amount that the corners are rounded, in percent. (0% is a square 
  7884. and 100% is a circle). 
  7885. MacroName is the name, if any, of the macro attached to this frame. 
  7886.  
  7887. Return Value 
  7888. This function does not return a value. 
  7889.  
  7890. Example 
  7891. FUNCTION Example() 
  7892. DEFSTR Type, Rounded, MacroName; 
  7893. ' you must have a frame selected 
  7894. WHILE not IsFrameSelected() 
  7895.     UserControl("Please select or create a frame.") 
  7896. WEND 
  7897. ' get the frame info 
  7898. GetCurFrameType(&Type, &Rounded, &MacroName) 
  7899. Message("The type number of this frame is {Type}.") 
  7900. Message("The percentage of corner rounding on this frame is {Rounded}.") 
  7901. IF MacroName != "" 
  7902.     Message("The macro attached to this frame is {MacroName}.") 
  7903. ELSE 
  7904.     Message("There is no macro attached to this frame.") 
  7905. ENDIF 
  7906. END FUNCTION 
  7907.  
  7908. See also: 
  7909.  
  7910.     AddFrame 
  7911.     AddFrameDlg 
  7912.     FrameLayout 
  7913.     FrameModBorders 
  7914.     FrameModColumns 
  7915.     FrameModFinish 
  7916.     FrameModInit 
  7917.     FrameModLines 
  7918.     FrameModType 
  7919.  
  7920.  
  7921. ΓòÉΓòÉΓòÉ 167. GetCurrentDir ΓòÉΓòÉΓòÉ
  7922.  
  7923. This function returns the current working directory as seen by Ami Pro. 
  7924.  
  7925.  
  7926. Syntax 
  7927. GetCurrentDir$() 
  7928.  
  7929. Return Value 
  7930. A string with the current working directory, including a trailing backslash. 
  7931.  
  7932. Example 
  7933. FUNCTION Example() 
  7934. AmiDir = GetAmiDirectory$() 
  7935. CurDir = GetCurrentDir$() 
  7936. DocPath = GetDocPath$() 
  7937. StylePath = GetStylePath$() 
  7938. MacPath = GetMacPath$() 
  7939. Message("Ami Pro is in {AmiDir}.") 
  7940. Message("DOS reports the current directory is {CurDir}.") 
  7941. Message("Ami Pro's default doc path is {DocPath}.") 
  7942. Message("Ami Pro's default macro path is {MacPath}.") 
  7943. Message("Ami Pro's default style path is {StylePath}.") 
  7944. END FUNCTION 
  7945.  
  7946. See also: 
  7947.  
  7948.     GetAmiDirectory$ 
  7949.     GetBackPath$ 
  7950.     GetDocPath$ 
  7951.     GetHomeDirectory$ 
  7952.     GetMacPath$ 
  7953.     GetStylePath$ 
  7954.  
  7955.  
  7956.  
  7957.  
  7958. ΓòÉΓòÉΓòÉ 168. GetDialogField ΓòÉΓòÉΓòÉ
  7959.  
  7960. This function is used to retrieve the contents of a dialog box field that has 
  7961. been displayed in the last DialogBox function call. 
  7962.  
  7963.  
  7964. Before using this function, ensure that the user did not cancel out of the 
  7965. DialogBox function, or the results of this function are invalid. 
  7966.  
  7967. Syntax 
  7968. GetDialogField$(ID) 
  7969. ID is the ID Number of the field whose value is being retrieved, as defined in 
  7970. the resource file. 
  7971.  
  7972. Return Value 
  7973. Up to an 80 byte string if the field is an edit box, a list box, or a combo 
  7974. box. 
  7975. 0  (FALSE) if the object was a button and was not checked or selected. 
  7976. 1  (TRUE) if the object was a button and was checked or selected. 
  7977.  
  7978. Example 
  7979. FUNCTION Example() 
  7980. Filledit(20,1)       ' Turn apples on 
  7981. Filledit(8000,"Bob") ' Put text in Edit Box 
  7982. Filledit(9001,"*.sam") 
  7983. Box = DialogBox(".","ExampleBox") 
  7984. IF Box<>1 
  7985.     EXIT FUNCTION 
  7986. ENDIF 
  7987. Store = GetdialogField$(22)    ' Retrieve Combo Box 
  7988. File = GetdialogField$(9001)       ' Retrieve List Box result 
  7989. Name = GetDialogField$(8000)   ' Retrieve Edit Box 
  7990. Dir = GetCurrentDir$()      ' Get current directory 
  7991. Message("Goto Store = {Store} Name ={Name} File = {File}") 
  7992. END FUNCTION 
  7993.  
  7994. DIALOG ExampleBox 
  7995. -2134376448 10 71 44 115 98 "" "" "Sample Dialog Box" 
  7996. FONT 8 "Helv" 
  7997. 69 3 40 14 1 1342373889 "button" "OK" 0 
  7998. 69 19 40 14 2 1342373888 "button" "Cancel" 0 
  7999. 6 24 52 56 9001 1352728579 "listbox" "" 0 
  8000. 6 13 40 10 7999 1342177280 "static" "" 0 
  8001. 6 4 40 10 1001 1342177280 "static" "&Files:" 0 
  8002. 69 37 37 12 20 1342242825 "button" "&Apples" 0 
  8003. 69 49 42 12 21 1342242825 "button" "&Oranges" 0 
  8004. 6 83 45 12 22 1342242819 "button" "&Goto Store" 0 
  8005. 69 61 42 12 23 1342242825 "button" "&Soap" 0 
  8006. 69 82 43 12 8000 1350631552 "edit" "" 0 
  8007. END DIALOG 
  8008.  
  8009. See also: 
  8010.  
  8011.     DialogBox 
  8012.     FillEdit 
  8013.     FillList 
  8014.     GetDLGItem 
  8015.     GetDLGItemText 
  8016.     SetDLGCallback 
  8017.     SetDLGItemText 
  8018.  
  8019.  
  8020. ΓòÉΓòÉΓòÉ 169. GetDlgItem ΓòÉΓòÉΓòÉ
  8021.  
  8022. This function returns the OS/2 window handle to the specified control or 
  8023. object. 
  8024.  
  8025.  
  8026. Syntax 
  8027. GetDlgItem(Handle, ID) 
  8028. Handle is the handle to the dialog box, passed to a callback function. 
  8029. ID is the ID number of the object for which you want to get the handle. 
  8030.  
  8031. Return Value 
  8032. The OS/2 window handle for the specified control or object. 
  8033.  
  8034. Example 
  8035. FUNCTION Example() 
  8036. ' get the name of this macro file 
  8037. MacFile = GetRunningMacroFile$() 
  8038. ' run ClearBox if the Re-Fill box is pressed 
  8039. SetDlgCallBack(50, "{MacFile}!ClearBox") 
  8040. FOR I = 1 to 10 
  8041.     FillEdit(9000, I)' fill the edit box 
  8042. NEXT 
  8043. Box = DialogBox(".", "ExampleBox")    ' display the example box 
  8044. END FUNCTION 
  8045.  
  8046. FUNCTION ClearBox(hdlg, id, text) 
  8047. ' get the handle to the list box 
  8048. handle = GetDlgItem(hdlg, 9000) 
  8049. AppSendMessage(handle, 0x0405, 0, 0) 
  8050. Message("Cleared List Box, Now I Will Re-Fill It...") 
  8051. FOR I = 1 to 10 
  8052.     SetDlgItemText(hdlg, 9000, I) 
  8053. NEXT 
  8054. END FUNCTION 
  8055.  
  8056. DIALOG ExampleBox 
  8057. -2134376448 4 169 46 106 76 "" "" "Example Dialog Box" 
  8058. FONT 6 "Helv" 
  8059. 62 3 40 14 2 1342242817 "button" "DONE" 0 
  8060. 62 19 40 14 50 1342242816 "button" "Re-Fill Box" 0 
  8061. 4 11 52 61 9000 1352728579 "listbox" "" 0 
  8062. 5 2 51 9 1000 1342177280 "static" "Number:" 0 
  8063. END DIALOG 
  8064.  
  8065. See also: 
  8066.  
  8067.     DialogBox 
  8068.     FillEdit 
  8069.     FillList 
  8070.     GetDLGItemText 
  8071.     SetDLGCallback 
  8072.     SetDLGItemText 
  8073.  
  8074.  
  8075.  
  8076. ΓòÉΓòÉΓòÉ 170. GetDlgItemText ΓòÉΓòÉΓòÉ
  8077.  
  8078. This function returns the contents of a dialog box object field. 
  8079.  
  8080.  
  8081. Syntax 
  8082. GetDlgItemText(Handle, ID) 
  8083. Handle is the handle to the dialog box, passed to a CallBack function. 
  8084. ID is the ID number of the desired object. If the ID is a radio button or check 
  8085. box, the text returns a TRUE or FALSE condition. 
  8086.  
  8087. Return Value 
  8088. The contents of the specified object. 
  8089. If the object is a button, this function returns a TRUE or FALSE value. 
  8090. If the object is an edit box, a list box, or a combo box, this function returns 
  8091. a string. 
  8092.  
  8093. Example 
  8094. FUNCTION Example() 
  8095. ' get the name of this macro file 
  8096. MacFile = GetRunningMacroFile$() 
  8097. ' run Message1 function when Run Example is pressed 
  8098. SetDlgCallBack(50, "{MacFile}!Message1") 
  8099. ' ExampleBox is in this file 
  8100. Box = DialogBox(".", "ExampleBox") 
  8101. IF Box = -1 
  8102.     Message("Could not find dialog box!") 
  8103.     EXIT FUNCTION 
  8104. ELSEIF Box = 0 
  8105.     EXIT FUNCTION 
  8106. ENDIF 
  8107. ' type the name backwards into a document 
  8108. TYPE(GetDialogField$(8002)) 
  8109. END FUNCTION 
  8110.  
  8111. FUNCTION Message1(hdlg, id, text) 
  8112. ' get the type in name 
  8113. Name = GetDlgItemText(hdlg, 8000) 
  8114. Message("The contents of the first box are {Name}.") 
  8115. Message("We will now fill the second box with the inverse of {Name}.") 
  8116. ' reverse the name 
  8117. FOR I = len(Name) to 1 step -1 
  8118.     Name2 = strcat$(Name2, MID$(Name, I, 1)) 
  8119. NEXT 
  8120. ' fill the second edit box 
  8121. SetDlgItemText(hdlg, 8002, Name2) 
  8122. END FUNCTION 
  8123.  
  8124. DIALOG ExampleBox 
  8125. -2134376448 8 106 38 160 54 "" "" "Sample Dialog Box" 
  8126. FONT 6 "Helv" 
  8127. 50 6 62 12 8000 1350631552 "edit" "" 0 
  8128. 4 6 44 10 1000 1342177280 "static" "Your Name:" 0 
  8129. 50 20 62 12 1003 1342177287 "static" "" 0 
  8130. 4 22 44 10 1002 1342177280 "static" "Reversed:" 0 
  8131. 52 22 58 8 8002 1342177280 "static" "" 0 
  8132. 116 4 40 14 1 1342242817 "button" "OK" 0 
  8133. 116 20 40 14 2 1342242816 "button" "Cancel" 0 
  8134. 100 36 56 14 50 1342242816 "button" "&Run Example..." 0 
  8135. END DIALOG 
  8136.  
  8137. See also: 
  8138.  
  8139.     DialogBox 
  8140.     FillEdit 
  8141.     FillList 
  8142.     GetDialogField$ 
  8143.     GetDlgItem 
  8144.     SetDlgCallback 
  8145.  
  8146.  
  8147. ΓòÉΓòÉΓòÉ 171. GetDocInfo ΓòÉΓòÉΓòÉ
  8148.  
  8149. This function retrieves one of the document information fields from the current 
  8150. document. 
  8151.  
  8152.  
  8153. Syntax 
  8154. GetDocInfo$(Which) 
  8155. Which is the desired document info field to retrieve and may be one of the 
  8156. following: 
  8157.     DDFilename (1) - File name 
  8158.     DDPath (2) - Path for this document 
  8159.     DDStylesheet (3) - Style sheet for this document 
  8160.     DDCreated (4) - Date document was created 
  8161.     DDRevised (5) - Date document was revised 
  8162.     DDRevisions (6) - Number of document revisions 
  8163.     DDDescription (7) - Document info 
  8164.     DDUser1 (8) - User  Defined Field 1 
  8165.     DDUser2 (9) - User defined Field 2 
  8166.     DDUser3 (10) - User defined Field 3 
  8167.     DDUser4 (11) - User defined Field 4 
  8168.     DDUser5 (12) - User defined Field 5 
  8169.     DDUser6 (13) - User defined Field 6 
  8170.     DDUser7 (14) - User defined Field 7 
  8171.     DDUser8 (15) - User  Defined Field 8 
  8172.  
  8173. Return Value 
  8174. A string containing the desired document info field. 
  8175.  
  8176. Example 
  8177. FUNCTION Example() 
  8178. DIM Field(15) 
  8179. Message("Ready to type the contents of the Doc Info fields into the document.") 
  8180. FOR I = 1 to 15 
  8181.     Field(I) = GetDocInfo$(I) 
  8182. NEXT 
  8183. ' put the field values in variables 
  8184. Filename = Field(1) 
  8185. Path = Field(2) 
  8186. Style = Field(3) 
  8187. Created = Field(4) 
  8188. Revised = Field(5) 
  8189. Number = Field(6) 
  8190. Descrip = Field(7) 
  8191. TYPE("The current filename is {Filename}.[Enter]") 
  8192. TYPE("The path for this document is {Path}.[Enter]") 
  8193. TYPE("The style sheet for this document is {Style}.[Enter]") 
  8194. TYPE("This document was created on {Created}.[Enter]") 
  8195. TYPE("This document was last revised on {revised}.[Enter]") 
  8196. TYPE("This document has been revised {Number} times.[Enter]") 
  8197. TYPE("The document description for this document states:[Enter] 
  8198. {Descrip}.[Enter]") 
  8199. FOR I = 1 to 8 
  8200.     ThisField = Field(I + 7) 
  8201.     IF ThisField != "" 
  8202.        TYPE("User defined field {I} of this document contains: 
  8203.  {ThisField}.[Enter]") 
  8204.     ELSE 
  8205.        TYPE("User defined field {I} contains nothing.[Enter]") 
  8206.     ENDIF 
  8207. NEXT 
  8208. END FUNCTION 
  8209.  
  8210. See also: 
  8211.  
  8212.     DocInfo 
  8213.     GetDocInfoKeywords$ 
  8214.     InsertDocInfoField 
  8215.     InsertDocInfo 
  8216.     RenameDocInfoField 
  8217.  
  8218.  
  8219. ΓòÉΓòÉΓòÉ 172. GetDocInfoKeywords ΓòÉΓòÉΓòÉ
  8220.  
  8221. This function returns the keywords field from the Doc Info dialog box. 
  8222.  
  8223.  
  8224. Syntax 
  8225. GetDocInfoKeywords$() 
  8226.  
  8227. Return Value 
  8228. This function returns the Keywords field. 
  8229.  
  8230. Example 
  8231. FUNCTION Example() 
  8232. Words=GetDocInfoKeywords$() 
  8233. Message ("The Keywords for this doc are:{Words}.") 
  8234. END FUNCTION 
  8235.  
  8236. See also: 
  8237.  
  8238.     DocInfo 
  8239.     GetDocInfo$ 
  8240.     InsertDocInfoField 
  8241.     InsertDocInfo 
  8242.     RenameDocInfoField 
  8243.  
  8244.  
  8245. ΓòÉΓòÉΓòÉ 173. GetDocPath ΓòÉΓòÉΓòÉ
  8246.  
  8247. This function returns the drive and directory of the default document storage 
  8248. path. 
  8249.  
  8250.  
  8251. Syntax 
  8252. GetDocPath$() 
  8253.  
  8254. Return Value 
  8255. A string containing the current default document path, with a trailing 
  8256. backslash. 
  8257.  
  8258. Example 
  8259. FUNCTION Example() 
  8260. AmiDir = GetAmiDirectory$() 
  8261. CurDir = GetCurrentDir$() 
  8262. DocPath = GetDocPath$() 
  8263. StylePath = GetStylePath$() 
  8264. MacPath = GetMacPath$() 
  8265. Message("Ami Pro is in {AmiDir}.") 
  8266. Message("DOS reports the current directory is {CurDir}.") 
  8267. Message("Ami Pro's default doc path is {DocPath}.") 
  8268. Message("Ami Pro's default macro path is {MacPath}.") 
  8269. Message("Ami Pro's default style path is {StylePath}.") 
  8270. END FUNCTION 
  8271.  
  8272. See also: 
  8273.  
  8274.     GetAmiDirectory$ 
  8275.     GetBackPath$ 
  8276.     GetCurrentDir$ 
  8277.     GetHomeDirectory$ 
  8278.     GetMacPath$ 
  8279.     GetStylePath$ 
  8280.     SetBackPath 
  8281.     SetDocPath 
  8282.     SetStylePath 
  8283.  
  8284.  
  8285.  
  8286. ΓòÉΓòÉΓòÉ 174. GetDocVar ΓòÉΓòÉΓòÉ
  8287.  
  8288. This function returns the value associated with Name. Document variables are 
  8289. kept with the current document. Document variables have a name and a value. 
  8290. They can be retrieved by name using this function or all document variables can 
  8291. be returned using the GetPowerFields function. 
  8292.  
  8293.  
  8294. Syntax 
  8295. GetDocVar(Name) 
  8296. Name is the name of the document variable to retrieve. 
  8297.  
  8298. Return Value 
  8299. A string containing the information in the document variable. 
  8300.  
  8301. Example 
  8302. FUNCTION Example() 
  8303. val = GetDocVar("answer1") 
  8304. END FUNCTION 
  8305.  
  8306. See also: 
  8307.  
  8308.     GetPowerFields 
  8309.     SetDocVar 
  8310.  
  8311.  
  8312. ΓòÉΓòÉΓòÉ 175. GetFmtPageStr ΓòÉΓòÉΓòÉ
  8313.  
  8314. This function returns the page number of a bookmark and the paragraph style 
  8315. that page number is currently using. 
  8316.  
  8317.  
  8318. Syntax 
  8319. GetFmtPageStr$(Name) 
  8320. Name is the name of the Bookmark for which to find the page number. 
  8321.  
  8322. Return Value 
  8323. A string containing the page on which the specified bookmark begins, including 
  8324. the paragraph style the page number is using. 
  8325.  
  8326. Example 
  8327. FUNCTION Example() 
  8328. Bkmk = Query$("What is the name of the bookmark to use?") 
  8329. Page = GetFmtPageStr$(Bkmk) 
  8330. Message("The page, with formatting that {Bkmk} is on is {Page}.") 
  8331. END FUNCTION 
  8332.  
  8333. See also: 
  8334.  
  8335.     GetBookMarkCount 
  8336.     GetBookMarkNames 
  8337.     GetBookMarkPage 
  8338.     GetPageNo 
  8339.     GoToCmd 
  8340.     MarkBookMark 
  8341.  
  8342.  
  8343. ΓòÉΓòÉΓòÉ 176. GetGlobalArray ΓòÉΓòÉΓòÉ
  8344.  
  8345. This function returns a global array element. 
  8346.  
  8347.  
  8348. Global variables cannot be directly used by functions and statements. Their 
  8349. values must be assigned to local variables before they can be used. 
  8350.  
  8351. Syntax 
  8352. GetGlobalArray$(Name, Index) 
  8353. Name is the name or the number of the global variable to use. 
  8354. Index is the element of the global array you are retrieving. 
  8355.  
  8356. Return Value 
  8357. The value of the global array element. 
  8358.  
  8359. Example 
  8360. FUNCTION Example() 
  8361. AllocGlobalVar("Names", 5)'Allocate space for a 5 element global variable 
  8362. AllocGlobalVar("Numbers", 5)'Allocate space for a 5 element global variable 
  8363. AllocGlobalVar("YourName", 1)'Allocate space for a single element global 
  8364. variable. 
  8365. FOR I = 1 to 5'Do the following 5 times. 
  8366. SetGlobalArray("Names", I, Query$("Enter Name Number {I}")) 
  8367. 'Fill a global array with the return from QUERY 
  8368. SetGlobalArray("Numbers", I, (100/I))'Fill a global array with a number 
  8369. NEXT 
  8370. NewName = Query$("What is your name?")'Query the user for his/her name 
  8371. SetGlobalVar("YourName", NewName)'Set a global variable to that value 
  8372. CALL Example2()'Call the following function 
  8373. END FUNCTION 
  8374.  
  8375. FUNCTION Example2() 
  8376. Name = GetGlobalVar$("YourName")'Get the value of the global variable 
  8377. Message("Your name is {Name}.")'Message that value in a box. 
  8378. FOR I = 1 to 5'Do the following 5 times. 
  8379. TheirName = GetGlobalArray$("Names", I)'Get the value of the current element 
  8380. from the array 
  8381. TheirNumber = GetGlobalArray$("Numbers", I)'Get the value of the current 
  8382. element from the array 
  8383. TYPE("Name #{I} is {TheirName}, and the number is {TheirNumber}.[Enter]") 
  8384. 'Type the values to the screen. 
  8385. NEXT 
  8386. FreeGlobalVar("Names")'Clear the space for the first global array 
  8387. FreeGlobalVar("Numbers")'Clear the space for the second global array 
  8388. FreeGlobalVar("YourName")'Clear the space for the global variable 
  8389. END FUNCTION 
  8390.  
  8391. See also: 
  8392.  
  8393.     AllocGlobalVar 
  8394.     FreeGlobalVar 
  8395.     GetGlobalVar$ 
  8396.     SetGlobalArray 
  8397.     SetGlobalVar 
  8398.     Using Variables 
  8399.  
  8400.  
  8401.  
  8402. ΓòÉΓòÉΓòÉ 177. GetGlobalVar ΓòÉΓòÉΓòÉ
  8403.  
  8404. This function returns a global array variable. 
  8405.  
  8406.  
  8407. Global variables cannot be directly used by functions and statements. Their 
  8408. values must be assigned to local variables before they can be used. 
  8409.  
  8410. Syntax 
  8411. GetGlobalVar$(Name) 
  8412. Name is the name or the number of the global variable to retrieve the data 
  8413. from. 
  8414.  
  8415. Return Value 
  8416. The value of the global variable. 
  8417.  
  8418. Example 
  8419. FUNCTION Example() 
  8420. AllocGlobalVar("Name", 1) 
  8421. AllocGlobalVar("Computer", 1) 
  8422. AllocGlobalVar("Software", 1) 
  8423. Name = Query$("What is your name?") 
  8424. Computer = Query$("What kind of computer do you have?") 
  8425. Software = Query$("What is your favorite piece of software?") 
  8426. SetGlobalVar("Name", Name) 
  8427. SetGlobalVar("Computer", Computer) 
  8428. SetGlobalVar("Software", Software) 
  8429. CALL Example2()'Call the following function 
  8430. END FUNCTION 
  8431.  
  8432. FUNCTION Example2() 
  8433. NumGlobs = GetGlobalVarCount() 
  8434. DIM TempArray(Numglobs) 
  8435. GetGlobalVarNames(&TempArray) 
  8436. FOR i = 1 to NumGlobs 
  8437.     VarName=TempArray(i) 
  8438.     VarContents=GetGlobalVar$(VarName) 
  8439.     TYPE ("Item {i}, {VarName}, is {VarContents}.[ENTER]") 
  8440.     FreeGlobalVar(VarName) 
  8441. NEXT 
  8442. END FUNCTION 
  8443.  
  8444. See also: 
  8445.  
  8446.     AllocGlobalVar 
  8447.     FreeGlobalVar 
  8448.     GetGlobalArray$ 
  8449.     SetGlobalArray 
  8450.     SetGlobalVar 
  8451.     Using Variables 
  8452.  
  8453.  
  8454.  
  8455. ΓòÉΓòÉΓòÉ 178. GetGlobalVarCount ΓòÉΓòÉΓòÉ
  8456.  
  8457. This function returns the total number of global variables currently allocated. 
  8458. It is used to dimension an array before calling the GetGlobalVarNames function. 
  8459.  
  8460.  
  8461. Syntax 
  8462. GetGlobalVarCount() 
  8463.  
  8464. Return Value 
  8465. The total number of global variables currently allocated. 
  8466.  
  8467. Example 
  8468. FUNCTION Example() 
  8469. AllocGlobalVar("Name", 1) 
  8470. AllocGlobalVar("Computer", 1) 
  8471. AllocGlobalVar("Software", 1) 
  8472. Name = Query$("What is your name?") 
  8473. Computer = Query$("What kind of computer do you have?") 
  8474. Software = Query$("What is your favorite piece of software?") 
  8475. SetGlobalVar("Name", Name) 
  8476. SetGlobalVar("Computer", Computer) 
  8477. SetGlobalVar("Software", Software) 
  8478. CALL Example2()'Call the following function 
  8479. END FUNCTION 
  8480.  
  8481. FUNCTION Example2() 
  8482. NumGlobs = GetGlobalVarCount() 
  8483. DIM TempArray(Numglobs) 
  8484. GetGlobalVarNames(&TempArray) 
  8485. FOR i = 1 to NumGlobs 
  8486.     VarName=TempArray(i) 
  8487.     VarContents=GetGlobalVar$(VarName) 
  8488.     TYPE ("Item {i}, {VarName}, is {VarContents}.[ENTER]") 
  8489.     FreeGlobalVar(VarName) 
  8490. NEXT 
  8491. END FUNCTION 
  8492.  
  8493. See also: 
  8494.  
  8495.     AllocGlobalVar 
  8496.     GetGlobalArray$ 
  8497.     GetGlobalVar$ 
  8498.     GetGlobalVarNames 
  8499.     SetGlobalArray 
  8500.     SetGlobalVar 
  8501.  
  8502.  
  8503. ΓòÉΓòÉΓòÉ 179. GetGlobalVarNames ΓòÉΓòÉΓòÉ
  8504.  
  8505. This function finds the names or ID numbers of all of the currently allocated 
  8506. global variables. 
  8507.  
  8508.  
  8509. Syntax 
  8510. GetGlobalVarNames(&Array) 
  8511. Array is the name of the array to place the names or ID numbers of the 
  8512. currently allocated global variables. 
  8513. Note the use of indirection (&). 
  8514.  
  8515. Return Value 
  8516. The number of global variances. 
  8517.  
  8518. Example 
  8519. FUNCTION Example() 
  8520. AllocGlobalVar("Name", 1) 
  8521. AllocGlobalVar("Computer", 1) 
  8522. AllocGlobalVar("Software", 1) 
  8523. Name = Query$("What is your name?") 
  8524. Computer = Query$("What kind of computer do you have?") 
  8525. Software = Query$("What is your favorite piece of software?") 
  8526. SetGlobalVar("Name", Name) 
  8527. SetGlobalVar("Computer", Computer) 
  8528. SetGlobalVar("Software", Software) 
  8529. CALL Example2()'Call the following function 
  8530. END FUNCTION 
  8531.  
  8532. FUNCTION Example2() 
  8533. NumGlobs = GetGlobalVarCount() 
  8534. DIM TempArray(Numglobs) 
  8535. GetGlobalVarNames(&TempArray) 
  8536. FOR i = 1 to NumGlobs 
  8537.     VarName=TempArray(i) 
  8538.     VarContents=GetGlobalVar$(VarName) 
  8539.     TYPE ("Item {i}, {VarName}, is {VarContents}.[ENTER]") 
  8540.     FreeGlobalVar(VarName) 
  8541. NEXT 
  8542. END FUNCTION 
  8543.  
  8544. See also: 
  8545.  
  8546.     AllocGlobalVar 
  8547.     GetGlobalArray$ 
  8548.     GetGlobalVar$ 
  8549.     GetGlobalVarCount 
  8550.     SetGlobalArray 
  8551.     SetGlobalVar 
  8552.  
  8553.  
  8554. ΓòÉΓòÉΓòÉ 180. GetHomeDirectory ΓòÉΓòÉΓòÉ
  8555.  
  8556. This function returns the directory where Ami Pro stores the INI files. If you 
  8557. are running Ami Pro on a standalone computer, this function returns the OS/2 
  8558. directory. If you are running Ami Pro on a network, this function returns the 
  8559. directory specified when the node was installed. 
  8560.  
  8561.  
  8562. Syntax 
  8563. GetHomeDirectory$() 
  8564.  
  8565. Return Value 
  8566. This function returns the OS/2 directory. 
  8567.  
  8568. Example 
  8569. FUNCTION Example() 
  8570. homedir = GetHomeDirectory$() 
  8571. Message("Home Directory is {homedir}.") 
  8572. END FUNCTION 
  8573.  
  8574. See also: 
  8575.  
  8576.     GetAmiDirectory$ 
  8577.     GetDocPath$ 
  8578.     GetMacPath$ 
  8579.     GetStylePath$ 
  8580.  
  8581.  
  8582.  
  8583. ΓòÉΓòÉΓòÉ 181. GetIconPalette ΓòÉΓòÉΓòÉ
  8584.  
  8585. This function returns the name of the current SmartIcon set. 
  8586.  
  8587.  
  8588. Syntax 
  8589. GetIconPalette() 
  8590.  
  8591. Return Value 
  8592. A string containing the name of the icon set. 
  8593.  
  8594. Example 
  8595. FUNCTION Example() 
  8596. palette = GetIconPalette() 
  8597. Message("The icon palette is {palette}.") 
  8598. END FUNCTION 
  8599.  
  8600. See also: 
  8601.  
  8602.     ChangeIcons 
  8603.     IconBottom 
  8604.     IconCustomize 
  8605.     IconFloating 
  8606.     IconLeft 
  8607.     IconRight 
  8608.     IconTop 
  8609.     SetIconSize 
  8610.  
  8611.  
  8612. ΓòÉΓòÉΓòÉ 182. GetLayoutLeftLines ΓòÉΓòÉΓòÉ
  8613.  
  8614. This function finds the current information about any lines associated with the 
  8615. current page layout. 
  8616.  
  8617.  
  8618. Syntax 
  8619. GetLayoutLeftLines(&GutterShade, &GutterStyle, &BorderSides, &BorderStyle, 
  8620. &BorderSpace) 
  8621. GutterShade is the color of the line. 
  8622. GutterStyle and BorderStyle define the width and type of the line and should be 
  8623. one of the following: 
  8624.     Hairline (1) - Hairline 
  8625.     OnePoint (2) - One point rule 
  8626.     TwoPoint (3) - Two point rule 
  8627.     ThreePoint (4) - Three point rule 
  8628.     FourPoint (5) - Four point rule 
  8629.     FivePoint (6) - Five point rule 
  8630.     SixPoint (7) - Six point rule 
  8631.     DoubleOnePoint (8) - Parallel one point rule 
  8632.     DoubleTwoPoint (9) - Parallel two point rule 
  8633.     ThreeLines (10) - Hairline above and below a two point rule 
  8634.     HairBelow (11) - Hairline below a three point rule 
  8635.     HairAbove (12) - Hairline above a three point rule 
  8636. BorderSides is where the lines are placed on the page and can be one or more of 
  8637. the following: 
  8638.     (1) - All sides 
  8639.     (2) - Left 
  8640.     (4) - Right 
  8641.     (8) - Top 
  8642.     (16) - Bottom 
  8643. To extract any combination, use the bitwise operator OR (|) on this number. 
  8644. The Right value is also used when you have only one page format. 
  8645. BorderSpace is how close the border is to the printed page and can be one of 
  8646. the following: 
  8647.     (1) - Middle 
  8648.     (2) - Inside 
  8649.     (3) - Outside 
  8650.     (4) - Close to Inside 
  8651.     (5) - Close to Outside 
  8652. Note the use of indirection (&). 
  8653.  
  8654. Return Value 
  8655. This function does not return a value. 
  8656.  
  8657. Example 
  8658. FUNCTION Example() 
  8659. DEFSTR Gshade, Gstyle, Bsides, Bstyle, Bspace; 
  8660. ' get the page layout line info 
  8661. GetLayoutLeftLines(&Gshade, &Gstyle, &Bsides, &Bstyle, &Bspace) 
  8662. TYPE("The color of the lines is: {Gshade}.[Enter]") 
  8663. TYPE("The width of the gutter is: {Gstyle}.[Enter]") 
  8664. TYPE("The lines are placed: {Bsides}.[Enter]") 
  8665. TYPE("The style of the border is: {Bstyle}.[Enter]") 
  8666. TYPE("The location of the lines is: {Bspace}.[Enter]") 
  8667. END FUNCTION 
  8668.  
  8669. See also: 
  8670.  
  8671.     GetLayoutPageSize 
  8672.     GetLayoutParameters 
  8673.     GetLayoutType 
  8674.     ModifyLayout 
  8675.  
  8676.  
  8677. ΓòÉΓòÉΓòÉ 183. GetLayoutPageSize ΓòÉΓòÉΓòÉ
  8678.  
  8679. This function finds the page size information for the current page layout. 
  8680.  
  8681.  
  8682. Syntax 
  8683. GetLayoutPageSize(&Length, &Width, 0, 0) 
  8684. Length is the length of the page, in twips (1 inch = 1440 twips). 
  8685. Width is the width of the page, in twips. 
  8686. Note the use of indirection (&). 
  8687.  
  8688. Return Value 
  8689. This function does not return a value. 
  8690.  
  8691. Example 
  8692. FUNCTION Example() 
  8693. DEFSTR Length, Width; 
  8694. ' get the page size info 
  8695. GetLayoutPageSize(&Length, &Width, 0, 0) 
  8696. TYPE("The length of the page is {Length} twips.[Enter]") 
  8697. TYPE("The width of the page is {Width} twips.[Enter]") 
  8698. END FUNCTION 
  8699.  
  8700. See also: 
  8701.  
  8702.     GetLayoutLeftLines 
  8703.     GetLayoutParameters 
  8704.     GetLayoutType 
  8705.     ModifyLayout 
  8706.  
  8707.  
  8708. ΓòÉΓòÉΓòÉ 184. GetLayoutParameters ΓòÉΓòÉΓòÉ
  8709.  
  8710. This function finds the margin, columns, and tab information for the current 
  8711. page layout. 
  8712.  
  8713.  
  8714. Syntax 
  8715. GetLayoutParameters(Which, &Parameters) 
  8716. Which is the type of page layout you want to get information about. It can be 
  8717. one of the following functions: 
  8718.     ModLayoutLeftFooter 
  8719.     ModLayoutLeftHeader 
  8720.     ModLayoutLeftPage 
  8721.     ModLayoutRightFooter 
  8722.     ModLayoutRightHeader 
  8723.     ModLayoutRightPage 
  8724. Parameters is an array that was dimensioned according to the return value of 
  8725. GetLayoutParmCnt. 
  8726. Note the use of indirection (&). 
  8727.  
  8728. Return Value 
  8729. This function does not return a value. 
  8730.  
  8731. Example 
  8732. FUNCTION Example() 
  8733. ' Get number of parameters for ModLayoutRightPage 
  8734. Cnt = GetLayoutParmCnt(ModLayoutRightPage) 
  8735. DIM Stuff(Cnt)       'Dimension an array for that amount 
  8736. ' Get the parameters and place in the array 
  8737. GetLayoutParameters(ModLayoutRightPage, &Stuff) 
  8738. ' Query for new headers lengthh 
  8739. length = Query$("New length of right/all headers?") 
  8740. ' Query for new headers height. 
  8741. width = Query$("New width of right/all headers?") 
  8742. Stuff(1) = length * 1440       'Turn into twips 
  8743. Stuff(2) = width * 1440     'Turn into twips 
  8744. ' Prep Ami Pro to accept Layout changes for all pages 
  8745. ModLayoutInit(512) 
  8746. ' Apply changes to specified function. 
  8747. AmiProIndirect(ModLayoutRightPage, &Stuff, Cnt) 
  8748. ' Tell Ami Pro to accept the specified changes 
  8749. ModLayoutFinish() 
  8750. END FUNCTION 
  8751.  
  8752. See also: 
  8753.  
  8754.     GetLayoutLeftLines 
  8755.     GetLayoutPageSize 
  8756.     GetLayoutType 
  8757.     ModifyLayout 
  8758.     ModLayoutLeftFooter 
  8759.     ModLayoutLeftHeader 
  8760.     ModLayoutLeftPage 
  8761.     ModLayoutRightFooter 
  8762.     ModLayoutRightHeader 
  8763.     ModLayoutRightPage 
  8764.  
  8765.  
  8766.  
  8767.  
  8768.  
  8769. ΓòÉΓòÉΓòÉ 185. GetLayoutType ΓòÉΓòÉΓòÉ
  8770.  
  8771. This function returns the type of  page layout for the current page layout. 
  8772.  
  8773.  
  8774. Syntax 
  8775. GetLayoutType() 
  8776.  
  8777. Return Value 
  8778. A bit number containing the values of the All pages bit and should be one of 
  8779. the following: 
  8780.     0 - Neither 
  8781.     512 - All  Pages 
  8782.     1536 - Both 
  8783. To extract the individual bits, use the bitwise operator OR (|). 
  8784.  
  8785. Example 
  8786. FUNCTION Example() 
  8787. Type = GetLayoutType() 
  8788. IF Type & 0 
  8789.     Type = "Neither all pages nor mirrored" 
  8790. ELSEIF Type & 512 
  8791.     Type = "All Pages" 
  8792. ELSEIF Type & 1024 
  8793.     Type = "Mirror Image" 
  8794. ELSEIF Type & 1536 
  8795.     Type = "Both all pages and mirror image" 
  8796. ENDIF 
  8797. Message("The current layout type is {Type}.") 
  8798. END FUNCTION 
  8799.  
  8800. See also: 
  8801.  
  8802.     GetLayoutLeftLines 
  8803.     GetLayoutPageSize 
  8804.     GetLayoutParameters 
  8805.     ModifyLayout 
  8806.  
  8807.  
  8808. ΓòÉΓòÉΓòÉ 186. GetMacPath ΓòÉΓòÉΓòÉ
  8809.  
  8810. This function returns the drive and directory of the default macro directory 
  8811. path. 
  8812.  
  8813.  
  8814. Syntax 
  8815. GetMacPath$() 
  8816.  
  8817. Return Value 
  8818. A string with the drive and directory of the default macro directory path. 
  8819.  
  8820. Example 
  8821. FUNCTION Example() 
  8822. AmiDir = GetAmiDirectory$() 
  8823. CurDir = GetCurrentDir$() 
  8824. DocPath = GetDocPath$() 
  8825. StylePath = GetStylePath$() 
  8826. MacPath = GetMacPath$() 
  8827. Message("Ami Pro is in {AmiDir}.") 
  8828. Message("DOS reports the current directory is {CurDir}.") 
  8829. Message("Ami Pro's default doc path is {DocPath}.") 
  8830. Message("Ami Pro's default macro path is {MacPath}.") 
  8831. Message("Ami Pro's default style path is {StylePath}.") 
  8832. END FUNCTION 
  8833.  
  8834. See also: 
  8835.  
  8836.     GetBackPath$ 
  8837.     GetCurrentDir$ 
  8838.     GetDocPath$ 
  8839.     GetHomeDirectory$ 
  8840.     GetStylePath$ 
  8841.  
  8842.  
  8843. ΓòÉΓòÉΓòÉ 187. GETMARKTEXT ΓòÉΓòÉΓòÉ
  8844.  
  8845. This function gets the name of a bookmark, a merge field, contents of a note, 
  8846. or a power field. Before using this function, the insertion point should be at 
  8847. the location of a merge field, a bookmark, or a power field. 
  8848.  
  8849.  
  8850. You should use the GoToCmd function for bookmarks, merge fields, notes, and 
  8851. fields. Use the FieldNext function to set the insertion point. 
  8852.  
  8853. Syntax 
  8854. GetMarkText$() 
  8855.  
  8856. Return Value 
  8857. The name of the bookmark, merge field, or power field at the insertion point. 
  8858. The null string ("") if the insertion point was not on one of these marks. 
  8859.  
  8860. Example 
  8861. FUNCTION Example() 
  8862. MarkBookMark("Example", AddBookMark) 
  8863. TYPE("[CtrlEND]") 
  8864. MarkBookMark("Example", FindBookMark) 
  8865. Text = GetMarkText$() 
  8866. MarkBookMark("Example", DeleteBookMark) 
  8867. IF Text != "" 
  8868.     Message("Your bookmark was named ""{Text}"".") 
  8869. ENDIF 
  8870. END FUNCTION 
  8871.  
  8872. See also: 
  8873.  
  8874.     FieldAdd 
  8875.     FieldNextFieldPrev 
  8876.     GetTextBeforeCursor$ 
  8877.     GoToCmd 
  8878.     MarkBookMark 
  8879.  
  8880.  
  8881. ΓòÉΓòÉΓòÉ 188. GetMasterFiles ΓòÉΓòÉΓòÉ
  8882.  
  8883. This function fills an array with the names of any master file documents 
  8884. associated with the current document. The array may be dimensioned using the 
  8885. GetMasterFilesCount function. 
  8886.  
  8887.  
  8888. Syntax 
  8889. GetMasterFiles(&Array) 
  8890. Array is the name of the array in which to place the names of the master files. 
  8891. Note the use of indirection (&). 
  8892.  
  8893. Return Value 
  8894. The number of files. 
  8895.  
  8896. Example 
  8897. FUNCTION Example() 
  8898. ' get the number of associated documents 
  8899. Count = GetMasterFilesCount() 
  8900. IF Count > 1 
  8901.     ' put the names in the File array 
  8902.     DIM Files(Count) 
  8903.     GetMasterFiles(&Files) 
  8904.     FOR I = 1 to Count 
  8905.        Message(Files(I))' display the names 
  8906.     NEXT 
  8907. ELSE 
  8908.     Message("No master files!") 
  8909. ENDIF 
  8910. END FUNCTION 
  8911.  
  8912. See also: 
  8913.  
  8914.     AmiProIndirect 
  8915.     GetMasterFilesCount 
  8916.     SetMasterFiles 
  8917.  
  8918.  
  8919. ΓòÉΓòÉΓòÉ 189. GetMasterFilesCount ΓòÉΓòÉΓòÉ
  8920.  
  8921. This function returns the total number of master files associated with the 
  8922. current file. It is useful in dimensioning an array to hold the names of all of 
  8923. the master files. 
  8924.  
  8925.  
  8926. Syntax 
  8927. GetMasterFilesCount() 
  8928.  
  8929. Return Value 
  8930. The number of master files associated with the current document. 
  8931.  
  8932. Example 
  8933. FUNCTION Example() 
  8934. ' get the number of associated documents 
  8935. Count = GetMasterFilesCount() 
  8936. IF Count > 1 
  8937.     ' put the names in the File array 
  8938.     DIM Files(Count) 
  8939.     GetMasterFiles(&Files) 
  8940.     FOR I = 1 to Count 
  8941.        Message(Files(I))' display the names 
  8942.     NEXT 
  8943. ELSE 
  8944.     Message("No master files!") 
  8945. ENDIF 
  8946. END FUNCTION 
  8947.  
  8948. See also: 
  8949.  
  8950.     AmiProIndirect 
  8951.     GetMasterFiles 
  8952.     SetMasterFiles 
  8953.  
  8954.  
  8955. ΓòÉΓòÉΓòÉ 190. GetMode ΓòÉΓòÉΓòÉ
  8956.  
  8957. This function determines whether the program is in Layout Mode, Outline Mode, 
  8958. or Draft Mode. 
  8959.  
  8960.  
  8961. Syntax 
  8962. GetMode() 
  8963.  
  8964. Return Value 
  8965. A number representing the current view mode: 
  8966.     Layout (1) - Layout Mode 
  8967.     Draft (16) - Draft Mode 
  8968.     Outline (48) - Outline Mode 
  8969.  
  8970. Example 
  8971. FUNCTION Example() 
  8972. Mode = GetMode()'What mode is the screen in? 
  8973. IF Mode != 1 
  8974.     LayoutMode()'If not Layout Mode, make it so. 
  8975. ENDIF 
  8976. END FUNCTION 
  8977.  
  8978. See also: 
  8979.  
  8980.     CustomView 
  8981.     DraftMode 
  8982.     EnlargedView 
  8983.     FullPageView 
  8984.     GetViewLevel 
  8985.     LayoutMode 
  8986.     OutlineMode 
  8987.     StandardView 
  8988.  
  8989.  
  8990. ΓòÉΓòÉΓòÉ 191. GetOpenFileCount ΓòÉΓòÉΓòÉ
  8991.  
  8992. This function finds the total number of documents currently open. It is useful 
  8993. in dimensioning an array to hold the names of these files. 
  8994.  
  8995.  
  8996. Syntax 
  8997. GetOpenFileCount() 
  8998.  
  8999. Return Value 
  9000. The total number of documents this instance of Ami Pro currently has open. 
  9001.  
  9002. Example 
  9003. FUNCTION Example() 
  9004. ' get the number of open docs 
  9005. Count = GetOpenFileCount() 
  9006. IF Count > 0 
  9007.     DIM Files(Count) 
  9008.     ' put the files names in the Files array 
  9009.     GetOpenFileNames(&Files) 
  9010.     FOR I = 1 to Count 
  9011.        Message(Files(I))    'display the names 
  9012.     NEXT 
  9013. ELSE 
  9014.     Message("No open files!") 
  9015. ENDIF 
  9016. END FUNCTION 
  9017.  
  9018. See also: 
  9019.  
  9020.     FileClose 
  9021.     FileOpen 
  9022.     GetOpenFileName$ 
  9023.     GetOpenFileNames 
  9024.     SaveAs 
  9025.     Save 
  9026.  
  9027.  
  9028. ΓòÉΓòÉΓòÉ 192. GetOpenFileName ΓòÉΓòÉΓòÉ
  9029.  
  9030. This function retrieves the full path of the current document. If more than one 
  9031. document is open, the name of the file with the focus is returned. 
  9032.  
  9033.  
  9034. Syntax 
  9035. GetOpenFileName$() 
  9036.  
  9037. Return Value 
  9038. The path of the open file. 
  9039. The null string ("") if the current file is "Untitled". 
  9040.  
  9041. Example 
  9042. FUNCTION Example() 
  9043. OpenFile = GetOpenFileName$() 
  9044. Message("The current file is {OpenFile}.") 
  9045. END FUNCTION 
  9046.  
  9047. See also: 
  9048.  
  9049.     GetCurrentDir$ 
  9050.     GetDocInfo$ 
  9051.     GetDocPath$ 
  9052.     GetMacPath$ 
  9053.     GetOpenFileNames 
  9054.     SetDocPath 
  9055.  
  9056.  
  9057. ΓòÉΓòÉΓòÉ 193. GetOpenFileNames ΓòÉΓòÉΓòÉ
  9058.  
  9059. This function fills an array with the names of all open Ami Pro documents. The 
  9060. array may be dimensioned using the GetOpenFileCount function. 
  9061.  
  9062.  
  9063. Syntax 
  9064. GetOpenFileNames(&Array) 
  9065. &Array is the name of the array in which to place the list of open files. 
  9066. Untitled files return the empty string (""). 
  9067.  
  9068. Return Value 
  9069. 1  (TRUE) if the array was filled. 
  9070. 0  (FALSE) if the array was not filled. 
  9071.  
  9072. Example 
  9073. FUNCTION Example() 
  9074. ' get the number of open docs 
  9075. Count = GetOpenFileCount() 
  9076. IF Count > 0 
  9077.     DIM Files(Count) 
  9078.     ' put the file names in the Files array 
  9079.     GetOpenFileNames(&Files) 
  9080.     FOR I = 1 to Count 
  9081.        Message(Files(I))    'display the names 
  9082.     NEXT 
  9083. ELSE 
  9084.     Message("No open files!") 
  9085. ENDIF 
  9086. END FUNCTION 
  9087.  
  9088. See also: 
  9089.  
  9090.     GetOpenFileCount 
  9091.     FileClose 
  9092.     FileOpen 
  9093.     Save 
  9094.     SaveAs 
  9095.     GetOpenFileName$ 
  9096.  
  9097.  
  9098.  
  9099. ΓòÉΓòÉΓòÉ 194. GetPageNo ΓòÉΓòÉΓòÉ
  9100.  
  9101. This function retrieves the page number of the displayed page of the current 
  9102. document. 
  9103.  
  9104.  
  9105. Syntax 
  9106. GetPageNo() 
  9107.  
  9108. Return Value 
  9109. The number of the displayed page of the current document. 
  9110.  
  9111. Example 
  9112. FUNCTION Example() 
  9113. TYPE("[CtrlEND]") 
  9114. PageNo = GetPageNo() 
  9115. Message("There are {PageNo} pages in this document.") 
  9116. END FUNCTION 
  9117.  
  9118. See also: 
  9119.  
  9120.     GetMode 
  9121.     AtEOF 
  9122.     GetFmtPageStr$ 
  9123.     GetBookMarkPage 
  9124.  
  9125.  
  9126. ΓòÉΓòÉΓòÉ 195. GetPowerFieldCount ΓòÉΓòÉΓòÉ
  9127.  
  9128. This function returns the total number of power fields. 
  9129.  
  9130.  
  9131. Syntax 
  9132. GetPowerFieldCount(0) 
  9133.  
  9134. Return Value 
  9135. The number of power fields. 
  9136.  
  9137. Example 
  9138. FUNCTION Example() 
  9139. type = 0 
  9140. ' get the number of power fields 
  9141. Count = GetPowerFieldCount(type) 
  9142. IF Count > 0 
  9143.     DIM Power(Count) 
  9144.     ' get the power fields 
  9145.     GetPowerFields(type, &Power) 
  9146.     FOR i = 1 to Count 
  9147.        ' get the id from the power field 
  9148.        pfid = strfield$(Power(i), 1, ",") 
  9149.        pftype = strfield$(Power(i), 2, ",") 
  9150.        pageno = GetPowerFieldPage(pfid, pftype) 
  9151.        message("Power Field #{i} type {pftype} is on page {pageno}.") 
  9152.     NEXT 
  9153. ELSE 
  9154.     message("No power fields in this document.") 
  9155. ENDIF 
  9156. END FUNCTION 
  9157.  
  9158. See also: 
  9159.  
  9160.     GetPowerFieldPage 
  9161.     GetPowerFields 
  9162.     GoToPowerField 
  9163.  
  9164.  
  9165. ΓòÉΓòÉΓòÉ 196. GetPowerFieldPage ΓòÉΓòÉΓòÉ
  9166.  
  9167. This function returns the page number of a specific power field. 
  9168.  
  9169.  
  9170. Syntax 
  9171. GetPowerFieldPage(ID, 0) 
  9172. ID is the number assigned to a specific power field. You can obtain the ID of 
  9173. the power field by using GetPowerFields. 
  9174.  
  9175. Return Value 
  9176. The page number of the specified power field. 
  9177.  
  9178. Example 
  9179. FUNCTION Example() 
  9180. type = 0 
  9181. ' get the number of power fields 
  9182. Count = GetPowerFieldCount(type) 
  9183. IF Count > 0 
  9184.     DIM Power(Count) 
  9185.     ' get the power fields 
  9186.     GetPowerFields(type, &Power) 
  9187.     FOR i = 1 to Count 
  9188.        ' get the id and type from the power field 
  9189.        pfid = strfield$(Power(i), 1, ",") 
  9190.        pftype = strfield$(Power(i), 2, ",") 
  9191.        pageno = GetPowerFieldPage(pfid, pftype) 
  9192.        message("Power Field #{i} type {pftype} is on page {pageno}.") 
  9193.     NEXT 
  9194. ELSE 
  9195.     message("No power fields in this document.") 
  9196. ENDIF 
  9197. END FUNCTION 
  9198.  
  9199. See also: 
  9200.  
  9201.     GetPowerFieldCount 
  9202.     GoToPowerField 
  9203.     GetPowerFields 
  9204.  
  9205.  
  9206. ΓòÉΓòÉΓòÉ 197. GetPowerFields ΓòÉΓòÉΓòÉ
  9207.  
  9208. This function fills an array with any power fields located in the current 
  9209. document. You can dimension the array by using GetPowerFieldCount. 
  9210.  
  9211.  
  9212. Syntax 
  9213. GetPowerFields(Type, &Array) 
  9214. Array is the name of the array in which to place the power fields. The format 
  9215. returned in the array is "ID, type, power field." Document variables are only 
  9216. returned when type 10 is specified. The format for document variables are 
  9217. "name=value". 
  9218. Note the use of indirection (&). 
  9219.  
  9220. Return Value 
  9221. The number of power fields returned in the array. 
  9222.  
  9223. Example 
  9224. FUNCTION Example() 
  9225. Count = GetPowerFieldCount(0)  ' Get the User powerfields 
  9226. If count <1 
  9227.     Message("No powerfields are in this document.") 
  9228.     Exit Function       ' No powerfields, Exit macro 
  9229. Endif 
  9230. DIM Power(Count) 
  9231. GetPowerFields(0, &Power) 
  9232. FOR i = 1 to Count 
  9233.     pfid = strfield$(Power(i), 1, ",") 
  9234.     pftype = strfield$(Power(i), 2, ",") 
  9235.     pageno = GetPowerFieldPage(pfid, pftype) 
  9236. NEXT 
  9237. GoToPowerField(pfid, pftype) 
  9238. END FUNCTION 
  9239.  
  9240. See also: 
  9241.  
  9242.     GetPowerFieldCount 
  9243.     GetPowerFieldPage 
  9244.  
  9245.  
  9246. ΓòÉΓòÉΓòÉ 198. GetProfileString ΓòÉΓòÉΓòÉ
  9247.  
  9248. This function retrieves an entry from a text file such as the AMIUSER3.INI 
  9249. file. 
  9250.  
  9251.  
  9252. Syntax 
  9253. GetProfileString$(Section, Key[, FileName]) 
  9254. Section is the section in the file to look in. If this is the empty string 
  9255. (""), the [Ami Pro] section is searched. 
  9256. Key is the desired entry in the file. If this is zero (0), or a null string 
  9257. (""), all the keys from the [Ami Pro] section are returned separated with a 
  9258. tilde (~). 
  9259. FileName is optional, and specifies the file to look in. 
  9260.  
  9261. Return Value 
  9262. A string with the contents of the entry. 
  9263. The null string ("") if the entry doesn't exist. 
  9264.  
  9265. Example 
  9266. function Example() 
  9267. 'check for current measurement setting 
  9268. units=GetProfileString$("AmiUser", "DefaultUnit", "amiuser3.ini") 
  9269. message("Units are set to {units}.") 
  9270. end function 
  9271.  
  9272. See also: 
  9273.  
  9274.     GetMacPath$ 
  9275.     WriteProfileString 
  9276.     GetAmiDirectory$ 
  9277.  
  9278.  
  9279. ΓòÉΓòÉΓòÉ 199. GetRunningMacroFile ΓòÉΓòÉΓòÉ
  9280.  
  9281. This function returns the file name, including full path, of the currently 
  9282. running macro. This function is useful in allowing a function to call another 
  9283. function in the same file, even if the file name has been changed. 
  9284.  
  9285.  
  9286. Syntax 
  9287. GetRunningMacroFile$() 
  9288.  
  9289. Return Value 
  9290. A string containing the full path and file name of the currently running macro. 
  9291.  
  9292. Example 
  9293. FUNCTION Example() 
  9294. MacFile = GetRunningMacroFile$() 
  9295. MacName = GetRunningMacroName$() 
  9296. Message("This macro file is {MacFile}.") 
  9297. Message("This function is {MacName}.") 
  9298. END FUNCTION 
  9299.  
  9300. See also: 
  9301.  
  9302.     GetMacPath$ 
  9303.     GetRunningMacroName$ 
  9304.  
  9305.  
  9306. ΓòÉΓòÉΓòÉ 200. GetRunningMacroName ΓòÉΓòÉΓòÉ
  9307.  
  9308. This function returns the name of the currently running macro function. 
  9309.  
  9310.  
  9311. Syntax 
  9312. GetRunningMacroName$() 
  9313.  
  9314. Return Value 
  9315. A string containing the name of the currently running macro function. 
  9316.  
  9317. Example 
  9318. FUNCTION Example() 
  9319. MacFile = GetRunningMacroFile$() 
  9320. MacName = GetRunningMacroName$() 
  9321. Message("This macro file is {MacFile}.") 
  9322. Message("This function is {MacName}.") 
  9323. END FUNCTION 
  9324.  
  9325. See also: 
  9326.  
  9327.     GetMacPath$ 
  9328.     GetRunningMacroFile$ 
  9329.  
  9330.  
  9331. ΓòÉΓòÉΓòÉ 201. GetSpecialEffects ΓòÉΓòÉΓòÉ
  9332.  
  9333. This function returns the text located at the beginning of a paragraph style. 
  9334. The text is the text that is specified in Style Modify Style and choosing 
  9335. Bullets/Numbers. 
  9336.  
  9337.  
  9338. Syntax 
  9339. GetSpecialEffects$() 
  9340.  
  9341. Return Value 
  9342. The text that is located at the beginning of the paragraph style. 
  9343. 0  (UserCancel) if the user canceled the function. 
  9344. -2  (GeneralFailure) if the special effects could not be retrieved. 
  9345.  
  9346. Example 
  9347. FUNCTION Example() 
  9348. Effects = GetSpecialEffects$() 
  9349. IF Effects = "" 
  9350.     Message("There is no text in special effects on this paragraph.") 
  9351. ELSE 
  9352.     Message("{Effects} is appended to this style.") 
  9353. ENDIF 
  9354. END FUNCTION 
  9355.  
  9356. See also: 
  9357.  
  9358.     ModifyStyle 
  9359.     ModifyLines 
  9360.     ModifyAlignment 
  9361.     ModifyReflow 
  9362.     ModifyBreaks 
  9363.     ModifySelect 
  9364.     ModifyEffects 
  9365.     ModifySpacing 
  9366.     ModifyFont 
  9367.     ModifyTable 
  9368.  
  9369.  
  9370. ΓòÉΓòÉΓòÉ 202. GetStyleCount ΓòÉΓòÉΓòÉ
  9371.  
  9372. This function returns the number of paragraph styles in the current document. 
  9373.  
  9374.  
  9375. Syntax 
  9376. GetStyleCount() 
  9377.  
  9378. Return Value 
  9379. The number of paragraph styles in the current document. 
  9380.  
  9381. Example 
  9382. FUNCTION Example() 
  9383. Count = GetStyleCount() 
  9384. DIM Styles(Count) 
  9385. GetStyleNames(&Styles) 
  9386. END FUNCTION 
  9387.  
  9388. See also: 
  9389.  
  9390.     GetStyleNames 
  9391.  
  9392.  
  9393. ΓòÉΓòÉΓòÉ 203. GetStyleName ΓòÉΓòÉΓòÉ
  9394.  
  9395. This function determines the name of the paragraph style assigned to the 
  9396. current paragraph. 
  9397.  
  9398.  
  9399. Syntax 
  9400. GetStyleName$() 
  9401.  
  9402. Return Value 
  9403. A string with the name of the paragraph style. 
  9404.  
  9405. Example 
  9406. FUNCTION Example() 
  9407. curstyle = GetStyleName$() 
  9408. newstyle = "Number List" 
  9409. SetStyle(newstyle) 
  9410. TYPE("This is what the {newstyle} style looks like.[Enter]") 
  9411. SetStyle(curstyle) 
  9412. END FUNCTION 
  9413.  
  9414. See also: 
  9415.  
  9416.     ModifyStyle 
  9417.     SelectStyle 
  9418.     SetStyle 
  9419.  
  9420.  
  9421. ΓòÉΓòÉΓòÉ 204. GetStyleNames ΓòÉΓòÉΓòÉ
  9422.  
  9423. This function fills an array with the names of the paragraph styles in the 
  9424. current document. The array may be dimensioned using the GetStyleCount 
  9425. function. 
  9426.  
  9427.  
  9428. Syntax 
  9429. GetStyleNames(&Array) 
  9430. Array is the name of the array in which to place the names of the paragraph 
  9431. styles. 
  9432. Note the use of indirection (&). 
  9433.  
  9434. Return Value 
  9435. This function returns the paragraph style names. 
  9436.  
  9437. Example 
  9438. FUNCTION Example() 
  9439. Count = GetStyleCount() 
  9440. DIM Styles(Count) 
  9441. GetStyleNames(&Styles) 
  9442. END FUNCTION 
  9443.  
  9444. See also: 
  9445.  
  9446.     GetStyleCount 
  9447.  
  9448.  
  9449. ΓòÉΓòÉΓòÉ 205. GetStylePath ΓòÉΓòÉΓòÉ
  9450.  
  9451. This function returns the drive and directory of the default style sheet path. 
  9452.  
  9453.  
  9454. Syntax 
  9455. GetStylePath$() 
  9456.  
  9457. Return Value 
  9458. A string containing the current default paragraph style sheet path. 
  9459.  
  9460. Example 
  9461. FUNCTION Example() 
  9462. AmiDir = GetAmiDirectory$() 
  9463. CurDir = GetCurrentDir$() 
  9464. DocPath = GetDocPath$() 
  9465. StylePath = GetStylePath$() 
  9466. MacPath = GetMacPath$() 
  9467. Message("Ami Pro is in {AmiDir}.") 
  9468. Message("DOS reports the current directory is {CurDir}.") 
  9469. Message("Ami Pro's default doc path is {DocPath}.") 
  9470. Message("Ami Pro's default macro path is {MacPath}.") 
  9471. Message("Ami Pro's default style path is {StylePath}.") 
  9472. END FUNCTION 
  9473.  
  9474. See also: 
  9475.  
  9476.     GetBackPath$ 
  9477.     GetDocPath$ 
  9478.     GetHomeDirectory$ 
  9479.     GetMacPath$ 
  9480.     SetBackPath 
  9481.     SetDocPath 
  9482.     SetStylePath 
  9483.  
  9484.  
  9485. ΓòÉΓòÉΓòÉ 206. GetTextBeforeCursor ΓòÉΓòÉΓòÉ
  9486.  
  9487. This function retrieves the text between the beginning of the paragraph the 
  9488. insertion point is in and the insertion point. 
  9489.  
  9490.  
  9491. Syntax 
  9492. GetTextBeforeCursor$() 
  9493.  
  9494. Return Value 
  9495. A string with the contents of the paragraph prior to the insertion point. 
  9496.  
  9497. Example 
  9498. FUNCTION Example() 
  9499. Text = GetTextBeforeCursor$() 
  9500. Length = len(Text) 
  9501. Message("You are {Length} characters into the current paragraph.") 
  9502. END FUNCTION 
  9503.  
  9504. See also: 
  9505.  
  9506.     CurChar$ 
  9507.     CurShade$ 
  9508.     CurWord$ 
  9509.     GetMarkText$ 
  9510.     TYPE 
  9511.  
  9512.  
  9513. ΓòÉΓòÉΓòÉ 207. GetTime ΓòÉΓòÉΓòÉ
  9514.  
  9515. This function determines the amount of time that has elapsed since OS/2 was 
  9516. started. 
  9517.  
  9518.  
  9519. Syntax 
  9520. GetTime() 
  9521.  
  9522. Return Value 
  9523. The number of milliseconds since OS/2 was started. 
  9524.  
  9525. Example 
  9526. FUNCTION Example() 
  9527. CurrentTime = GetTime() 
  9528. Message("{CurrentTime} milliseconds since OS/2 was started.") 
  9529. END FUNCTION 
  9530.  
  9531. See also: 
  9532.  
  9533.     Pause 
  9534.     RunLater 
  9535.     Now 
  9536.     FormatDate$ 
  9537.     FormatTime$ 
  9538.  
  9539.  
  9540. ΓòÉΓòÉΓòÉ 208. GetViewLevel ΓòÉΓòÉΓòÉ
  9541.  
  9542. This function returns the current Layout Mode View level. 
  9543.  
  9544.  
  9545. Syntax 
  9546. GetViewLevel() 
  9547.  
  9548. Return Value 
  9549. A number representing the current view level: 
  9550.     FullPage (201) - Full Page View 
  9551.     Custom (202) - Custom View 
  9552.     Standard (203) - Standard View 
  9553.     Enlarged (204) - Enlarged View 
  9554.  
  9555. Example 
  9556. FUNCTION Example() 
  9557. Level = GetViewLevel() 
  9558. SWITCH Level 
  9559. CASE 201 
  9560. Level = "Full Page View" 
  9561. CASE 202 
  9562. Level = "Custom View" 
  9563. CASE 203 
  9564. Level = "Standard View" 
  9565. CASE 204 
  9566. Level = "Enlarged View" 
  9567. ENDSWITCH 
  9568. Message("The current view level is at {Level}.") 
  9569. END FUNCTION 
  9570.  
  9571. See also: 
  9572.  
  9573.     GetMode 
  9574.     DraftMode 
  9575.     LayoutMode 
  9576.     FullPageView 
  9577.     CustomView 
  9578.     StandardView 
  9579.     EnlargedView 
  9580.     FacingView 
  9581.  
  9582.  
  9583. ΓòÉΓòÉΓòÉ 209. GetViewPrefLevel ΓòÉΓòÉΓòÉ
  9584.  
  9585. This function gets the custom view percent from the View View Preferences 
  9586. function. It is used to change the custom view percent in the ViewPreferences 
  9587. function. 
  9588.  
  9589.  
  9590. This function must be used with the GetViewPrefOpts function. 
  9591.  
  9592. Syntax 
  9593. GetViewPrefLevel() 
  9594.  
  9595. Return Value 
  9596. The value of the view level which is a number from 10-400. 
  9597.  
  9598. Example 
  9599. FUNCTION TurnOffNotes() 
  9600. Viewopts=GetViewPrefOpts() ' get the View Preferences options 
  9601. Viewlevel=GetViewPrefLevel() ' get the View Preferences level 
  9602. IF(Viewopts & 2048) ' notes turned on? 
  9603.     Viewopts=Viewopts - 2048 ' turn notes display off in options 
  9604. ENDIF 
  9605. ViewPreferences(Viewopts, Viewlevel) ' set new options 
  9606. END FUNCTION 
  9607.  
  9608. See also: 
  9609.  
  9610.     GetViewPrefOpts 
  9611.     ViewPreferences 
  9612.  
  9613.  
  9614. ΓòÉΓòÉΓòÉ 210. GetViewPrefOpts ΓòÉΓòÉΓòÉ
  9615.  
  9616. This function retrieves the current Options parameter from the View Preferences 
  9617. function. This function is required to change the View Preferences in a macro 
  9618. when you need to know the current options to modify that value. 
  9619.  
  9620.  
  9621. You must get the view options as well as the view level using the 
  9622. GetViewPrefLevel function to change View Preferences. 
  9623.  
  9624. Syntax 
  9625. GetViewPrefOpts() 
  9626.  
  9627. Return Value 
  9628. The value of the View Preferences option. 
  9629.  
  9630. Example 
  9631. FUNCTION TurnOffNotes() 
  9632. Viewopts=GetViewPrefOpts() ' get the View Preferences options 
  9633. Viewlevel=GetViewPrefLevel() ' get the View Preferences level 
  9634. IF(Viewopts & 2048) ' notes turned on? 
  9635.     Viewopts=Viewopts - 2048 ' turn notes display off in options 
  9636. ENDIF 
  9637. ViewPreferences(Viewopts, Viewlevel) ' set new options 
  9638. END FUNCTION 
  9639.  
  9640. See also: 
  9641.  
  9642.     GetViewPrefLevel 
  9643.     View Preferences 
  9644.  
  9645.  
  9646.  
  9647. ΓòÉΓòÉΓòÉ 211. Glossary ΓòÉΓòÉΓòÉ
  9648.  
  9649. This function inserts the named glossary item into the document at the 
  9650. insertion point. This function is equivalent to choosing Edit Insert Glossary 
  9651. Record. To set the glossary file before inserting items, use the GlossSet 
  9652. function. 
  9653.  
  9654.  
  9655. Syntax 
  9656. Glossary(Item) 
  9657. Item is the name of the glossary item to insert. 
  9658.  
  9659. To display the Glossary dialog box and allow the user to select the name of the 
  9660. glossary item to insert: Glossary 
  9661.  
  9662. Return Value 
  9663. 1  (TRUE) if a glossary item was inserted. 
  9664. 0  (UserCancel) if the user canceled the menu function. 
  9665. -2  (GeneralFailure) if the item could not be inserted or if the item was not 
  9666. found. 
  9667.  
  9668. Example 
  9669. FUNCTION Example() 
  9670. Gloss = Query$("What glossary file do you want to use?") 
  9671. GlossSet(Gloss) 
  9672. Glossary 
  9673. END FUNCTION 
  9674.  
  9675. See also: 
  9676.  
  9677.     GlossaryAdd 
  9678.     GlossaryClose 
  9679.     GlossaryLookup 
  9680.     GlossaryOpen 
  9681.     GlossSet 
  9682.  
  9683.  
  9684.  
  9685. ΓòÉΓòÉΓòÉ 212. GlossaryAdd ΓòÉΓòÉΓòÉ
  9686.  
  9687. This function adds the currently selected text to the current glossary file. It 
  9688. is the equivalent to choosing Edit Mark Text Glossary. 
  9689.  
  9690.  
  9691. Syntax 
  9692. GlossaryAdd(Item, FileName, Flag) 
  9693. Item is the glossary item name to insert into the glossary data file. 
  9694. FileName is the name of the glossary file in which to insert the new item. 
  9695. Flag is a number that defines whether the Filename parameter is a file name. 
  9696.     FALSE (0) - Filename parameter is a file name 
  9697.     TRUE (1) - Filename parameter is an object name 
  9698.  
  9699. To display the Mark Glossary dialog box and allow the user to select the item 
  9700. name and glossary data file: GlossaryAdd 
  9701.  
  9702. Return Value 
  9703. 1  (TRUE) if the glossary record was inserted. 
  9704. 0  (NoAction) if no action was taken. 
  9705. -2  (GeneralFailure) if the glossary record could not be inserted, if the data 
  9706. file is not an Ami Pro file, or if the data file is encrypted. 
  9707.  
  9708. Example 
  9709. FUNCTION Example() 
  9710. WHILE "" = CurShade$() 
  9711.     UserControl("Select the text to place in the glossary, then choose 
  9712.  Resume...") 
  9713. WEND 
  9714. GlossaryAdd 
  9715. END FUNCTION 
  9716.  
  9717. See also: 
  9718.  
  9719.     GlossaryClose 
  9720.     GlossaryLookup 
  9721.     Glossary 
  9722.     GlossaryOpen 
  9723.     GlossSet 
  9724.  
  9725.  
  9726.  
  9727. ΓòÉΓòÉΓòÉ 213. GlossaryClose ΓòÉΓòÉΓòÉ
  9728.  
  9729. This function closes a glossary data file. 
  9730.  
  9731.  
  9732. You must use GlossaryClose after you use GlossaryOpen. 
  9733.  
  9734. Syntax 
  9735. GlossaryClose(handle) 
  9736. Handle is the value returned by GlossaryOpen. 
  9737.  
  9738. Return Value 
  9739.  
  9740. Example 
  9741. Function Gloss() 
  9742. docpath = GetDocPath$() 
  9743. h = GlossaryOpen("{docpath}glossary.sam") 
  9744. if h 
  9745.     record = GlossaryLookup(h, "id") 
  9746.     message(id) 
  9747.     GlossaryClose(h) 
  9748. endif 
  9749. end function 
  9750.  
  9751. See also: 
  9752.  
  9753.     GlossaryAdd 
  9754.     GlossaryLookup 
  9755.     Glossary 
  9756.     GlossaryOpen 
  9757.     GlossSet 
  9758.  
  9759.  
  9760. ΓòÉΓòÉΓòÉ 214. GlossaryLookup ΓòÉΓòÉΓòÉ
  9761.  
  9762. This function looks up a record in a glossary data file. 
  9763.  
  9764.  
  9765. You must use GlossaryOpen to open the data file before you can use 
  9766. GlossaryLookup to locate a record in a glossary data file. 
  9767.  
  9768. Syntax 
  9769. GlossaryLookup(Handle, Keyword) 
  9770. Handle is the value returned by GlossaryOpen. 
  9771. Keyword is the ID of the record in the glossary data file you want to lookup. 
  9772.  
  9773. Return Value 
  9774. The record in the glossary data file. This is limited to one paragraph or 500 
  9775. characters, whichever comes first. 
  9776. If the Keyword is not found, the null string is returned. 
  9777.  
  9778. Example 
  9779. Function Gloss() 
  9780. docpath = GetDocPath$() 
  9781. h = GlossaryOpen("{docpath}glossary.sam") 
  9782. if h 
  9783.     record = GlossaryLookup(h, "id") 
  9784.     message(id) 
  9785.     GlossaryClose(h) 
  9786. endif 
  9787. end function 
  9788.  
  9789. See also: 
  9790.  
  9791.     GlossaryAdd 
  9792.     GlossaryClose 
  9793.     GlossaryLookup 
  9794.     Glossary 
  9795.     GlossaryOpen 
  9796.     GlossSet 
  9797.  
  9798.  
  9799.  
  9800. ΓòÉΓòÉΓòÉ 215. GlossaryOpen ΓòÉΓòÉΓòÉ
  9801.  
  9802. This function opens a glossary data file. Once the glossary file is open, you 
  9803. can retrieve a record from the file. 
  9804.  
  9805.  
  9806. You must use GlossaryClose after you use GlossaryOpen. 
  9807.  
  9808. Syntax 
  9809. GlossaryOpen("{path}FileName") 
  9810. Path is the location of the glossary data file. 
  9811. FileName is the name of glossary data file you want to open. 
  9812.  
  9813. Return Value 
  9814. Handle of glossary file, if the file is found. 
  9815. 0 if the file is not found. 
  9816.  
  9817. Example 
  9818. Function Gloss() 
  9819. docpath = GetDocPath$() 
  9820. h = GlossaryOpen("{docpath}glossary.sam") 
  9821. if h 
  9822.     record = GlossaryLookup(h, "id") 
  9823.     message(id) 
  9824.     GlossaryClose(h) 
  9825. endif 
  9826. end function 
  9827.  
  9828. See also: 
  9829.  
  9830.     GlossaryAdd 
  9831.     GlossaryClose 
  9832.     GlossaryLookup 
  9833.     Glossary 
  9834.     GlossaryOpen 
  9835.     GlossSet 
  9836.  
  9837.  
  9838. ΓòÉΓòÉΓòÉ 216. GlossSet ΓòÉΓòÉΓòÉ
  9839.  
  9840. This function selects the named glossary file to use as the source file for 
  9841. insertion of glossary items. This function is equivalent to choosing Edit 
  9842. Insert Glossary Record and choosing Data File. 
  9843.  
  9844.  
  9845. Syntax 
  9846. GlossSet(FileName) 
  9847. FileName is the name of the glossary file from which to select records. 
  9848.  
  9849. To display the Glossary dialog box and allow the user to select the name of the 
  9850. glossary file: Glossary 
  9851.  
  9852. Return Value 
  9853. 1  (TRUE) if a glossary file was selected. 
  9854. -2  (GeneralFailure) if the file could not be selected or if the file was not 
  9855. found. 
  9856.  
  9857. Example 
  9858. FUNCTION Example() 
  9859. Gloss = Query$("What glossary file do you want to use?") 
  9860. GlossSet(Gloss) 
  9861. Glossary 
  9862. END FUNCTION 
  9863.  
  9864. See also: 
  9865.  
  9866.     GlossaryAdd 
  9867.     GlossaryClose 
  9868.     GlossaryLookup 
  9869.     Glossary 
  9870.     GlossaryOpen 
  9871.  
  9872.  
  9873. ΓòÉΓòÉΓòÉ 217. GoToAgain ΓòÉΓòÉΓòÉ
  9874.  
  9875. This function goes to the next location of an item after using the GoToCmd 
  9876. function. This function is equivalent to choosing Edit Go To and selecting OK. 
  9877.  
  9878.  
  9879. Syntax 
  9880. GoToAgain() 
  9881.  
  9882. Return Value 
  9883. 1  (TRUE) if the item was located. 
  9884. 0  (UserCancel) if the user canceled the function. 
  9885. -3  if the input was invalid. 
  9886. -7  if the item to Go To could not be found. 
  9887. -2  if any other error. 
  9888.  
  9889. Example 
  9890. FUNCTION Example() 
  9891. WHILE not AtEOF() 
  9892.     GoToCmd(4, 0, GoField) 
  9893.     TYPE("[DEL]") 
  9894. WEND 
  9895. END FUNCTION 
  9896.  
  9897. See also: 
  9898.  
  9899.     GoToCmd 
  9900.  
  9901.  
  9902. ΓòÉΓòÉΓòÉ 218. GoToCmd ΓòÉΓòÉΓòÉ
  9903.  
  9904. This function allows the user to go to a page or a mark. This function is 
  9905. equivalent to choosing Edit Go To. 
  9906.  
  9907.  
  9908. Syntax 
  9909. GoToCmd(Which, Page, Name) 
  9910. Which is a flag that determines what type of object to Go To, and can be one of 
  9911. the following: 
  9912.     GoPage (1) - Goes to the page number specified in the Page  Parameter. 
  9913.     GoFirst (2) - Goes to the first page of the document. 
  9914.     GoLast (3) - Goes to the last page of the document. 
  9915.     GoMark (4) - Goes to the mark specified in the MarkName parameter. 
  9916. To go to a specific page, set the Which parameter to 1, set the Page parameter 
  9917. to the page number you want to go to, and set the MarkName parameter to 0. 
  9918. Parameters not necessary for a specific function may be set to 0. However, 
  9919. Keystroke Record may use other numbers. These numbers are ignored, but must be 
  9920. present. 
  9921. To go to the first or last page, set the Which parameter to either 2 or 3, and 
  9922. set the Page parameter and the MarkName parameter to 0. 
  9923. To go to a mark, set the Which parameter to 4, set the Page parameter to 0, and 
  9924. set the MarkName parameter to the value for the mark you want to go to. 
  9925. Page is the page number to go to if you want to go to a page number. 
  9926. Name is the type of mark to go to if you want to go to a mark. It can be one of 
  9927. the following: 
  9928.     GoFrame (1) - Go to the next frame 
  9929.     GoHeader (2) - Go to the header area 
  9930.     GoFooter (3) - Go to the footer area 
  9931.     GoField (4) - Go to the next field 
  9932.     GoTab (5) - Go to the tab ruler 
  9933.     GoRuler (6) - Go to the next tab ruler mark in the text 
  9934.     GoFootnote (7) - Go to the next footnote mark 
  9935.     GoFoottext (8) - Go to the text of the footnote 
  9936.     GoPageBreak (9) - Go to the next hard page break 
  9937.     GoNote (10) - Go to the next note 
  9938.     GoLayout (11) - Go to the next layout change 
  9939.     GoBookmark (12) - Go to the next Bookmark 
  9940.     GoHF (13) - Go to the next floating Header/Footer mark 
  9941.  
  9942. To display the Go To dialog box and allow the user to select the parameters for 
  9943. the Go To function: GoToCmd 
  9944.  
  9945. Return Value 
  9946. 1  (TRUE) if the desired location was reached. 
  9947. 0  (UserCancel) if the user canceled the function. 
  9948. -3  if the desired mark could not be found (for example, going to a frame in 
  9949. Draft Mode). 
  9950. -7  if the desired location could not be found. 
  9951. -2  if any other error. 
  9952.  
  9953. Example 
  9954. FUNCTION Example() 
  9955. WHILE not AtEOF() 
  9956.     GoToCmd(4, 0, GoField) 
  9957.     TYPE("[DEL]") 
  9958. WEND 
  9959. END FUNCTION 
  9960.  
  9961. See also: 
  9962.  
  9963.     GetMarkText$ 
  9964.     Replace 
  9965.     GoToAgain 
  9966.  
  9967.  
  9968. ΓòÉΓòÉΓòÉ 219. GoToPowerField ΓòÉΓòÉΓòÉ
  9969.  
  9970. This function moves the insertion point to a specific power field. 
  9971.  
  9972.  
  9973. Syntax 
  9974. GoToPowerField(ID, 0) 
  9975. ID is the number assigned to a specific power field. You can obtain the ID by 
  9976. using GetPowerFields. 
  9977.  
  9978. Return Value 
  9979. 1 (TRUE) if the power field is located. 
  9980. 0 (FALSE) if the power field is not located. 
  9981.  
  9982. Example 
  9983. FUNCTION Example() 
  9984. Count = GetPowerFieldCount(9)  ' Get the User powerfields 
  9985. If count <1 
  9986.     Message("No powerfields are in this document.") 
  9987.     Exit Function       ' No powerfields, Exit macro 
  9988. Endif 
  9989. DIM Power(Count) 
  9990. GetPowerFields(0, &Power) 
  9991. FOR i = 1 to Count 
  9992.     pfid = strfield$(Power(i), 1, ",") 
  9993.     pftype = strfield$(Power(i), 2, ",") 
  9994.     pageno = GetPowerFieldPage(pfid, pftype) 
  9995. NEXT 
  9996. GoToPowerField(pfid, pftype) 
  9997. END FUNCTION 
  9998.  
  9999. See also: 
  10000.  
  10001.     GetPowerFieldCount 
  10002.     GetPowerFieldPage 
  10003.     GetPowerFields 
  10004.  
  10005.  
  10006. ΓòÉΓòÉΓòÉ 220. GrayMenuItem ΓòÉΓòÉΓòÉ
  10007.  
  10008. This function grays or ungrays a menu item. When a menu item is grayed, it 
  10009. appears on the menu, but the user cannot select it. Use this function to 
  10010. indicate that the function is currently unavailable. 
  10011.  
  10012.  
  10013. Syntax 
  10014. GrayMenuItem(BarID, MenuName, Item, State) 
  10015. BarID is the identification number of the menu bar and must always be 1. 
  10016. MenuName is the name of the menu where the item to be grayed is located. The 
  10017. name must include any ampersand (&) characters used in the menu name. An 
  10018. ampersand is placed before a character that has an underline. 
  10019. Item is the name of the menu item to be grayed, and must match the actual menu 
  10020. item, including any ampersand (&) characters. If the menu item has a shortcut 
  10021. key, you must press TAB, type a ^, and then type the appropriate letter as part 
  10022. of the item name. 
  10023. State is either 1 (TRUE) to gray the menu item, or 0 (FALSE) to ungray the menu 
  10024. item. 
  10025.  
  10026. Return Value 
  10027. 1  (TRUE) if the item was successfully grayed or ungrayed. 
  10028. 0  (FALSE) if the item could not be grayed/ungrayed, or if an invalid BarID, 
  10029. MenuName, or ItemName was used. 
  10030.  
  10031. Example 
  10032. FUNCTION Example() 
  10033. ' This example might be used if you wanted to prevent users from applying 
  10034. special 
  10035. ' effects attributes to text of a file that may be exported to another format 
  10036. GrayMenuItem(1, "&Text", "Special &Effects...", 1) ' gray the menu item 
  10037. OnCancel RestoreIt ' in case the user cancels 
  10038. ' pause the macro 
  10039. UserControl("Inspect the ""Text"" menu then select Resume") 
  10040. RestoreIt: 
  10041. GrayMenuItem(1, "&Text", "Special &Effects...", 0) ' ungray the menu item 
  10042. END FUNCTION 
  10043.  
  10044. See also: 
  10045.  
  10046.     AddMenu 
  10047.     AddMenuItem 
  10048.     ChangeMenuAction 
  10049.     CheckMenuItem 
  10050.     DeleteMenu 
  10051.     DeleteMenuItem 
  10052.     RenameMenuItem 
  10053.  
  10054.  
  10055. ΓòÉΓòÉΓòÉ 221. HeaderFooter ΓòÉΓòÉΓòÉ
  10056.  
  10057. This function goes to the header or footer or displays the Floating Header 
  10058. Footer dialog box. This function is equivalent to choosing Page Header Footer. 
  10059.  
  10060.  
  10061. Syntax 
  10062. HeaderFooter(Function) 
  10063. Function is a flag that can be one of the following: 
  10064.     (1) - Go to the header 
  10065.     (2) - Go to the footer 
  10066.     (3) - Display Floating Header/Footer dialog box 
  10067.  
  10068. To display the Headers & Footers dialog box: HeaderFooter 
  10069.  
  10070. Return Value 
  10071. This function returns: 
  10072. 0  (UserCancel) if the user cancels the function. 
  10073. 1  (TRUE) if the header or footer is found or the Floating Header/Footer dialog 
  10074. box displays. 
  10075. -6  (NoMemory) if the function fails because of insufficient memory. 
  10076.  
  10077. Example 
  10078. FUNCTION Example() 
  10079. HeaderFooter(1)  ' Go to the header 
  10080. Type("This is a test.") 
  10081. END FUNCTION 
  10082.  
  10083. See also: 
  10084.  
  10085.     GoToCmd 
  10086.     ModifyLayout 
  10087.     PageNumber 
  10088.  
  10089.  
  10090. ΓòÉΓòÉΓòÉ 222. Help ΓòÉΓòÉΓòÉ
  10091.  
  10092. This function displays the online Help for Ami Pro. This function is equivalent 
  10093. to choosing Help Contents, but it does not select a Help topic automatically. 
  10094. Because Help displays in a window other than the regular Ami Pro window, 
  10095. further macro functions which cause a repainting of the Ami Pro window cause 
  10096. the Help window to be replaced by the Ami Pro window. 
  10097.  
  10098.  
  10099. If this function is used, it should be the last function used in the macro. 
  10100.  
  10101. Syntax 
  10102. Help() 
  10103.  
  10104. Return Value 
  10105. This  Function Returns: 
  10106. 1  (TRUE) if the Help window was displayed. 
  10107. -2  (GeneralFailure) if the Help window could not be displayed for some other 
  10108. reason. 
  10109. -6  (NoMemory) if the function failed because of insufficient memory. 
  10110.  
  10111. Example 
  10112. FUNCTION Example() 
  10113. Help() 
  10114. END FUNCTION 
  10115.  
  10116. See also: 
  10117.  
  10118.     About 
  10119.     HowDoIHelp 
  10120.     MacroHelp 
  10121.     UsingHelp 
  10122.  
  10123.  
  10124. ΓòÉΓòÉΓòÉ 223. HideIconBar ΓòÉΓòÉΓòÉ
  10125.  
  10126. This function hides the set of SmartIcons. This function is equivalent to 
  10127. choosing View Hide SmartIcons. 
  10128.  
  10129.  
  10130. Syntax 
  10131. HideIconBar() 
  10132.  
  10133. Return Value 
  10134. 1  (TRUE) if the icon bar was hidden. 
  10135. 0  (NoAction) if no action was taken because the icon bar was already hidden. 
  10136.  
  10137. Example 
  10138. FUNCTION Example() 
  10139. ReturnValue = HideIconBar() 
  10140. IF ReturnValue != 1 
  10141.     IF Decide("Icon bar already hidden! Would you like it displayed?") 
  10142.        ShowIconBar() 
  10143.     ENDIF 
  10144. ENDIF 
  10145. END FUNCTION 
  10146.  
  10147. See also: 
  10148.  
  10149.     ChangeIcons 
  10150.     GetIconPalette 
  10151.     IconCustomize 
  10152.     SetIconPath 
  10153.     SetIconSize 
  10154.     ShowIconBar 
  10155.     ToggleIconBar 
  10156.     ViewPreferences 
  10157.  
  10158.  
  10159. ΓòÉΓòÉΓòÉ 224. HideTabRuler ΓòÉΓòÉΓòÉ
  10160.  
  10161. This function removes the tab ruler from the top of the screen. This function 
  10162. is equivalent to choosing View Hide Ruler. 
  10163.  
  10164.  
  10165. Syntax 
  10166. HideTabRuler() 
  10167.  
  10168. Return Value 
  10169. 1  (TRUE) if the tab ruler was hidden. 
  10170. 0  (NoAction) if no action was taken because the tab ruler was already hidden. 
  10171.  
  10172. Example 
  10173. FUNCTION Example() 
  10174. HideTabRuler() 
  10175. END FUNCTION 
  10176.  
  10177. See also: 
  10178.  
  10179.     ShowTabRuler 
  10180.     ToggleTabRuler 
  10181.     ViewPreferences 
  10182.  
  10183.  
  10184. ΓòÉΓòÉΓòÉ 225. HourGlass ΓòÉΓòÉΓòÉ
  10185.  
  10186. This function turns on or off the OS/2 clock mouse pointer. The original state 
  10187. of the clock can be determined from the function's return value. If a macro 
  10188. changes the state of the clock mouse pointer, it must restore the original 
  10189. state before exiting. If it does not restore the mouse pointer, the insertion 
  10190. point is incorrect from that point on. 
  10191.  
  10192.  
  10193. Syntax 
  10194. HourGlass(State) 
  10195. State is either On (1) to turn on the clock mouse pointer or Off (0) to turn it 
  10196. off. 
  10197.  
  10198. Return Value 
  10199. 1  (TRUE) if the clock was on prior to using the clock function. 
  10200. 0  (FALSE) if the clock was off. 
  10201.  
  10202. Example 
  10203. FUNCTION Example() 
  10204. IgnoreKeyboard(1) 
  10205. HourGlass(1) 
  10206. StatusBarMsg("Importing graphic file...") 
  10207. ImportPicture("Bitmap", "C:\AMIPRO\ICONS\123W.BMP", ".BMP", 0) 
  10208. StatusBarMsg("") 
  10209. HourGlass(0) 
  10210. IgnoreKeyboard(0) 
  10211. END FUNCTION 
  10212.  
  10213. See also: 
  10214.  
  10215.     AnswerMsgBox 
  10216.     Messages 
  10217.     Pause 
  10218.     SingleStep 
  10219.     StatusBarMsg 
  10220.  
  10221.  
  10222.  
  10223. ΓòÉΓòÉΓòÉ 226. HowDoIHelp ΓòÉΓòÉΓòÉ
  10224.  
  10225. This function displays the online Help for Ami Pro. This function is equivalent 
  10226. to choosing Help How Do I?, but it does not select a Help topic automatically. 
  10227. Because Help displays in a window other than the regular Ami Pro window, 
  10228. further macro functions which cause a repainting of the Ami Pro window cause 
  10229. the Help window to be replaced by the Ami Pro window. 
  10230.  
  10231.  
  10232. If this function is used, it should be the last function used in the macro. 
  10233.  
  10234. Syntax 
  10235. HowDoIHelp() 
  10236.  
  10237. Return Value 
  10238. 1  (TRUE) if the Help window was displayed. 
  10239. -2  (GeneralFailure) if the Help window could not be displayed for some other 
  10240. reason. 
  10241. -6  (NoMemory) if the function failed because of insufficient memory. 
  10242.  
  10243. Example 
  10244. FUNCTION Example() 
  10245. HowDoIHelp() 
  10246. END FUNCTION 
  10247.  
  10248. See also: 
  10249.  
  10250.     About 
  10251.     Help 
  10252.     MacroHelp 
  10253.     UsingHelp 
  10254.  
  10255.  
  10256. ΓòÉΓòÉΓòÉ 227. ICONBOTTOM ΓòÉΓòÉΓòÉ
  10257.  
  10258. This function moves the set of SmartIcons to the bottom of the screen. This 
  10259. function is equivalent to choosing Tools SmartIcons and selecting Bottom for 
  10260. the position. 
  10261.  
  10262.  
  10263. A macro must be edited to insert this non-recordable function. 
  10264.  
  10265. Syntax 
  10266. IconBottom() 
  10267.  
  10268. Return Value 
  10269. This function returns 1. 
  10270.  
  10271. Example 
  10272. FUNCTION Example() 
  10273. IconBottom() 
  10274. END FUNCTION 
  10275.  
  10276. See also: 
  10277.  
  10278.     HideIconBar 
  10279.     IconCustomize 
  10280.     IconFloating 
  10281.     IconLeft 
  10282.     IconRight 
  10283.     IconTop 
  10284.     SetIconSize 
  10285.     ShowIconBar 
  10286.     ToggleIconBar 
  10287.  
  10288.  
  10289. ΓòÉΓòÉΓòÉ 228. IconCustomize ΓòÉΓòÉΓòÉ
  10290.  
  10291. This function displays the SmartIcons dialog box that allows the user to 
  10292. customize the Smarticons set. This function is equivalent to choosing Tools 
  10293. SmartIcons. 
  10294.  
  10295.  
  10296. A macro must be edited to insert this non-recordable function. 
  10297.  
  10298. Syntax 
  10299. IconCustomize() 
  10300.  
  10301. Return Value 
  10302. 1  (TRUE) if the SmartIcons were customized. 
  10303. 0  (UserCancel) if the user canceled the function. 
  10304.  
  10305. Example 
  10306. FUNCTION Example() 
  10307. IconCustomize() 
  10308. END FUNCTION 
  10309.  
  10310. See also: 
  10311.  
  10312.     ChangeIcons 
  10313.     HideIconBar 
  10314.     IconBottom 
  10315.     IconFloating 
  10316.     IconLeft 
  10317.     IconRight 
  10318.     IconTop 
  10319.     SetIconPath 
  10320.     SetIconSize 
  10321.     ShowIconBar 
  10322.     ToggleIconBar 
  10323.  
  10324.  
  10325.  
  10326. ΓòÉΓòÉΓòÉ 229. IconFloating ΓòÉΓòÉΓòÉ
  10327.  
  10328. This function moves the set of SmartIcons to a floating position on the screen. 
  10329. This function is equivalent to choosing Tools SmartIcons and selecting Floating 
  10330. for the position. 
  10331.  
  10332.  
  10333. A macro must be edited to insert this non-recordable function. 
  10334.  
  10335. Syntax 
  10336. IconFloating() 
  10337.  
  10338. Return Value 
  10339. This function returns 1. 
  10340.  
  10341. Example 
  10342. FUNCTION Example() 
  10343. IconFloating() 
  10344. END FUNCTION 
  10345.  
  10346. See also: 
  10347.  
  10348.     HideIconBar 
  10349.     IconBottom 
  10350.     IconCustomize 
  10351.     IconLeft 
  10352.     IconRight 
  10353.     IconTop 
  10354.     SetIconSize 
  10355.     ShowIconBar 
  10356.     ToggleIconBar 
  10357.  
  10358.  
  10359.  
  10360. ΓòÉΓòÉΓòÉ 230. IconLeft ΓòÉΓòÉΓòÉ
  10361.  
  10362. This function moves the set of SmartIcons to the left side of the screen. This 
  10363. function is equivalent to choosing Tools SmartIcons and selecting Left for the 
  10364. position. 
  10365.  
  10366.  
  10367. A macro must be edited to insert this non-recordable function. 
  10368.  
  10369. Syntax 
  10370. IconLeft() 
  10371.  
  10372. Return Value 
  10373. This function returns 1. 
  10374.  
  10375. Example 
  10376. FUNCTION Example() 
  10377. IconLeft() 
  10378. END FUNCTION 
  10379.  
  10380. See also: 
  10381.  
  10382.     HideIconBar 
  10383.     IconBottom 
  10384.     IconCustomize 
  10385.     IconFloating 
  10386.     IconRight 
  10387.     IconTop 
  10388.     SetIconSize 
  10389.     ShowIconBar 
  10390.     ToggleIconBar 
  10391.  
  10392.  
  10393.  
  10394. ΓòÉΓòÉΓòÉ 231. IconRight ΓòÉΓòÉΓòÉ
  10395.  
  10396. This function moves the set of SmartIcons to the right side of the screen. This 
  10397. function is equivalent to choosing Tools SmartIcons and selecting Right for the 
  10398. position. 
  10399.  
  10400.  
  10401. A macro must be edited to insert this non-recordable function. 
  10402.  
  10403. Syntax 
  10404. IconRight() 
  10405.  
  10406. Return Value 
  10407. This function returns 1. 
  10408.  
  10409. Example 
  10410. FUNCTION Example() 
  10411. IconRight() 
  10412. END FUNCTION 
  10413.  
  10414. See also: 
  10415.  
  10416.     HideIconBar 
  10417.     IconBottom 
  10418.     IconCustomize 
  10419.     IconFloating 
  10420.     IconLeft 
  10421.     IconTop 
  10422.     SetIconSize 
  10423.     ShowIconBar 
  10424.     ToggleIconBar 
  10425.  
  10426.  
  10427. ΓòÉΓòÉΓòÉ 232. IconTop ΓòÉΓòÉΓòÉ
  10428.  
  10429. This function moves the set of SmartIcons to the top of the screen. This 
  10430. function is equivalent to choosing Tools SmartIcons and selecting Top for the 
  10431. position. 
  10432.  
  10433.  
  10434. A macro must be edited to insert this non-recordable function. 
  10435.  
  10436. Syntax 
  10437. IconTop() 
  10438.  
  10439. Return Value 
  10440. This function returns 1. 
  10441.  
  10442. Example 
  10443. FUNCTION Example() 
  10444. IconTop() 
  10445. END FUNCTION 
  10446.  
  10447. See also: 
  10448.  
  10449.     HideIconBar 
  10450.     IconBottom 
  10451.     IconCustomize 
  10452.     IconFloating 
  10453.     IconLeft 
  10454.     IconRight 
  10455.     SetIconSize 
  10456.     ShowIconBar 
  10457.     ToggleIconBar 
  10458.  
  10459.  
  10460. ΓòÉΓòÉΓòÉ 233. ImageProcessing ΓòÉΓòÉΓòÉ
  10461.  
  10462. This function adds the Image menu to the main menu bar. This function is 
  10463. equivalent to choosing Tools Image Processing. 
  10464.  
  10465.  
  10466. A frame containing a gray scale TIFF image must be selected before calling this 
  10467. function. 
  10468.  
  10469. Syntax 
  10470. ImageProcessing() 
  10471.  
  10472. Return Value 
  10473. 1  (TRUE) if the Image menu was added to the main menu bar. 
  10474. -2  (GeneralFailure) if the Image menu could not be added. 
  10475.  
  10476. Example 
  10477. FUNCTION Example() 
  10478. LayoutMode() 
  10479. WHILE not IsFrameSelected() 
  10480.     UserControl("Select a frame with a gray scale tiff and choose Resume...") 
  10481. WEND 
  10482. ImageProcessing() 
  10483. END FUNCTION 
  10484.  
  10485. See also: 
  10486.  
  10487.     AddFrame 
  10488.     AddFrameDLG 
  10489.     FrameLayout 
  10490.     ManualFrame 
  10491.  
  10492.  
  10493. ΓòÉΓòÉΓòÉ 234. ImportExport ΓòÉΓòÉΓòÉ
  10494.  
  10495. This function allows you to import a non-Ami Pro file or export a file to 
  10496. another file format. If you are importing a file, the macro should make sure 
  10497. the insertion point is at the location in the file where the new file should be 
  10498. imported. If exporting a file, the file to be exported should be on the screen. 
  10499.  
  10500.  
  10501. Syntax 
  10502. ImportExport(Which, FileName, FilterName, CopyImage) 
  10503. Which indicates if the file should be imported or exported. The Which parameter 
  10504. should be set according to the list below: 
  10505.     Export (1) - Exports the file onscreen to a new file 
  10506.     Import (0) - Imports the specified file to the current document 
  10507. FileName is the full path of the file being imported or the destination path of 
  10508. the file to export to. 
  10509. FilterName is the name of the filter as listed in the Open dialog box or in 
  10510. amipro3.ini. 
  10511. CopyImage is a flag indicating whether to copy the graphic file or use the 
  10512. information in the original graphics file. The CopyImage parameter should be 
  10513. set to 1 (True) if the graphic file should be copied into the document. It 
  10514. should be set to 0 (False) if the original graphic file should be referred to 
  10515. when the graphic is displayed. 
  10516. ASCII 
  10517. IMPORT and EXPORT syntax: 
  10518. ImportExport(Which, FileName, FilterName, CopyImage, CRLF, Type, KeepStyle) 
  10519. CRLF - Carriage return/linefeed options 
  10520.     LINE - Use carriage return/linefeed characters at end of line 
  10521.     PARA - Use carriage return/linefeed characters at end of paragraph 
  10522. Type - is the type of ASCII file to import or export 
  10523.     PCASCII (8) - 8 bit PC ASCII file 
  10524.     ANSI (16) - 8 bit ANSI file 
  10525. KeepStyle allows you to keep the style names 
  10526.     KeepStyle - Keep style names 
  10527.  
  10528. DisplayWrite 4 
  10529. EXPORT Syntax: 
  10530. ImportExport(Which, FileName, FilterName, CopyImage, StyleBox) 
  10531. StyleBox - Choices for the Styles box 
  10532.     Apply - Apply styles 
  10533.     Ignore (5) - Ignore styles 
  10534.  
  10535. DCA/RFT 
  10536. EXPORT Syntax: 
  10537. ImportExport(Which, FileName, FilterName, CopyImage, StyleBox) 
  10538. StyleBox - Choices for the Styles box 
  10539.     Apply - Apply styles 
  10540.     Ignore (5)  - Ignore styles 
  10541.  
  10542. Lotus 1-2-3 Version 3.0 and higher 
  10543. IMPORT Syntax: 
  10544. ImportExport(Which, FileName, FilterName, CopyImage, RangeBox[, Range], 
  10545. StyleBox) 
  10546. RangeBox - Choices for the Range box 
  10547.     Entire - Entire file 
  10548.     Active - Active worksheet 
  10549.     Range - Range. This parameter must be followed by another giving the exact 
  10550.     range. 
  10551. Range - Range if the RangeBox parameter has a range 
  10552. StyleBox - Choices for the Styles box 
  10553.     Convert - Convert styles 
  10554.     Apply - Apply styles 
  10555.     Keep - Keep style names 
  10556.     Ignore (5) - Ignore styles 
  10557.  
  10558. Rich Text Format, Word for Windows 1.x and 2.0 
  10559. IMPORT Syntax: 
  10560. ImportExport(Which, FileName, FilterName, CopyImage, StyleBox) 
  10561. StyleBox - Choices for the Styles box 
  10562.     Convert - Convert styles 
  10563.     Apply - Apply styles 
  10564.     Keep - Keep style names 
  10565.     Ignore (5) - Ignore styles 
  10566.  
  10567. WordPerfect 5.0 and 5.1 
  10568. IMPORT Syntax: 
  10569. ImportExport(Which, FileName, FilterName, CopyImage, StyleBox) 
  10570. StyleBox - Choices for the Styles box 
  10571.     Apply - Apply styles 
  10572.     Ignore (5) - Ignore styles 
  10573.     Style - Import style sheet 
  10574. EXPORT Syntax: 
  10575. ImportExport(Which, FileName, FilterName, CopyImage, StyleBox, Version) 
  10576. StyleBox - Choices for the Styles box 
  10577.     Convert - Convert styles 
  10578.     Apply - Apply styles 
  10579.     Ignore (5) - Ignore styles 
  10580. Version is the version of WordPerfect 
  10581.     TRUE (1) - Wordperfect 5.0 format 
  10582.     FALSE (0) - Wordperfect 5.1 format 
  10583. For all exports: If the export file already exists, a message box prompts you 
  10584. whether or not to overwrite the existing file. 
  10585. This function does not display a dialog box. 
  10586.  
  10587. Return Value 
  10588. 1  (TRUE) if the file was successfully imported/exported. 
  10589. 0  (UserCancel) if the user canceled the function. 
  10590. -2  (GeneralFailure) if the file could not be imported because the file was not 
  10591. the appropriate type or if the file could not be found. 
  10592.  
  10593. Example 
  10594. FUNCTION Example() 
  10595. ImportExport(Import, "C:\AUTOEXEC.BAT", "ASCII", 0, "PARA", PCASCII, 0) 
  10596. END FUNCTION 
  10597.  
  10598. See also: 
  10599.  
  10600.     ASCIIOptions 
  10601.     FileOpen 
  10602.     ImportPicture 
  10603.     SaveAs 
  10604.  
  10605.  
  10606. ΓòÉΓòÉΓòÉ 235. ImportPicture ΓòÉΓòÉΓòÉ
  10607.  
  10608. This function imports a graphic into the current document. If an empty frame is 
  10609. selected, the graphic is placed in it. If no frame is selected, this function 
  10610. creates a 1" by 1" frame and imports the graphic into it. This function is 
  10611. equivalent to choosing File Import Picture. 
  10612.  
  10613.  
  10614. Syntax 
  10615. ImportPicture(App, FileName, FileExt, CopyImage) 
  10616. App is the name of the application filter name. This name may be extracted from 
  10617. the list of file types in the Import Picture dialog box. The name may also be 
  10618. found in the amipro3.ini file. 
  10619. FileName is the name of the file and extension to be imported and the full 
  10620. path, if necessary. 
  10621. FileExt is the extension of the file to be imported. There must be a period (.) 
  10622. before the extension name. 
  10623. CopyImage can be one of the following values: 
  10624.     (1) - Graphics file copied into the document. 
  10625.     (0) - Original graphics file referred to when the graphic is displayed. 
  10626.  
  10627. Return Value 
  10628. 1  (TRUE) if the picture was imported. 
  10629. 0  (UserCancel) if the user canceled the function. 
  10630. -2  (GeneralFailure) if the picture was not imported. 
  10631. -6  (NoMemory) if the function failed because of insufficient memory. 
  10632.  
  10633. Example 
  10634. FUNCTION Example() 
  10635. IgnoreKeyboard(1) 
  10636. HourGlass(1) 
  10637. StatusBarMsg("Importing graphic file...") 
  10638. ImportPicture("Bitmap", "C:\AMIPRO\ICONS\123W.BMP", ".BMP", 0) 
  10639. StatusBarMsg("") 
  10640. HourGlass(0) 
  10641. IgnoreKeyboard(0) 
  10642. END FUNCTION 
  10643.  
  10644. See also: 
  10645.  
  10646.     AddFrame 
  10647.     AddFrameDLG 
  10648.     FileOpen 
  10649.     GetProfileString$ 
  10650.     HourGlass 
  10651.     ImageProcessing 
  10652.     ImportExport 
  10653.  
  10654.  
  10655.  
  10656.  
  10657. ΓòÉΓòÉΓòÉ 236. Indent ΓòÉΓòÉΓòÉ
  10658.  
  10659. This function sets the amount of indention for the current paragraph. This 
  10660. function is equivalent to choosing  text Indention. 
  10661.  
  10662.  
  10663. Syntax 
  10664. Indent(AllIndent, FirstIndent, RestIndent, RightIndent) 
  10665. AllIndent is the amount to indent all the lines. 
  10666. FirstIndent is the amount to indent the first line. 
  10667. RestIndent is the amount to indent the rest of the lines after the first line. 
  10668. RightIndent is the amount to indent from the right side. 
  10669. All amounts are in twips (1 inch = 1440 twips). Multiply the desired number of 
  10670. inches by 1440 to determine the value in twips. 
  10671.  
  10672. To display the Indention dialog box: Indent 
  10673.  
  10674. Return Value 
  10675. 1  (TRUE) if the indention was set. 
  10676. 0  (UserCancel) if the user canceled the function. 
  10677. -6  (InsufficientMemory) if the function failed because of insufficient memory. 
  10678.  
  10679. Example 
  10680. FUNCTION Example() 
  10681. ' indent all lines 1 inch and the first line another half inch 
  10682. Indent(1440, 720, 0, 0) 
  10683. END FUNCTION 
  10684.  
  10685. See also: 
  10686.  
  10687.     Center 
  10688.     FastFormat 
  10689.     IndentAll 
  10690.     IndentFirst 
  10691.     IndentRest 
  10692.     Justify 
  10693.     LeftAlign 
  10694.     NormalText 
  10695.     RightAlign 
  10696.     Spacing 
  10697.  
  10698.  
  10699. ΓòÉΓòÉΓòÉ 237. IndentAll ΓòÉΓòÉΓòÉ
  10700.  
  10701. This function allows you to increase the amount of indention for the selected 
  10702. text. This function is equivalent to clicking the Indent All icon. The amount 
  10703. of indention to be increased is determined by the value set in Text Indention 
  10704. Indent All. If the units in User Setup is set to centimeters, the amount to 
  10705. increase is 1 centimeter. For the other units (inches, picas, or points), the 
  10706. amount to increase is one half of an inch. 
  10707.  
  10708.  
  10709. Syntax 
  10710. IndentAll() 
  10711.  
  10712. Return Value 
  10713. 1  (TRUE) if the indention was increased. 
  10714. -6  (InsufficientMemory) if the function failed because of insufficient memory. 
  10715.  
  10716. Example 
  10717. FUNCTION Example() 
  10718. ' indent the selected text to the specified indention 
  10719. IndentAll() 
  10720. END FUNCTION 
  10721.  
  10722. See also: 
  10723.  
  10724.     IndentFirst 
  10725.     Indent 
  10726.     IndentRest 
  10727.  
  10728.  
  10729. ΓòÉΓòÉΓòÉ 238. IndentFirst ΓòÉΓòÉΓòÉ
  10730.  
  10731. This function allows you to increase the amount of indention for the selected 
  10732. text. This function is equivalent to clicking the Indent First icon. The amount 
  10733. of indention to be increased is determined by the value set in Text Indention 
  10734. Indent First. If the units in User Setup is set to centimeters, the amount to 
  10735. increase is 1 centimeter. For the other units (inches, picas, or points), the 
  10736. amount to increase is one half of an inch. 
  10737.  
  10738.  
  10739. Syntax 
  10740. IndentFirst() 
  10741.  
  10742. Return Value 
  10743. 1  (TRUE) if the indention was increased. 
  10744. -6  (InsufficientMemory) if the function failed because of insufficient memory. 
  10745.  
  10746. Example 
  10747. FUNCTION Example() 
  10748. ' indent the first line to the specified indention 
  10749. IndentFirst() 
  10750. END FUNCTION 
  10751.  
  10752. See also: 
  10753.  
  10754.     IndentAll 
  10755.     Indent 
  10756.     IndentRest 
  10757.  
  10758.  
  10759. ΓòÉΓòÉΓòÉ 239. IndentRest ΓòÉΓòÉΓòÉ
  10760.  
  10761. This function allows you to increase the amount of indention for the selected 
  10762. text. This function is equivalent to clicking the Indent Rest icon. The amount 
  10763. of indention to be increased is determined by the value set in Text Indention 
  10764. Indent Rest. If the units in User Setup is set to centimeters, the amount to 
  10765. increase is 1 centimeter. For the other units (inches, picas, or points), the 
  10766. amount to increase is one half of an inch. 
  10767.  
  10768.  
  10769. Syntax 
  10770. IndentRest() 
  10771.  
  10772. Return Value 
  10773. 1  (TRUE) if the indention was increased. 
  10774. -6  (InsufficientMemory) if the function failed because of insufficient memory. 
  10775.  
  10776. Example 
  10777. FUNCTION Example() 
  10778. ' indent the rest of the lines to the specified indention 
  10779. IndentRest() 
  10780. END FUNCTION 
  10781.  
  10782. See also: 
  10783.  
  10784.     IndentAll 
  10785.     IndentFirst 
  10786.     Indent 
  10787.  
  10788.  
  10789. ΓòÉΓòÉΓòÉ 240. InsertBullet ΓòÉΓòÉΓòÉ
  10790.  
  10791. This function inserts a bullet into the text at the cursor position. This 
  10792. function is equivalent to choosing Edit Insert Bullet. 
  10793.  
  10794.  
  10795. Syntax 
  10796. InsertBullet(Type) 
  10797. Type is the type of bullet to insert and can be one of the following: 
  10798.     (1) - Small round bullet 
  10799.     (2) - Large round bullet 
  10800.     (3) - Small square bullet 
  10801.     (4) - Large square bullet 
  10802.     (5) - Large outline square bullet 
  10803.     (6) - Small diamond bullet 
  10804.     (7) - Large diamond bullet 
  10805.     (8) - Small open circle bullet 
  10806.     (9) - Large open circle bullet 
  10807.     (10) - Check mark 
  10808.     (11) - Tack 
  10809.     (12) - Square shadow below bullet 
  10810.     (13) - Square shadow above bullet 
  10811.     (14) - Check box 
  10812.     (15) - Square with X bullet 
  10813.     (16) - Rounded arrowhead top shaded 
  10814.     (17) - Rounded arrowhead bottom shaded 
  10815.  
  10816. To display the Insert Bullet dialog box to allow the user to select a bullet: 
  10817. InsertBullet 
  10818.  
  10819. Return Value 
  10820. 1 (TRUE) if the bullet is inserted. 
  10821. -2 (GeneralFailure) is the insertion failed. 
  10822.  
  10823. Example 
  10824. FUNCTION Example() 
  10825. ' type every kind of bullet 
  10826. FOR type = 1 to 17 
  10827.     InsertBullet(type) 
  10828.     type("[Enter]") 
  10829. NEXT 
  10830. END FUNCTION 
  10831.  
  10832. See also: 
  10833.  
  10834.     InsertDate 
  10835.     InsertDocInfo 
  10836.     ModifyEffects 
  10837.     ModifyStyle 
  10838.  
  10839.  
  10840. ΓòÉΓòÉΓòÉ 241. InsertCascadeMenu ΓòÉΓòÉΓòÉ
  10841.  
  10842. This function inserts a cascade menu in an existing pull down menu. 
  10843.  
  10844.  
  10845. Syntax 
  10846. InsertCascadeMenu(BarID, Menu, Position, NewMenu) 
  10847. BarID is the identification number of the menu bar and must always be 1. 
  10848. Menu is the name of the pull down menu to insert this cascade menu on. This 
  10849. string must contain any ampersand (&) characters used in the menu name. An 
  10850. ampersand is placed before a character that has an underline. 
  10851. Position is the position in the pull down menu to insert the cascade menu. This 
  10852. parameter begins with 0 (to insert as the first position in the pull down 
  10853. menu). 
  10854. NewMenu is the name of the cascade menu to insert. Placing an ampersand (&) 
  10855. character in front of a character in the string makes that string appear 
  10856. underlined and causes that character to become a shortcut character. 
  10857.  
  10858. Return Value 
  10859. 1  (TRUE) if the cascade menu was inserted. 
  10860. 0  (UserCancel) if the user canceled the function. 
  10861. -2  (GeneralFailure) if the cascade menu could not be inserted or if the pull 
  10862. down menu name does not match or exist. 
  10863.  
  10864. Example 
  10865. FUNCTION Example() 
  10866. ' get the name of this macro file 
  10867. MacFile = GetRunningMacroFile$() 
  10868. InsertCascadeMenu(1, "&File", 7, "&Example") 
  10869. AddCascadeMenuItem(1, "&File", "&Example", "Example1", "{MacFile}!Example2(1)", 
  10870. "") 
  10871. AddCascadeMenuItem(1, "&File", "&Example", "Example2", "{MacFile}!Example2(2)", 
  10872. "") 
  10873. InsertCascadeMenuItem(1, "&File", "&Example", 1, "Example1.5", " 
  10874. {MacFile}!Example2(3)", "") 
  10875. END FUNCTION 
  10876.  
  10877. FUNCTION Example2(Msg) 
  10878. Message(Msg) 
  10879. END FUNCTION 
  10880.  
  10881. See also: 
  10882.  
  10883.     AddCascadeMenu 
  10884.     AddCascadeMenuItem 
  10885.     AddMenu 
  10886.     AddMenuItem 
  10887.     ChangeCascadeAction 
  10888.     DeleteMenu 
  10889.     DeleteMenuItem 
  10890.     InsertCascadeMenuItem 
  10891.     InsertMenuItem 
  10892.     InsertMenu 
  10893.  
  10894.  
  10895. ΓòÉΓòÉΓòÉ 242. InsertCascadeMenuItem ΓòÉΓòÉΓòÉ
  10896.  
  10897. This function inserts a cascade menu item on an existing cascade menu. 
  10898.  
  10899.  
  10900. Syntax 
  10901. InsertCascadeMenuItem(BarID, Menu, Position, Item, MacroName[!Function[(parm1[, 
  10902. parm2...])]], Help) 
  10903. BarID is the identification number of the menu bar and must always be 1. 
  10904. Menu is the name of the cascade menu this item should be inserted in. This must 
  10905. match exactly the name of the menu item you want to use, including any 
  10906. ampersand (&) characters in the name of the menu. An ampersand is placed before 
  10907. a character that has an underline. 
  10908. Position is where to locate the item in the cascade menu. 
  10909. This parameter begins with 0 (to insert as the first position in the cascade 
  10910. menu). 
  10911. Item is the text to insert. This is the text that the user sees on the cascade 
  10912. menu bar. Placing an ampersand (&) in front of a character causes that 
  10913. character to appear underlined and makes that character a shortcut key. If the 
  10914. menu item has a shortcut key, you must press TAB, type a ^, and then type the 
  10915. appropriate letter as part of the item name. 
  10916. MacroName is the name of the macro to run if this menu item is selected. This 
  10917. parameter may contain the macro filename, the function within that file to 
  10918. call, and any parameters that the function may require. At a minimum, this 
  10919. parameter must contain the macro filename. 
  10920. Help is the one-line Help text that appears in the title bar of Ami Pro when 
  10921. this menu item is highlighted. This parameter is not optional for this 
  10922. function. 
  10923.  
  10924. Return Value 
  10925. 1  (TRUE) if the cascade menu item was inserted. 
  10926. 0  (UserCancel) if the user canceled the function. 
  10927. -2  (GeneralFailure) if the cascade menu item could not be inserted, or if the 
  10928. pull down menu or the cascade menu names did not match the parameters or if 
  10929. either did not exist. 
  10930.  
  10931. Example 
  10932. FUNCTION Example() 
  10933. ' get the name of this macro file 
  10934. MacFile = GetRunningMacroFile$() 
  10935. InsertCascadeMenu(1, "&File", 7, "&Example") 
  10936. AddCascadeMenuItem(1, "&File", "&Example", "Example1", "{MacFile}!Example2(1)", 
  10937. "") 
  10938. AddCascadeMenuItem(1, "&File", "&Example", "Example2", "{MacFile}!Example2(2)", 
  10939. "") 
  10940. InsertCascadeMenuItem(1, "&File", "&Example", 1, "Example1.5", " 
  10941. {MacFile}!Example2(3)", "") 
  10942. END FUNCTION 
  10943.  
  10944. FUNCTION Example2(Msg) 
  10945. Message(Msg) 
  10946. END FUNCTION 
  10947.  
  10948. See also: 
  10949.  
  10950.     AddCascadeMenu 
  10951.     AddCascadeMenuItem 
  10952.     AddMenu 
  10953.     AddMenuItem 
  10954.     ChangeCascadeAction 
  10955.     DeleteMenu 
  10956.     DeleteMenuItem 
  10957.     InsertCascadeMenu 
  10958.     InsertMenuItem 
  10959.     InsertMenu 
  10960.  
  10961.  
  10962. ΓòÉΓòÉΓòÉ 243. InsertColumnRow ΓòÉΓòÉΓòÉ
  10963.  
  10964. This function inserts table columns or rows. This function is equivalent to 
  10965. choosing Table Insert Column Row. 
  10966.  
  10967.  
  10968. Syntax 
  10969. InsertColumnRow(Number, Where, Which) 
  10970. Number is the number of columns or rows to insert. 
  10971. Where is a number representing where to insert the columns or rows and can be 
  10972. one of the following: 
  10973.     InsAfter (0) - Inserts after the current column/row 
  10974.     InsBefore (1) - Inserts before the current column/row 
  10975. Which is a number determining whether to insert columns or rows and can be one 
  10976. of the following: 
  10977.     Column (1) - Inserts a column 
  10978.     Row (0) - Inserts a row 
  10979.  
  10980. To display the Insert Column Row dialog box to allow the user to decide the 
  10981. number and type of columns/rows to insert: InsertColumnRow 
  10982.  
  10983. Return Value 
  10984. 1  (TRUE) if the column or row was inserted. 
  10985. 0  (UserCancel) if the user canceled the function. 
  10986. -2  (GeneralFailure) if the row or column was not inserted. 
  10987.  
  10988. Example 
  10989. FUNCTION Example() 
  10990. ' Insert 1 column after the current column 
  10991. InsertColumnRow(1, 0, 1) 
  10992. END FUNCTION 
  10993.  
  10994. See also: 
  10995.  
  10996.     DeleteColumnRow 
  10997.     DeleteEntireTable 
  10998.     SelectColumn 
  10999.     SelectEntireTable 
  11000.     SelectRow 
  11001.     SizeColumnRow 
  11002.  
  11003.  
  11004. ΓòÉΓòÉΓòÉ 244. InsertDate ΓòÉΓòÉΓòÉ
  11005.  
  11006. This function inserts a date into the document. This function is equivalent to 
  11007. choosing Edit Insert Date/Time. 
  11008.  
  11009.  
  11010. Syntax 
  11011. InsertDate(Type, Style) 
  11012. Type is the type of date to insert and can be one of the following: 
  11013.     Today (2) - Inserts the current system date and always displays this date 
  11014.     SysDate (3) - Inserts the current system date and updates this date each 
  11015.     time you open the document 
  11016.     LastRev (5) - Inserts the date the document was last revised 
  11017.     CreateDate (7) - Inserts the date the document was created 
  11018. Style is the style of date to insert and can be one of the following: 
  11019.     (0) NMDY - 9/11/91 
  11020.     (1) MDY - September 11, 1991 
  11021.     (2) UMDY - SEPTEMBER 11, 1991 
  11022.     (3) DMY - 11 September 1991 
  11023.     (4) UDMY - 11 SEPTEMBER 1991 
  11024.     (5) DMDY - Friday, September 11, 1991 
  11025.     (6) UDMDY - FRIDAY, SEPTEMBER 11, 1991 
  11026.     (7) MD - September 11 
  11027.     (8) UMD - SEPTEMBER 11 
  11028.     (9) DMD - Friday September 11 
  11029.     (10) UDMD - FRIDAY SEPTEMBER 11 
  11030.     (11) NMD - 9/11 
  11031.     (12) NMDLY - 9/11/91 
  11032.     (13) DPM - 11. September 
  11033.     (14) UDPM - 11. SEPTEMBER 
  11034.     (15) DPMY - 11. September 1991 
  11035.     (16) UDPMY - 11. SEPTEMBER 1991 
  11036.     (17) YMD - 1991 September 11 
  11037.     (18) UYMD - 1991 SEPTEMBER 11 
  11038.     (19) MY - September, 1991 
  11039.     (20) UMY - SEPTEMBER, 1991 
  11040.  
  11041. To display the Insert Date Time dialog box and allow the user to select the 
  11042. date type and style: InsertVariable 
  11043.  
  11044. Return Value 
  11045. 1  (TRUE) if the date was inserted. 
  11046. -2  (GeneralFailure) if no date was inserted. 
  11047. -6  (NoMemory) if the function failed because of insufficient memory. 
  11048.  
  11049. Example 
  11050. FUNCTION Example() 
  11051. InsertDate(2, DMDY) 
  11052. END FUNCTION 
  11053.  
  11054. See also: 
  11055.  
  11056.     FormatDate$ 
  11057.     FormatTime$ 
  11058.     GetTime 
  11059.     InsertBullet 
  11060.     InsertDocInfo 
  11061.     InsertVariable 
  11062.     Now 
  11063.  
  11064.  
  11065.  
  11066. ΓòÉΓòÉΓòÉ 245. InsertDocInfo ΓòÉΓòÉΓòÉ
  11067.  
  11068. This function displays the Insert Doc Info dialog box. This function is 
  11069. equivalent to choosing Edit Insert Doc Info Field. 
  11070.  
  11071. To insert the Doc Info  field without the dialog box, use the 
  11072. InsertDocInfoField function. 
  11073.  
  11074. Syntax 
  11075. InsertDocInfo 
  11076.  
  11077. Return Value 
  11078. This function does not return a value. 
  11079.  
  11080. Example 
  11081. FUNCTION Example() 
  11082. InsertDocInfo 
  11083. END FUNCTION 
  11084.  
  11085. See also: 
  11086.  
  11087.     DocInfo 
  11088.     GetDocInfo$ 
  11089.     InsertDocInfoField 
  11090.     RenameDocInfoField 
  11091.  
  11092.  
  11093.  
  11094.  
  11095. ΓòÉΓòÉΓòÉ 246. InsertLayout ΓòÉΓòÉΓòÉ
  11096.  
  11097. This function inserts a page break at the current insertion point and displays 
  11098. the Modify Page Layout dialog box. This function is equivalent to choosing Page 
  11099. Insert Page Layout Insert. 
  11100.  
  11101.  
  11102. You must be in Layout Mode to use this function. 
  11103.  
  11104. Syntax 
  11105. InsertLayout() 
  11106.  
  11107. Return Value 
  11108. This function returns 1. 
  11109.  
  11110. Example 
  11111. FUNCTION Example() 
  11112. InsertLayout() 
  11113. END FUNCTION 
  11114.  
  11115. See also: 
  11116.  
  11117.     CreateStyle 
  11118.     HeaderFooter 
  11119.     ModifyLayout 
  11120.     ModifyStyle 
  11121.     RemoveLayout 
  11122.  
  11123.  
  11124. ΓòÉΓòÉΓòÉ 247. InsertMenu ΓòÉΓòÉΓòÉ
  11125.  
  11126. This function inserts a new pull down menu on the specified menu bar. 
  11127.  
  11128.  
  11129. Syntax 
  11130. InsertMenu(BarID, Position, NewMenu) 
  11131. BarID is the identification number of the menu bar and must always be 1.. 
  11132. Position is where to locate the menu. 
  11133. This parameter begins with 0 (to insert as the first position on the menu bar). 
  11134. NewMenu is the name of the new menu name to insert. Placing an ampersand (&) in 
  11135. front of a character causes that character to appear underlined and makes that 
  11136. character a shortcut key. 
  11137.  
  11138. Return Value 
  11139. 1  (TRUE) if the menu was inserted. 
  11140. 0  (UserCancel) if the user canceled the function. 
  11141. -2  (GeneralFailure) if the menu could not be inserted. 
  11142.  
  11143. Example 
  11144. FUNCTION Example() 
  11145. InsertMenu(1, 1, "&NewMenu") 
  11146. END FUNCTION 
  11147.  
  11148. See also: 
  11149.  
  11150.     AddCascadeMenu 
  11151.     AddCascadeMenuItem 
  11152.     AddMenu 
  11153.     AddMenuItem 
  11154.     DeleteMenu 
  11155.     DeleteMenuItem 
  11156.     InsertCascadeMenuItem 
  11157.     InsertCascadeMenu 
  11158.     InsertMenuItem 
  11159.     RenameMenuItem 
  11160.  
  11161.  
  11162. ΓòÉΓòÉΓòÉ 248. InsertMenuItem ΓòÉΓòÉΓòÉ
  11163.  
  11164. This function inserts a new menu item on the specified pull down menu. 
  11165.  
  11166.  
  11167. Syntax 
  11168. InsertMenuItem(BarID, Menu, Position, Item, MacroName[!Function[(parm1[, 
  11169. parm2...])]][, Help]) 
  11170. BarID is the identification number of the menu bar and must always be 1. 
  11171. Menu is the name of the existing menu to insert this item in. The exact name of 
  11172. the menu must be used, including any ampersand (&) characters. An ampersand is 
  11173. placed before a character that has an underline. 
  11174. Position is where to locate the menu item in the pull down menu. 
  11175. This parameter begins with 0 (to insert as the first position in the pull down 
  11176. menu). 
  11177. Item is the text to appear for this menu item. Placing an ampersand (&) in 
  11178. front of a character causes that character to appear underlined and makes that 
  11179. character a shortcut key. If the menu item has a shortcut key, you must press 
  11180. TAB, type a ^, and then type the appropriate letter as part of the item name. 
  11181. MacroName is the name of the macro to run if this menu item is selected. This 
  11182. parameter may contain the macro filename, the function within that file to 
  11183. call, and any parameters that function may require. At a minimum, this 
  11184. parameter must contain the macro filename. 
  11185. Help is the one-line Help text that appears in the title bar of Ami Pro when 
  11186. this menu item is highlighted. 
  11187.  
  11188. Return Value 
  11189. 1  (TRUE) if the menu item was inserted. 
  11190. 0  (UserCancel) if the user canceled the function. 
  11191. -2  (GeneralFailure) if the menu item could not be inserted. 
  11192.  
  11193. Example 
  11194. FUNCTION Example() 
  11195. ' get the name of this macro file 
  11196. MacFile = GetRunningMacroFile$() 
  11197. State = 0 
  11198. DeleteMenuItem(1, "&Text", "B&old+Italic+Underline") 
  11199. InsertMenuItem(1, "&Text", 10, "B&old+Italic+Underline", "{MacFile}!Example2( 
  11200. {State})", "Bold and Italicize and Underline Text.") 
  11201. END FUNCTION 
  11202.  
  11203. FUNCTION Example2(State) 
  11204. MacFile = GetRunningMacroFile$() 
  11205. State = Right$((State - 1), 1) 
  11206. Bold(State) 
  11207. Underline(State) 
  11208. Italic(State) 
  11209. ChangeMenuAction(1, "&Text", "B&old+Italic+Underline", "{MacFile}!Example2( 
  11210. {State})", "Bold and Italicize and Underline Text.") 
  11211. CheckMenuItem(1, "&Text", "B&old+Italic+Underline", State) 
  11212. END FUNCTION 
  11213.  
  11214. See also: 
  11215.  
  11216.     AddCascadeMenu 
  11217.     AddCascadeMenuItem 
  11218.     AddMenu 
  11219.     AddMenuItem 
  11220.     DeleteMenu 
  11221.     DeleteMenuItem 
  11222.     InsertCascadeMenuItem 
  11223.     InsertCascadeMenu 
  11224.     InsertMenu 
  11225.     RenameMenuItem 
  11226.  
  11227.  
  11228. ΓòÉΓòÉΓòÉ 249. InsertMerge ΓòÉΓòÉΓòÉ
  11229.  
  11230. This function displays the Insert Merge Field dialog box. The user must select 
  11231. the merge field to insert. This function is equivalent to choosing Edit Insert 
  11232. Merge Field. 
  11233.  
  11234. To insert the field automatically, use the FieldAdd function. 
  11235.  
  11236. Syntax 
  11237. InsertMerge 
  11238.  
  11239. Return Value 
  11240. This function returns 0. 
  11241.  
  11242. Example 
  11243. FUNCTION Example() 
  11244. InsertMerge 
  11245. END FUNCTION 
  11246.  
  11247. See also: 
  11248.  
  11249.     FieldAdd 
  11250.     FieldRemove 
  11251.     MergeAction 
  11252.     Merge 
  11253.     MergeMacro 
  11254.     MergeToFile 
  11255.  
  11256.  
  11257.  
  11258.  
  11259. ΓòÉΓòÉΓòÉ 250. InsertMergeField ΓòÉΓòÉΓòÉ
  11260.  
  11261. This function inserts a merge field into a standard document. It is equivalent 
  11262. to choosing Edit Insert from the menu. This function inserts the field without 
  11263. checking to make sure it is a valid field name. 
  11264.  
  11265.  
  11266. Make sure field names that are inserted match with the data files that will be 
  11267. used to merge. 
  11268.  
  11269. Syntax 
  11270. InsertMergeField(Field) 
  11271. Field is the name of the merge field that must be inserted. 
  11272.  
  11273. To display the Insert Merge Field dialog box and let the user select the field 
  11274. name to insert: InsertMerge. 
  11275.  
  11276. Return Value 
  11277. 1  (TRUE) if the field name was inserted. 
  11278. -2  (GeneralFailure) if the field name was not inserted. 
  11279. -6  (NoMemory) if the function failed because of insufficient memory. 
  11280.  
  11281. Example 
  11282. FUNCTION Example() 
  11283. InsertMergeField(Query$("What is the name of the merge field to insert?")) 
  11284. END FUNCTION 
  11285.  
  11286. See also: 
  11287.  
  11288.     FieldAdd 
  11289.     InsertDate 
  11290.     InsertDocInfo 
  11291.     InsertMerge 
  11292.     InsertVariable 
  11293.  
  11294.  
  11295. ΓòÉΓòÉΓòÉ 251. InsertNote ΓòÉΓòÉΓòÉ
  11296.  
  11297. This function inserts a note with the specified text at the insertion point. 
  11298. The note is automatically inserted, and the note window is closed using this 
  11299. function. This function is equivalent to choosing Edit Insert Note, typing the 
  11300. note, and closing the note. 
  11301.  
  11302. A macro must be edited to insert this non-recordable function. 
  11303.  
  11304. Syntax 
  11305. InsertNote(Text) 
  11306. Text is the text that should go inside the note. 
  11307. To allow the user to determine note options or to type the note text: Notes 
  11308.  
  11309. Return Value 
  11310. This function returns: 
  11311.  1  (TRUE) if the note was inserted. 
  11312. -2  (GeneralFailure) if the note was not inserted. 
  11313.  
  11314. Example 
  11315. FUNCTION Example() 
  11316. InsertNote("Ami Pro is the easiest word processor to learn.") 
  11317. END FUNCTION 
  11318.  
  11319. See also: 
  11320.  
  11321.     Notes 
  11322.     UserSetup 
  11323.     ViewPreferences 
  11324.  
  11325.  
  11326. ΓòÉΓòÉΓòÉ 252. InsertVariable ΓòÉΓòÉΓòÉ
  11327.  
  11328. This function displays the Insert Date Time dialog box. This function is 
  11329. equivalent to choosing Edit Insert Date Time. This function does not insert 
  11330. variables automatically. Variables can be directly inserted using the 
  11331. InsertDate, InsertDocInfoField, and FieldAdd functions. 
  11332.  
  11333.  
  11334. Syntax 
  11335. InsertVariable 
  11336.  
  11337. Return Value 
  11338. This function returns 0. 
  11339.  
  11340. Example 
  11341. FUNCTION Example() 
  11342. InsertVariable 
  11343. END FUNCTION 
  11344.  
  11345. See also: 
  11346.  
  11347.     FieldAdd 
  11348.     InsertDate 
  11349.     InsertDocInfo 
  11350.  
  11351.  
  11352. ΓòÉΓòÉΓòÉ 253. Instr ΓòÉΓòÉΓòÉ
  11353.  
  11354. This function searches a text string for a pattern. The Instr function can tell 
  11355. you whether a specific string is contained in another string. 
  11356.  
  11357.  
  11358. Syntax 
  11359. Instr(Offset, Text, Pattern) 
  11360. Offset is the position in the string to begin searching. 
  11361. Text is the string to search. 
  11362. Pattern is the pattern to search for. 
  11363.  
  11364. Return Value 
  11365. The value of the offset of the beginning of the pattern, if it is found. 
  11366. 0  (FALSE) if the offset is not found. 
  11367.  
  11368. Example 
  11369. FUNCTION Example() 
  11370. Name = UCASE$(Query$("What is your name?")) 
  11371. FOR I = 65 to 90 
  11372.     Ltr = CHR$(I) 
  11373.     IF 0 != Instr(0, Name, Ltr) 
  11374.        TYPE("The letter {Ltr} is in your name.[Enter]") 
  11375.     ENDIF 
  11376. NEXT 
  11377. END FUNCTION 
  11378.  
  11379. See also: 
  11380.  
  11381.     CHR$ 
  11382.     Left$ 
  11383.     MID$ 
  11384.     Right$ 
  11385.     strcat$ 
  11386.     strchr 
  11387.     strfield$ 
  11388.  
  11389.  
  11390. ΓòÉΓòÉΓòÉ 254. IsFrameSelected ΓòÉΓòÉΓòÉ
  11391.  
  11392. This function determines whether or not a frame is currently selected. 
  11393.  
  11394.  
  11395. Syntax 
  11396. IsFrameSelected() 
  11397.  
  11398. Return Value 
  11399. 1  (TRUE) if the frame is currently selected. 
  11400. 0  (FALSE) if the frame is not currently selected. 
  11401.  
  11402. Example 
  11403. function Example() 
  11404. result=IsFrameSelected() 
  11405. message(result) 
  11406. end function 
  11407.  
  11408. See also: 
  11409.  
  11410.     AddFrame 
  11411.     AddFrameDLG 
  11412.     BringFrameToFront 
  11413.     FrameLayout 
  11414.     ManualFrame 
  11415.     SelectFrameByName 
  11416.  
  11417.  
  11418. ΓòÉΓòÉΓòÉ 255. IsNumeric ΓòÉΓòÉΓòÉ
  11419.  
  11420. This function determines whether a string is suitable for numeric operations. 
  11421.  
  11422.  
  11423. Syntax 
  11424. IsNumeric(Text) 
  11425. Text is the string which is to be evaluated. 
  11426.  
  11427. Return Value 
  11428. 1  (TRUE) if the passed string is numeric. 
  11429. 0  (FALSE) if the passed string is not numeric. 
  11430.  
  11431. Example 
  11432. FUNCTION Example() 
  11433. again: 
  11434. Num1 = Query$("What is the first number?") 
  11435. Num2 = Query$("What is the second number?") 
  11436. IF (not IsNumeric(Num1)) OR (not IsNumeric(Num2)) 
  11437.     GoTo again 
  11438. ENDIF 
  11439. sum = Num1 + Num2 
  11440. Message("The sum of {Num1} and {Num2} is {sum}.") 
  11441. END FUNCTION 
  11442.  
  11443. See also: 
  11444.  
  11445.     FormatNum$ 
  11446.     Mod 
  11447.     Round 
  11448.  
  11449.  
  11450. ΓòÉΓòÉΓòÉ 256. Italic ΓòÉΓòÉΓòÉ
  11451.  
  11452. This function sets the italic attribute for selected text or for all following 
  11453. text if no text is selected. It acts as a toggle, turning off the attribute if 
  11454. it is currently on or turning on the attribute if it is currently off. This 
  11455. function is equivalent to choosing Text Italic. 
  11456.  
  11457.  
  11458. Syntax 
  11459. Italic() 
  11460.  
  11461. Return Value 
  11462. 0  if the italic attribute is toggled on and there are no attributes assigned 
  11463. to the text. 
  11464. 4  if the italic attribute is toggled on and the bold attribute is already 
  11465. assigned. 
  11466. 8  if the italic attribute is toggled off. 
  11467. 16  if the italic attribute is toggled on and the underline attribute is 
  11468. already assigned. 
  11469. 32  if the italic attribute is toggled on and the word underline attribute is 
  11470. already assigned. 
  11471. -2  (GeneralFailure) if the attribute was not changed. 
  11472. The returns values may be added together to identify the attributes that were 
  11473. previously assigned. 
  11474.  
  11475. Example 
  11476. FUNCTION Example() 
  11477. text = Query$("Enter some text:") 
  11478. New("_default.sty", 0, 0)      'open a new file 
  11479. TYPE("{text}") 
  11480. TYPE("[enter]") 
  11481. TYPE("[ctrlhome][ctrlshiftend]") 
  11482. Copy() 'copy text to clipboard 
  11483. FOR I = 1 to 10 
  11484.     Paste()   'paste text 10 times 
  11485. NEXT 
  11486. Message("The text will be shaded, bolded, italicized, underlined, and 
  11487. centered.") 
  11488. TYPE("[ctrlhome][ctrlshiftend]") 
  11489. Bold() 
  11490. Italic() 
  11491. Underline() 
  11492. Center() 
  11493. TYPE("[ctrlhome]") 
  11494. END FUNCTION 
  11495.  
  11496. See also: 
  11497.  
  11498.     Bold 
  11499.     NormalText 
  11500.     Underline 
  11501.     WordUnderline 
  11502.  
  11503.  
  11504.  
  11505.  
  11506. ΓòÉΓòÉΓòÉ 257. Justify ΓòÉΓòÉΓòÉ
  11507.  
  11508. This function acts as a toggle to turn justification on or off for a paragraph. 
  11509. This function is equivalent to choosing Text Alignment Justify. 
  11510.  
  11511.  
  11512. Syntax 
  11513. Justify() 
  11514.  
  11515. Return Value 
  11516. 1  (TRUE) if the text was justified or if justification was removed. 
  11517. -2  (GeneralFailure) if the alignment was not changed. 
  11518.  
  11519. Example 
  11520. FUNCTION Example() 
  11521. String = "This is a line of Text. " 
  11522. FOR i = 1 to 10 
  11523.     Paste() 
  11524. NEXT 
  11525. Justify() 
  11526. END FUNCTION 
  11527.  
  11528. See also: 
  11529.  
  11530.     Center 
  11531.     LeftAlign 
  11532.     NormalText 
  11533.     RightAlign 
  11534.  
  11535.  
  11536.  
  11537. ΓòÉΓòÉΓòÉ 258. KeyInterrupt ΓòÉΓòÉΓòÉ
  11538.  
  11539. This function sets a macro function to be called if the user hits a key while 
  11540. the current macro is running. The called macro function is passed the virtual 
  11541. key. If the interrupt routine needs to pass information to the main function, 
  11542. it must pass it through a global variable and the main function must check that 
  11543. global variable. 
  11544.  
  11545.  
  11546. Syntax 
  11547. KeyInterrupt(Function) 
  11548. Function is the function that runs when a key is pressed. This parameter may 
  11549. contain the macro file name or the function within that file to call. 
  11550.  
  11551. Return Value 
  11552. This function returns the previously set KeyInterrupt function. 
  11553.  
  11554. Example 
  11555. FUNCTION Example() 
  11556. KeyInterrupt("KeyInt") 
  11557. TYPE("Touch any key") 
  11558. FOR i = 1 to 5  ' Kill some time. 
  11559.     FOR j = 1 to 100 
  11560.     NEXT 
  11561.     TYPE("{i}.") 
  11562. NEXT 
  11563. END FUNCTION 
  11564.  
  11565. FUNCTION KeyInt(key) 
  11566. Message("KeyInt {key}") 
  11567. END FUNCTION 
  11568.  
  11569. See Also: 
  11570.  
  11571.     DlgKeyInterrupt 
  11572.     HourGlass 
  11573.     MouseInterrupt 
  11574.     Pause 
  11575.  
  11576.  
  11577.  
  11578. ΓòÉΓòÉΓòÉ 259. LayoutMode ΓòÉΓòÉΓòÉ
  11579.  
  11580. This function changes the current document in Ami Pro from Draft Mode or 
  11581. Outline Mode to Layout Mode. This function is equivalent to choosing View 
  11582. Layout Mode. 
  11583.  
  11584.  
  11585. Syntax 
  11586. LayoutMode() 
  11587.  
  11588. Return Value 
  11589. 1  (TRUE) if the view mode was changed. 
  11590. 0  (NoAction) if no action was taken because Ami Pro is already in the mode 
  11591. selected. 
  11592.  
  11593. Example 
  11594. FUNCTION Example() 
  11595. Mode = GetMode()'What mode is the screen in? 
  11596. IF Mode != 1 
  11597.     LayoutMode()'If not Layout Mode, make it so. 
  11598. ENDIF 
  11599. END FUNCTION 
  11600.  
  11601. See also: 
  11602.  
  11603.     CustomView 
  11604.     DraftMode 
  11605.     EnlargedView 
  11606.     FacingView 
  11607.     FullPageView 
  11608.     GetMode 
  11609.     GetViewLevel 
  11610.     OutlineMode 
  11611.     StandardView 
  11612.  
  11613.  
  11614. ΓòÉΓòÉΓòÉ 260. LCASE ΓòÉΓòÉΓòÉ
  11615.  
  11616. This function converts uppercase letters in the source string to lowercase and 
  11617. returns the resulting string. It does not change punctuation or numbers. 
  11618.  
  11619.  
  11620. Syntax 
  11621. LCASE$(Text) 
  11622. Text is the string that is converted to lowercase. 
  11623.  
  11624. Return Value 
  11625. The string with all lowercase letters. 
  11626.  
  11627. Example 
  11628. FUNCTION Example() 
  11629. Again: 
  11630. Number = Query$("How much was the sale?") 
  11631. Where = Query$("Where was the sale made (E)ngland, or (A)merica?") 
  11632. Where = lcase$(Left$(Where, 1)) 
  11633. IF Where = "e" 
  11634.     Prefix = "" 
  11635.     Suffix = "╨│" 
  11636. ELSEIF Where = "a" 
  11637.     Prefix = "$" 
  11638.     Suffix = "" 
  11639. ELSE 
  11640.     Message("Please choose ""E"" or ""A"".") 
  11641.     GoTo again 
  11642. ENDIF 
  11643. NewNumber = FormatNum$(Prefix, Suffix, 2, Number) 
  11644. Message("The sale was for {NewNumber}.") 
  11645. END FUNCTION 
  11646.  
  11647. See also: 
  11648.  
  11649.     ASC 
  11650.     CHR$ 
  11651.     FormatNum$ 
  11652.     Instr 
  11653.     LEN 
  11654.     MID$ 
  11655.     strcat$ 
  11656.     strchr 
  11657.     strfield$ 
  11658.     UCASE$ 
  11659.  
  11660.  
  11661. ΓòÉΓòÉΓòÉ 261. LeaderDots ΓòÉΓòÉΓòÉ
  11662.  
  11663. This function applies dots for leader characters in the current table cell or 
  11664. selected table cells. This function is equivalent to choosing Table Leaders and 
  11665. selecting dots for the leader type. 
  11666.  
  11667.  
  11668. Syntax 
  11669. LeaderDots() 
  11670.  
  11671. Return Value 
  11672. 1  (TRUE) if the leader dots were applied. 
  11673. 0  (NoAction) if no action was taken. 
  11674. -6  (NoMemory) if the function failed because of insufficient memory. 
  11675.  
  11676. Example 
  11677. FUNCTION Example() 
  11678. ' create a table 
  11679. Tables(1, TRUE, 5, 5) 
  11680. LeaderDots() 
  11681. TYPE("[Right]") 
  11682. LeaderHyphs() 
  11683. TYPE("[Right]") 
  11684. LeaderLines() 
  11685. IF Decide("Press OK to remove leaders.") 
  11686.     TYPE("[Left][Left]") 
  11687.     FOR i = 1 to 3 
  11688.        LeaderNone() 
  11689.        TYPE("[Right]") 
  11690.     NEXT 
  11691. ENDIF 
  11692. END FUNCTION 
  11693.  
  11694. See also: 
  11695.  
  11696.     LeaderHyphs 
  11697.     LeaderLines 
  11698.     LeaderNone 
  11699.     TableLayout 
  11700.     TableLines 
  11701.     Tables 
  11702.  
  11703.  
  11704. ΓòÉΓòÉΓòÉ 262. LeaderHyphs ΓòÉΓòÉΓòÉ
  11705.  
  11706. This function applies dashes for leader characters in the current table cell or 
  11707. selected table cells. This function is equivalent to choosing Table Leaders and 
  11708. selecting dashes for the leader type. 
  11709.  
  11710.  
  11711. Syntax 
  11712. LeaderHyphs() 
  11713.  
  11714. Return Value 
  11715. 1  (TRUE) if the leader dashes were applied. 
  11716. 0  (NoAction) if no action was taken. 
  11717. -6  (NoMemory) if the function failed because of insufficient memory. 
  11718.  
  11719. Example 
  11720. FUNCTION Example() 
  11721. ' create a table 
  11722. Tables(1, TRUE, 5, 5) 
  11723. LeaderDots() 
  11724. TYPE("[Right]") 
  11725. LeaderHyphs() 
  11726. TYPE("[Right]") 
  11727. LeaderLines() 
  11728. IF Decide("Press OK to remove leaders.") 
  11729.     TYPE("[Left][Left]") 
  11730.     FOR i = 1 to 3 
  11731.        LeaderNone() 
  11732.        TYPE("[Right]") 
  11733.     NEXT 
  11734. ENDIF 
  11735. END FUNCTION 
  11736.  
  11737. See also: 
  11738.  
  11739.     LeaderDots 
  11740.     LeaderLines 
  11741.     LeaderNone 
  11742.     TableLayout 
  11743.     TableLines 
  11744.     Tables 
  11745.  
  11746.  
  11747. ΓòÉΓòÉΓòÉ 263. LeaderLines ΓòÉΓòÉΓòÉ
  11748.  
  11749. This function applies underlines for leader characters in the current table 
  11750. cell or selected table cells. This function is equivalent to choosing Table 
  11751. Leaders and selecting underline for the leader type. 
  11752.  
  11753.  
  11754. Syntax 
  11755. LeaderLines() 
  11756.  
  11757. Return Value 
  11758. 1  (TRUE) if the leader dots were applied. 
  11759. 0  (NoAction) if no action was taken. 
  11760. -6  (NoMemory) if the function failed because of insufficient memory. 
  11761.  
  11762. Example 
  11763. FUNCTION Example() 
  11764. ' create a table 
  11765. Tables(1, TRUE, 5, 5) 
  11766. LeaderDots() 
  11767. TYPE("[Right]") 
  11768. LeaderHyphs() 
  11769. TYPE("[Right]") 
  11770. LeaderLines() 
  11771. IF Decide("Press OK to remove leaders.") 
  11772.     TYPE("[Left][Left]") 
  11773.     FOR i = 1 to 3 
  11774.        LeaderNone() 
  11775.        TYPE("[Right]") 
  11776.     NEXT 
  11777. ENDIF 
  11778. END FUNCTION 
  11779.  
  11780. See also: 
  11781.  
  11782.     LeaderDots 
  11783.     LeaderHyphs 
  11784.     LeaderNone 
  11785.     TableLayout 
  11786.     TableLines 
  11787.     Tables 
  11788.  
  11789.  
  11790. ΓòÉΓòÉΓòÉ 264. LeaderNone ΓòÉΓòÉΓòÉ
  11791.  
  11792. This function turns off the leader characters in the current table cell or 
  11793. selected table cells. This function is equivalent to choosing Table Leaders 
  11794. None. 
  11795.  
  11796.  
  11797. Syntax 
  11798. LeaderNone() 
  11799.  
  11800. Return Value 
  11801. 1  (TRUE) if the leader dots were applied. 
  11802. 0  (NoAction) if no action was taken. 
  11803. -6  (NoMemory) if the function failed because of insufficient memory. 
  11804.  
  11805. Example 
  11806. FUNCTION Example() 
  11807. ' create a table 
  11808. Tables(1, TRUE, 5, 5) 
  11809. LeaderDots() 
  11810. TYPE("[Right]") 
  11811. LeaderHyphs() 
  11812. TYPE("[Right]") 
  11813. LeaderLines() 
  11814. IF Decide("Press OK to remove leaders.") 
  11815.     TYPE("[Left][Left]") 
  11816.     FOR i = 1 to 3 
  11817.        LeaderNone() 
  11818.        TYPE("[Right]") 
  11819.     NEXT 
  11820. ENDIF 
  11821. END FUNCTION 
  11822.  
  11823. See also: 
  11824.  
  11825.     LeaderDots 
  11826.     LeaderHyphs 
  11827.     LeaderLines 
  11828.     TableLayout 
  11829.     TableLines 
  11830.     Tables 
  11831.  
  11832.  
  11833. ΓòÉΓòÉΓòÉ 265. Left ΓòÉΓòÉΓòÉ
  11834.  
  11835. This function returns the specified number of characters from the left of the 
  11836. specified string. 
  11837.  
  11838.  
  11839. Syntax 
  11840. Left$(Text, Length) 
  11841. Text is the string to be parsed. 
  11842. Length is the number of characters from the left end of the string to be 
  11843. parsed. 
  11844.  
  11845. Return Value 
  11846. The specified number of characters from the left end of the string. 
  11847. 0  (UserCancel) if the user canceled the function. 
  11848. -2  (GeneralFailure) if the string could not be parsed. 
  11849.  
  11850. Example 
  11851. FUNCTION Example() 
  11852. Message(Left$(Query$("What is your name?"), 5)) 
  11853. END FUNCTION 
  11854.  
  11855. See also: 
  11856.  
  11857.     Instr 
  11858.     MID$ 
  11859.     Right$ 
  11860.  
  11861.  
  11862. ΓòÉΓòÉΓòÉ 266. LeftAlign ΓòÉΓòÉΓòÉ
  11863.  
  11864. This function acts as a toggle to turn on or off left alignment for a 
  11865. paragraph. This function is equivalent to choosing Text Alignment Left. 
  11866.  
  11867.  
  11868. Syntax 
  11869. LeftAlign() 
  11870.  
  11871. Return Value 
  11872. 1  (TRUE) if the text was left aligned, or if alignment was removed. 
  11873. -2  (GeneralFailure) if the alignment was not changed. 
  11874.  
  11875. Example 
  11876. FUNCTION Example() 
  11877. String = "This is a line of Text. " 
  11878. FOR i = 1 to 10 
  11879.     Paste() 
  11880. NEXT 
  11881. LeftAlign() 
  11882. END FUNCTION 
  11883.  
  11884. See also: 
  11885.  
  11886.     Center 
  11887.     Justify 
  11888.     NormalText 
  11889.     RightAlign 
  11890.  
  11891.  
  11892. ΓòÉΓòÉΓòÉ 267. LeftEdge ΓòÉΓòÉΓòÉ
  11893.  
  11894. This function scrolls the document to the left edge of the page without moving 
  11895. the insertion point. This function is equivalent to dragging the slider box on 
  11896. the horizontal scroll bar to the left using the mouse. 
  11897.  
  11898.  
  11899. Syntax 
  11900. LeftEdge() 
  11901.  
  11902. Return Value 
  11903. This function returns 0. 
  11904.  
  11905. Example 
  11906. FUNCTION Example() 
  11907. LeftEdge() 
  11908. END FUNCTION 
  11909.  
  11910. See also: 
  11911.  
  11912.     CharLeft 
  11913.     CharRight 
  11914.     EndOfFile 
  11915.     LineDown 
  11916.     LineUp 
  11917.     RightEdge 
  11918.     ScreenDown 
  11919.     ScreenLeft 
  11920.     ScreenRight 
  11921.     ScreenUp 
  11922.     TopOfFile 
  11923.  
  11924.  
  11925. ΓòÉΓòÉΓòÉ 268. LEN ΓòÉΓòÉΓòÉ
  11926.  
  11927. This function determines the number of characters in the specified string. 
  11928.  
  11929.  
  11930. Syntax 
  11931. LEN(Text) 
  11932. Text is the string whose length is determined. 
  11933.  
  11934. Return Value 
  11935. The length of the string. 
  11936. 0  (FALSE) if the string is empty. 
  11937.  
  11938. Example 
  11939. FUNCTION Example() 
  11940. DEFSTR Char; 
  11941. ' get the name of the open file 
  11942. OpenFile = GetOpenFileName$() 
  11943. ' get the length of the name 
  11944. I = len(OpenFile) 
  11945. ' take off the path 
  11946. WHILE "\" != Assign(&Char, MID$(OpenFile, I, 1)) 
  11947.     I = I - 1 
  11948. WEND 
  11949. FileName = Right$(OpenFile, (len(OpenFile) - I)) 
  11950. Message("The current file is {FileName}.") 
  11951. END FUNCTION 
  11952.  
  11953. See also: 
  11954.  
  11955.     FormatNum$ 
  11956.     LCASE$ 
  11957.     Left$ 
  11958.     MID$ 
  11959.     Right$ 
  11960.     strcat$ 
  11961.     strchr 
  11962.     strfield$ 
  11963.     UCASE$ 
  11964.  
  11965.  
  11966.  
  11967.  
  11968. ΓòÉΓòÉΓòÉ 269. LineDown ΓòÉΓòÉΓòÉ
  11969.  
  11970. This function scrolls the document down one line without moving the insertion 
  11971. point. This function is equivalent to clicking once on the vertical scroll bar 
  11972. up arrow. 
  11973.  
  11974.  
  11975. Syntax 
  11976. LineDown() 
  11977.  
  11978. Return Value 
  11979. This function returns 0. 
  11980.  
  11981. Example 
  11982. FUNCTION Example() 
  11983. LineDown() 
  11984. END FUNCTION 
  11985.  
  11986. See also: 
  11987.  
  11988.     CharLeft 
  11989.     CharRight 
  11990.     EndOfFile 
  11991.     LeftEdge 
  11992.     LineUp 
  11993.     RightEdge 
  11994.     ScreenDown 
  11995.     ScreenLeft 
  11996.     ScreenRight 
  11997.     ScreenUp 
  11998.     TopOfFile 
  11999.  
  12000.  
  12001.  
  12002. ΓòÉΓòÉΓòÉ 270. LineNumber ΓòÉΓòÉΓòÉ
  12003.  
  12004. This function places line numbers in the left margin of the document. This 
  12005. function is equivalent to choosing Page Line Numbering. 
  12006.  
  12007.  
  12008. Syntax 
  12009. LineNumber(Which, Style, Custom) 
  12010. Which determines the type of line to number and the frequency of the line 
  12011. numbering. It is a combination of the following values: 
  12012. Type of line to number: 
  12013.     Off (0) - Do not number lines 
  12014.     NumberLines (1) - Number any type of line 
  12015.     NumberTextLines (128) - Number text lines 
  12016. Use one of the following in combination with one of the above: 
  12017.     NumberEvery (2) - Number all lines (of the type selected above) 
  12018.     NumberEveryOther (4) - Number every other line (of the type selected above) 
  12019.     NumberEveryFifth (8) - Number every fifth line (of the type selected above) 
  12020.     NumberEveryCustom (32) - Number every nth line (of the type selected 
  12021.     above), where n is a custom number 
  12022. Additional Optional Value: 
  12023.     ResetEachPage (16) - Reset the numbering sequence on every page of the 
  12024.     document 
  12025. Style is the paragraph style to use in determining the spacing for the line 
  12026. numbering. The Style parameter must be used, even if line numbering is being 
  12027. turned off. 
  12028. Custom is the number indicating the frequency of the line numbering. 
  12029.  
  12030. To display the Line Numbering dialog box to allow the user to choose the line 
  12031. numbering options: LineNumber 
  12032.  
  12033. Return Value 
  12034. 1  (TRUE) if the numbering sequence was set. 
  12035. 0  (UserCancel) if the user canceled the function, or if no action was taken. 
  12036.  
  12037. Example 
  12038. FUNCTION Example() 
  12039. LineNumber(3, "Body Text", 0) 
  12040. END FUNCTION 
  12041.  
  12042. See also: 
  12043.  
  12044.     PageNumber 
  12045.  
  12046.  
  12047.  
  12048.  
  12049.  
  12050. ΓòÉΓòÉΓòÉ 271. LineUp ΓòÉΓòÉΓòÉ
  12051.  
  12052. This function scrolls the document up one line without moving the insertion 
  12053. point. This function is equivalent to clicking once on the vertical scroll bar 
  12054. down arrow. 
  12055.  
  12056.  
  12057. Syntax 
  12058. LineUp() 
  12059.  
  12060. Return Value 
  12061. This function returns 0. 
  12062.  
  12063. Example 
  12064. FUNCTION Example() 
  12065. LineUp() 
  12066. END FUNCTION 
  12067.  
  12068. See also: 
  12069.  
  12070.     CharLeft 
  12071.     CharRight 
  12072.     EndOfFile 
  12073.     LeftEdge 
  12074.     LineDown 
  12075.     RightEdge 
  12076.     ScreenDown 
  12077.     ScreenLeft 
  12078.     ScreenRight 
  12079.     ScreenUp 
  12080.     TopOfFile 
  12081.  
  12082.  
  12083. ΓòÉΓòÉΓòÉ 272. LoadOptions ΓòÉΓòÉΓòÉ
  12084.  
  12085. This function sets initial display preferences for using Ami Pro. This function 
  12086. is equivalent to choosing Tools User Setup and choosing Load. 
  12087.  
  12088.  
  12089. Syntax 
  12090. LoadOptions(InitialView, Options, StyleSheet) 
  12091. InitialView determines whether Standard or C ustom  view initially displays. 
  12092. The InitialView parameter should be set to one of the following options. 
  12093.     StartCustom (2) - Start in Custom View 
  12094.     StartStandard (3) - Start in Standard View 
  12095. Options is a flag variable determining other display defaults. 
  12096. If any of the following options parameters are set, they take effect when the 
  12097. program starts. If the options are not set, they do not take effect. Options 
  12098. can be one or more of the following: 
  12099.     StartLayout (1) - Start the program in Layout Mode. This value may not be 
  12100.     combined with StartOutline. 
  12101.     StartMax (8) - Maximize the Ami Pro window when the program is loaded; 
  12102.     otherwise, use the previously set window size. 
  12103.     ShowLogo (64) - Display the Ami Pro logo when the program starts; otherwise 
  12104.     do not display the logo. 
  12105.     StartOutline (256) - Start the program in Outline Mode. This value may not 
  12106.     be combined with StartLayout. 
  12107.     ShowDesc (1024) - List the style sheets by description name (rather than 
  12108.     style sheet file name) in the Load Defaults dialog box. 
  12109.     StartClean (2048) - Start the program in Clean Screen mode. 
  12110. If StartLayout or StartOutline is not set, the program starts in Draft Mode. 
  12111. To set multiple options, add the option values together before passing them to 
  12112. the function. 
  12113. StyleSheet is the default style sheet to use for new documents. 
  12114.  
  12115. To show the Load Defaults dialog box and allow the user to select initial 
  12116. display preferences: 
  12117. LoadDefaults 
  12118.  
  12119. Return Value 
  12120. 1  (TRUE) if the load options were successfully set. 
  12121. 0  (UserCancel) if the user canceled the function. 
  12122. -2  (GeneralFailure) if the options could not be set. 
  12123.  
  12124. Example 
  12125. FUNCTION Example() 
  12126. LoadOptions(StartStandard, StartLayout, "_MACRO.STY") 
  12127. END FUNCTION 
  12128.  
  12129. See also: 
  12130.  
  12131.     SetDefOptions 
  12132.     UserSetup 
  12133.     ViewPreferences 
  12134.  
  12135.  
  12136. ΓòÉΓòÉΓòÉ 273. LowerCase ΓòÉΓòÉΓòÉ
  12137.  
  12138. This function sets lowercase for selected text or for all following text if no 
  12139. text is selected. It acts as a toggle, turning off lowercase if it is on or 
  12140. turning on lowercase if it is off. This function is equivalent to choosing Text 
  12141. Caps Lower Case. 
  12142.  
  12143.  
  12144. Syntax 
  12145. LowerCase() 
  12146.  
  12147. Return Value 
  12148. 1  (TRUE) if the attribute was changed. 
  12149. -6  (NoMemory) if the function failed because of insufficient memory. 
  12150.  
  12151. Example 
  12152. FUNCTION Example() 
  12153. LowerCase() 
  12154. END FUNCTION 
  12155.  
  12156. See also: 
  12157.  
  12158.     SmallCaps 
  12159.     UpperCase 
  12160.  
  12161.  
  12162. ΓòÉΓòÉΓòÉ 274. MacroEdit ΓòÉΓòÉΓòÉ
  12163.  
  12164. This function displays the Edit Macro dialog box. This function is equivalent 
  12165. to choosing Tools Macros Edit. 
  12166.  
  12167.  
  12168. A macro must be edited to insert this non-recordable function. 
  12169.  
  12170. Syntax 
  12171. MacroEdit() 
  12172.  
  12173. Return Value 
  12174. This function returns 1. 
  12175.  
  12176. Example 
  12177. FUNCTION Example() 
  12178. MacroEdit() 
  12179. END FUNCTION 
  12180.  
  12181. See also: 
  12182.  
  12183.     AssignMacroToFile 
  12184.     ChangeShortcutKey 
  12185.     MacroOptions 
  12186.     MacroPlay 
  12187.     OnKey 
  12188.  
  12189.  
  12190. ΓòÉΓòÉΓòÉ 275. MacroHelp ΓòÉΓòÉΓòÉ
  12191.  
  12192. This function displays the online Ami Pro Macro Documentation Help. This 
  12193. function is equivalent to choosing Help Macro Doc. 
  12194.  
  12195.  
  12196. Syntax 
  12197. MacroHelp() 
  12198.  
  12199. Return Value 
  12200. 1  (TRUE) if the macro Help window displayed. 
  12201. -2  (GeneralFailure) if the macro Help window could not be displayed for some 
  12202. reason other than insufficient memory. 
  12203. -6  (NoMemory) if the function failed because of insufficient memory. 
  12204.  
  12205. Example 
  12206. FUNCTION Example() 
  12207. MacroHelp() 
  12208. END FUNCTION 
  12209.  
  12210. See also: 
  12211.  
  12212.     About 
  12213.     Help 
  12214.     HowDoIHelp 
  12215.     UsingHelp 
  12216.  
  12217.  
  12218.  
  12219. ΓòÉΓòÉΓòÉ 276. MacroOptions ΓòÉΓòÉΓòÉ
  12220.  
  12221. This function displays the Quick Record Macro Options dialog box. This function 
  12222. is equivalent to choosing Tools Macros Record and choosing Options. The dialog 
  12223. box allows you to select shortcut keys for Quick Macro Record and Quick Macro 
  12224. Play. 
  12225.  
  12226.  
  12227. A macro must be edited to insert this non-recordable function. 
  12228.  
  12229. Syntax 
  12230. MacroOptions() 
  12231.  
  12232. Return Value 
  12233. This function returns 1. 
  12234.  
  12235. Example 
  12236. FUNCTION Example() 
  12237. MacroOptions() 
  12238. END FUNCTION 
  12239.  
  12240. See also: 
  12241.  
  12242.     AssignMacroToFile 
  12243.     ChangeShortcutKey 
  12244.     MacroEdit 
  12245.     MacroPlay 
  12246.     OnKey 
  12247.  
  12248.  
  12249. ΓòÉΓòÉΓòÉ 277. MacroPlay ΓòÉΓòÉΓòÉ
  12250.  
  12251. This function displays the Play Macro dialog box. This function is equivalent 
  12252. to choosing Tools Macros Playback. 
  12253.  
  12254. A macro must be edited to insert this non-recordable function. 
  12255.  
  12256. Syntax 
  12257. MacroPlay() 
  12258.  
  12259. Return Value 
  12260. This function returns 1. 
  12261.  
  12262. Example 
  12263. FUNCTION Example() 
  12264. MacroPlay() 
  12265. END FUNCTION 
  12266.  
  12267. See also: 
  12268.  
  12269.     AssignMacroToFile 
  12270.     ChangeShortcutKey 
  12271.     MacroEdit 
  12272.     MacroOptions 
  12273.     OnKey 
  12274.  
  12275.  
  12276. ΓòÉΓòÉΓòÉ 278. ManualFrame ΓòÉΓòÉΓòÉ
  12277.  
  12278. This function displays the frame arrow and allows the user to manually create a 
  12279. frame. This function is equivalent to choosing Frame Create Frame and choosing 
  12280. Create Manually. 
  12281.  
  12282.  
  12283. Syntax 
  12284. ManualFrame() 
  12285.  
  12286. Return Value 
  12287. This function returns 1. 
  12288.  
  12289. Example 
  12290. FUNCTION Example() 
  12291. ManualFrame() 
  12292. END FUNCTION 
  12293.  
  12294. See also: 
  12295.  
  12296.     AddFrame 
  12297.     AddFrameDlg 
  12298.     FrameLayout 
  12299.     FrameModBorders 
  12300.     FrameModFinish 
  12301.     FrameModInit 
  12302.     FrameModLines 
  12303.     FrameModType 
  12304.     IsFrameSelected 
  12305.     SelectFrameByName 
  12306.     SetFrameDefaults 
  12307.  
  12308.  
  12309. ΓòÉΓòÉΓòÉ 279. MarkBookMark ΓòÉΓòÉΓòÉ
  12310.  
  12311. This function allows the user to add a bookmark, remove a bookmark, or go to a 
  12312. specific bookmark. This function is equivalent to choosing Edit Bookmarks. 
  12313.  
  12314.  
  12315. Syntax 
  12316. MarkBookMark(Name, Which) 
  12317. Name is the name of the new bookmark. 
  12318. Which is the desired bookmark function and can be one of the following: 
  12319.     AddBookmark (4003) - Add a new bookmark with the name provided 
  12320.     DeleteBookmark (4004) - Remove the named bookmark 
  12321.     FindBookmark (4002) - Go to the named bookmark 
  12322.  
  12323. To display the Bookmarks dialog box to allow the user to select the bookmark 
  12324. function and name: MarkBookMark 
  12325.  
  12326. Return Value 
  12327. 1  (TRUE) if the bookmark function was successfully completed. 
  12328. -2  (GeneralFailure) if the bookmark function could not be completed. 
  12329.  
  12330. Example 
  12331. FUNCTION Example() 
  12332. MarkBookMark("Example", AddBookmark) 
  12333. TYPE("[CtrlEND]") 
  12334. PageNo = GetPageNo() 
  12335. MarkBookMark("Example", FindBookmark) 
  12336. Text = GetMarkText$() 
  12337. MarkBookMark("Example", DeleteBookmark) 
  12338. IF Text != "" 
  12339.     Message("Your bookmark was named ""{Text}"", and there are {PageNo} pages 
  12340.  in this document.") 
  12341. ENDIF 
  12342. END FUNCTION 
  12343.  
  12344. See also: 
  12345.  
  12346.     GetMarkText$ 
  12347.     GoToCmd 
  12348.  
  12349.  
  12350.  
  12351. ΓòÉΓòÉΓòÉ 280. MarkIndexWord ΓòÉΓòÉΓòÉ
  12352.  
  12353. This function displays the Mark Index Entry dialog box to allow you to mark 
  12354. selected text for inclusion in the index. This function is equivalent to 
  12355. choosing Edit Mark Text Index Entry. 
  12356.  
  12357. To automatically mark a word for the index, use the FieldAdd function. To 
  12358. automatically remove an index entry, use the FieldRemove function. 
  12359.  
  12360. Syntax 
  12361. MarkIndexWord 
  12362.  
  12363. Return Value 
  12364. This function returns 0. 
  12365.  
  12366. Example 
  12367. FUNCTION Example() 
  12368. MarkIndexWord 
  12369. END FUNCTION 
  12370.  
  12371. See also: 
  12372.  
  12373.     FieldAdd 
  12374.     FieldRemove 
  12375.     Generate 
  12376.     SetIndexFile 
  12377.  
  12378.  
  12379. ΓòÉΓòÉΓòÉ 281. MarkTOCEntry ΓòÉΓòÉΓòÉ
  12380.  
  12381. This function displays the TOC Entry dialog box to allow you to mark selected 
  12382. text for a table of contents entry. This function is equivalent to choosing 
  12383. Edit Mark Text TOC Entry. 
  12384.  
  12385.  
  12386. To automatically add a TOC entry, use the FieldAdd function. To automatically 
  12387. remove a TOC entry, use the FieldRemove function. 
  12388.  
  12389. Syntax 
  12390. MarkTOCEntry 
  12391.  
  12392. Return Value 
  12393. This function returns 0. 
  12394.  
  12395. Example 
  12396. FUNCTION Example() 
  12397. MarkTOCEntry 
  12398. END FUNCTION 
  12399.  
  12400. See also: 
  12401.  
  12402.     FieldAdd 
  12403.     FieldRemove 
  12404.     Generate 
  12405.     SetTOCFile 
  12406.     TOCOptions 
  12407.  
  12408.  
  12409. ΓòÉΓòÉΓòÉ 282. MasterDoc ΓòÉΓòÉΓòÉ
  12410.  
  12411. This function displays the Master Document dialog box and allows you to select 
  12412. files to add or remove from the master document. This function is equivalent to 
  12413. choosing File Master Document. 
  12414.  
  12415.  
  12416. This function does not automatically add or remove files from the master 
  12417. document. You can use the SetMasterFiles function to add or remove files from 
  12418. the master document. 
  12419.  
  12420. Syntax 
  12421. MasterDoc 
  12422.  
  12423. Return Value 
  12424. This function returns 0. 
  12425.  
  12426. Example 
  12427. FUNCTION Example() 
  12428. MasterDoc 
  12429. END FUNCTION 
  12430.  
  12431. See also: 
  12432.  
  12433.     GetMasterFilesCount 
  12434.     GetMasterFiles 
  12435.     SetIndexFile 
  12436.     SetMasterFiles 
  12437.     SetTOCFile 
  12438.     TOCOptions 
  12439.  
  12440.  
  12441.  
  12442.  
  12443. ΓòÉΓòÉΓòÉ 283. Maximize ΓòÉΓòÉΓòÉ
  12444.  
  12445. This function maximizes the Ami Pro window, causing it to fill the entire 
  12446. screen. This function is equivalent to choosing System Maximize. If the window 
  12447. size is already maximized, executing this function restores the previous screen 
  12448. size. All other windows are moved behind the Ami Pro window when this function 
  12449. is executed. 
  12450.  
  12451.  
  12452. Syntax 
  12453. Maximize() 
  12454.  
  12455. Return Value 
  12456. This function does not return a value. 
  12457.  
  12458. Example 
  12459. FUNCTION Example() 
  12460. Maximize() 
  12461. END FUNCTION 
  12462.  
  12463. See also: 
  12464.  
  12465.     Minimize 
  12466.     Restore 
  12467.  
  12468.  
  12469. ΓòÉΓòÉΓòÉ 284. Merge ΓòÉΓòÉΓòÉ
  12470.  
  12471. This function merges a merge document with a data file. This function is 
  12472. equivalent to choosing File Merge, selecting option 3, choosing OK, and then 
  12473. selecting Merge & print. Using this function sends the merge documents to the 
  12474. printer. 
  12475.  
  12476.  
  12477. Before using the merge function, your macro should ensure that the merge 
  12478. document you want to merge to is on the screen. 
  12479.  
  12480. Syntax 
  12481. Merge(Flag, RecFile[, DescFile][, SelectionKey, SelectionKey, Operator, 
  12482. FieldNumber, NextOp...]) 
  12483. Flag is a number that defines which optional parameters are used and can be one 
  12484. of the following: 
  12485.     (0) - 0 selection criteria given 
  12486.     (1) - 1 selection criterion given 
  12487.     (2) - 2 selection criteria given 
  12488.     (3) - 3 selection criteria given 
  12489.     Description (8) - This merge uses a description file and includes the 
  12490.     description filename 
  12491. The number of criteria used (0 - 3) should be added to the description value to 
  12492. make up the value of the Flag parameter. 
  12493. RecFile is the data file the merge document is merged with. 
  12494. DescFile is the optional description file used when the data file is not an Ami 
  12495. Pro file. The DescFile should be used as the next parameter only if a 
  12496. description file is used. 
  12497. SelectionKey is a string or number to use in the selection of records to merge. 
  12498. The compare key is a string, if using an alphanumeric comparison, or a number, 
  12499. if using a numeric comparison. 
  12500. Operator is the operator to use in the selection comparison and can be one of 
  12501. the following values. 
  12502.     Equal (0) - The field's value must be equal to the key to merge. 
  12503.     LessThan (1) - The field's value must be less than the key to merge. 
  12504.     GreaterThan (2) - The field's value must be greater than the key to merge. 
  12505.     NotEqual (3) - The field's value must be different than the key to merge. 
  12506.     Lteq (4) - The field's value must be less than or equal to the key to 
  12507.     merge. 
  12508.     Gteq (5) - The field's value must be greater than or equal to the key to 
  12509.     merge. 
  12510. FieldNumber is the number of the field to use for this selection. It is zero 
  12511. based. To compare against the first field in the data file, set field number to 
  12512. 0. 
  12513. NextOp is a number that defines whether to select based on this criterion AND 
  12514. the next one, or this one OR the next one. If there are no more specifications 
  12515. this field should be zero. The values for this field are: 
  12516.     AndNext (1) - This selection AND the following selection must match to 
  12517.     merge this record. 
  12518.     OrNext (2) - This selection OR the following selection must match to merge 
  12519.     this record. 
  12520.  
  12521. To display the Merge dialog box and allow the user to set merge specifications: 
  12522. Merge 
  12523.  
  12524. Return Value 
  12525. 1  (TRUE) if the merge was completed. 
  12526. 0  (UserCancel) if the user canceled the function. 
  12527. -3  if the input was invalid. 
  12528. -2  (GeneralFailure) if the merge failed. 
  12529.  
  12530. Example 
  12531. FUNCTION Example() 
  12532. Merge(0, "TEST.SAM") 
  12533. END FUNCTION 
  12534.  
  12535. See also: 
  12536.  
  12537.     MergeAction 
  12538.     MergeMacro 
  12539.     MergeToFile 
  12540.  
  12541.  
  12542. ΓòÉΓòÉΓòÉ 285. MergeAction ΓòÉΓòÉΓòÉ
  12543.  
  12544. This function is used in conjunction with the MergeMacro function to decide 
  12545. whether a merge document should be printed, not printed, canceled, or the rest 
  12546. of the documents should be printed. This function is equivalent to choosing 
  12547. File Merge, selecting option 3, choosing OK, and then selecting Merge, view & 
  12548. print. 
  12549.  
  12550.  
  12551. This function must be called once for each record merged and again after either 
  12552. the end of the data file has been reached or the user cancels the printing of 
  12553. the merged records. 
  12554.  
  12555. Syntax 
  12556. MergeAction(Which) 
  12557. Which is the action to take on the merged document and can be one of the 
  12558. following: 
  12559.     PrintDoc (1) - Print this one 
  12560.     MergeNext (2) - Do not print this one; prepare the next one 
  12561.     MergeCont (3) - Print this one; print the rest of them without stopping 
  12562.     MergeStop (4) - Do not print this one; cancel the rest of the merge 
  12563.  
  12564. To display the Merge dialog box and allow the user to set merge specifications: 
  12565. Merge 
  12566.  
  12567. Return Value 
  12568. 1  (TRUE) if the record was merged. 
  12569. 0  (UserCancel/FALSE) at the end of the data file, or if the user cancels 
  12570. printing of the merged record following a PrintDoc or MergeCont. 
  12571. -2  (GeneralFailure) if the record was not merged. 
  12572.  
  12573. Example 
  12574. FUNCTION Example() 
  12575. docdir = GetDocPath$() 
  12576. datafile = "{docdir}mercdata.sam" 
  12577. descfile = "" 
  12578. 'configure mergefile for printing 
  12579. MergeMacro(24, datafile, descfile) 
  12580. 'do not actually print them; this associates the datafile 
  12581. MergeAction(mergestop) 
  12582. END FUNCTION 
  12583.  
  12584. See also: 
  12585.  
  12586.     Merge 
  12587.     MergeMacro 
  12588.     MergeToFile 
  12589.  
  12590.  
  12591. ΓòÉΓòÉΓòÉ 286. MergeMacro ΓòÉΓòÉΓòÉ
  12592.  
  12593. This function merges a merge document with a data file, then allows the macro 
  12594. to examine the merged document, edit it, and decide if it should be printed. 
  12595. This function is equivalent to choosing File Merge, selecting option 3, 
  12596. choosing OK, and then selecting Merge, view & print. Once the first document 
  12597. has been merged, the MergeAction function is used to decide what should be done 
  12598. with the document. This function is equivalent to choosing the dialog box that 
  12599. appears onscreen during Merge, view & print. 
  12600.  
  12601.  
  12602. Before using the merge function, your macro should ensure that the merge 
  12603. document you want to merge to is on the screen. 
  12604.  
  12605. Syntax 
  12606. MergeMacro(Flag, RecFile[, DescFile][, SelectionKey, SelectionKey, Operator, 
  12607. FieldNumber, NextOp...]) 
  12608. Flag is a number that defines which optional parameters are used and can be one 
  12609. of the following: 
  12610.     (0) - 0 selection criteria given 
  12611.     (1) - 1 selection criterion given 
  12612.     (2) - 2 selection criteria given 
  12613.     (3) - 3 selection criteria given 
  12614.     Description (8) - This merge uses a description file and includes the 
  12615.     description filename 
  12616. The number of criteria used (0-3) should be added to the description value to 
  12617. make up the value of the Flag parameter. 
  12618. RecFile is the data file the merge document is merged with. 
  12619. DescFile is the description file used when the data file is not an Ami Pro 
  12620. file. 
  12621. SelectionKey is a string or number to use in the selection of records to merge. 
  12622. The compare key is a string, if using an alphanumeric comparison, or a number, 
  12623. if using a numeric comparison. 
  12624. Operator is the operator to use in the selection comparison and can be one of 
  12625. the following values: 
  12626.     Equal (0) - The field's value must be equal to the key to merge. 
  12627.     LessThan (1) - The field's value must be less than the key to merge. 
  12628.     GreaterThan (2) - The field's value must be greater than the key to merge. 
  12629.     NotEqual (3) - The field's value must be different than the key to merge. 
  12630.     Lteq (4) - The field's value must be less than or equal to the key to 
  12631.     merge. 
  12632.     Gteq (5) - The field's value must be greater than or equal to the key to 
  12633.     merge. 
  12634. FieldNumber is the number of the field to use for this selection. It is zero 
  12635. based. To compare against the first field in the data file, set field number to 
  12636. 0. 
  12637. NextOp is a number that defines whether to select based on this criterion AND 
  12638. the next one, or this one OR the next one. If there are no more specifications 
  12639. this field should be zero. The values for this field are: 
  12640.     AndNext (1) - This selection AND the following selection must match to 
  12641.     merge this record. 
  12642.     OrNext (2) - This selection OR the following selection must match to merge 
  12643.     this record. 
  12644.  
  12645. To display the Merge dialog box and allow the user to set merge specifications: 
  12646. Merge 
  12647.  
  12648. Return Value 
  12649. 1  (TRUE) if the merge was completed. 
  12650. 0  (UserCancel) if the user canceled the function. 
  12651. -2  (GeneralFailure) if the merge failed. 
  12652.  
  12653. Example 
  12654. FUNCTION Example() 
  12655. docdir = GetDocPath$() 
  12656. datafile = "{docdir}mercdata.sam" 
  12657. descfile = "" 
  12658. 'configure mergefile for printing 
  12659. MergeMacro(24, datafile, descfile) 
  12660. 'do not actually print them; this associates the datafile 
  12661. MergeAction(mergestop) 
  12662. END FUNCTION 
  12663.  
  12664. See also: 
  12665.  
  12666.     MergeAction 
  12667.     Merge 
  12668.     MergeToFile 
  12669.  
  12670.  
  12671. ΓòÉΓòÉΓòÉ 287. MergeToFile ΓòÉΓòÉΓòÉ
  12672.  
  12673. This function merges a merge document with a data file and places the result in 
  12674. another file for later editing or printing. This function is equivalent to 
  12675. choosing File Merge, selecting option 3, choosing OK, and then selecting Merge 
  12676. & save as. 
  12677.  
  12678.  
  12679. Before using the merge function, your macro should ensure that the merge 
  12680. document you want to merge to is on the screen. 
  12681.  
  12682. Syntax 
  12683. MergeToFile(Flag, RecFile, OutFile[, DescFile][, SelectionKey, SelectionKey, 
  12684. Operator, FieldNumber, NextOp]...) 
  12685. Flag is a number that defines which optional parameters are used. The  flag 
  12686. parameter defines which of the optional parameters are used, according to the 
  12687. following list: 
  12688.     (0) - 0 selection criteria given 
  12689.     (1) - 1 selection criterion given 
  12690.     (2) - 2 selection criteria given 
  12691.     (3) - 3 selection criteria given 
  12692.     Description (8) - This merge uses a description file, and includes the 
  12693.     description filename 
  12694.     ToFile (32) - This merge is merged to a file 
  12695. The number of criteria used (0 - 3) must be added to the description value. 
  12696. Because this file merges, 32 must be added to this result to make up the value 
  12697. of the  flag parameter. 
  12698. RecFile is the data file the merge document is merged with. 
  12699. OutFile is the file to which the merged document is saved. 
  12700. DescFile is the description file used when the data file is not an Ami Pro 
  12701. file. 
  12702. SelectionKey is a string or number to use in the selection of records to merge. 
  12703. The compare key is a string, if using an alphanumeric comparison, or a number, 
  12704. if using a numeric comparison. 
  12705. Operator is the operator to use in the selection comparison and can be one of 
  12706. the following values: 
  12707.     Equal (0) - The field's value must be equal to the key to merge. 
  12708.     LessThan (1) - The field's value must be less than the key to merge. 
  12709.     GreaterThan (2) - The field's value must be greater than the key to merge. 
  12710.     NotEqual (3) - The field's value must be different than the key to merge. 
  12711.     Lteq (4) - The field's value must be less than or equal to the key to 
  12712.     merge. 
  12713.     Gteq (5) - The field's value must be greater than or equal to the key to 
  12714.     merge. 
  12715. FieldNumber is the number of the field to use for this selection. It is zero 
  12716. based. To compare against the first field in the data file, set field number to 
  12717. 0. 
  12718. NextOp is a number that defines whether to select based on this criterion AND 
  12719. the next one or this one OR the next one. If there are no more specifications, 
  12720. this field should be zero. The values for this field are: 
  12721.     AndNext (1) - This selection AND the following selection must match to 
  12722.     merge this record. 
  12723.     OrNext (2) - This selection OR the following selection must match to merge 
  12724.     this record. 
  12725.  
  12726. To display the Merge dialog box and allow the user to set merge specifications: 
  12727. Merge 
  12728.  
  12729. Return Value 
  12730. 0  (UserCancel) if the user canceled the function. 
  12731. -2  (GeneralFailure) if the merge failed. 
  12732.  
  12733. Example 
  12734. FUNCTION Example() 
  12735. MergeToFile(32 "mrgdata.SAM"  "output.SAM") 
  12736. END FUNCTION 
  12737.  
  12738. See also: 
  12739.  
  12740.     MergeAction 
  12741.     Merge 
  12742.     MergeMacro 
  12743.  
  12744.  
  12745. ΓòÉΓòÉΓòÉ 288. Message ΓòÉΓòÉΓòÉ
  12746.  
  12747. This function displays a message box with the specified title, prompt, and an 
  12748. OK push button. It waits for the user to acknowledge the message by selecting 
  12749. OK. You can use a message box to display information for the user. 
  12750.  
  12751.  
  12752. Syntax 
  12753. Message(Prompt[, Title]) 
  12754. Prompt is a string used as a prompt to the user. It can be a maximum of 80 
  12755. characters. 
  12756. Title is the title for the message box. The default is "Ami Pro Macro". 
  12757.  
  12758. Return Value 
  12759. This function does not return a value. 
  12760.  
  12761. Example 
  12762. FUNCTION Example() 
  12763. name = "Mark Olsen" 
  12764. Message("Hello, {name}.", "My Message") 
  12765. END FUNCTION 
  12766.  
  12767. See also: 
  12768.  
  12769.     Decide 
  12770.     DialogBox 
  12771.     Messages 
  12772.     Query$ 
  12773.     UserControl 
  12774.  
  12775.  
  12776. ΓòÉΓòÉΓòÉ 289. Messages ΓòÉΓòÉΓòÉ
  12777.  
  12778. This function allows you to determine whether the user should respond to 
  12779. certain program messages during macro execution. Many Ami Pro functions display 
  12780. message boxes asking the user to confirm an action before it is taken. If 
  12781. messages display is off, the macro forces Ami Pro to take the default action 
  12782. proposed by the message box (as if the user had pressed ENTER). If messages 
  12783. display is on, the message box displays, and the user needs to intervene before 
  12784. macro execution can continue. 
  12785.  
  12786.  
  12787. If a specific reply is required to a specific message, the AnswerMsgBox 
  12788. function must be used to reply to a specific function. 
  12789.  
  12790. Syntax 
  12791. Messages(State) 
  12792. State determines whether unexpected messages appear during macro execution. 
  12793.     On (1)  - Display the messages 
  12794.     Off (0) - Accept the default replies and not display the messages 
  12795.  
  12796. Return Value 
  12797. This function does not return a value. 
  12798.  
  12799. Example 
  12800. FUNCTION Example() 
  12801. Messages(Off) 
  12802. FileClose() 
  12803. Messages(On) 
  12804. END FUNCTION 
  12805.  
  12806. See also: 
  12807.  
  12808.     AnswerMsgBox 
  12809.     IgnoreKeyboard 
  12810.     SingleStep 
  12811.     UserControl 
  12812.  
  12813.  
  12814. ΓòÉΓòÉΓòÉ 290. MID ΓòÉΓòÉΓòÉ
  12815.  
  12816. This function is used to extract a portion of a string. 
  12817.  
  12818.  
  12819. Syntax 
  12820. MID$(Text, Offset, Length) 
  12821. Text is the string from which a shorter string is extracted. 
  12822. Offset is the location in the specified string to start parsing the new string. 
  12823. Offset is one based; to extract from the beginning of the longer string, use an 
  12824. offset of 1 or the function Left$. 
  12825. Length is the number of characters to extract out of the specified string. 
  12826.  
  12827. Return Value 
  12828. The requested text. 
  12829. The null string ("") if the starting offset is beyond the end of the larger 
  12830. string. 
  12831.  
  12832. Example 
  12833. FUNCTION Example() 
  12834. txt="Hello, my name is Susan Butler." 
  12835. newtext=MID$(txt, 7, 11) 
  12836. Message(newtext)  'returns "my name is" 
  12837. END FUNCTION 
  12838.  
  12839. See also: 
  12840.  
  12841.     ASC 
  12842.     CHR$ 
  12843.     FormatNum$ 
  12844.     LCASE$ 
  12845.     Left$ 
  12846.     LEN 
  12847.     strcat$ 
  12848.     strchr 
  12849.     strfield$ 
  12850.     UCASE$ 
  12851.  
  12852.  
  12853. ΓòÉΓòÉΓòÉ 291. Minimize ΓòÉΓòÉΓòÉ
  12854.  
  12855. This function minimizes the Ami Pro window by reducing it to an icon. This 
  12856. function is equivalent to choosing System Minimize. If the window is already 
  12857. reduced to an icon, executing this function restores the previous window size. 
  12858. When Ami Pro is minimized, macro execution continues in the background. 
  12859.  
  12860.  
  12861. Syntax 
  12862. Minimize() 
  12863.  
  12864. Return Value 
  12865. This function does not return a value. 
  12866.  
  12867. Example 
  12868. FUNCTION Example() 
  12869. Minimize() 
  12870. END FUNCTION 
  12871.  
  12872. See also: 
  12873.  
  12874.     Maximize 
  12875.     Restore 
  12876.  
  12877.  
  12878. ΓòÉΓòÉΓòÉ 292. Mod ΓòÉΓòÉΓòÉ
  12879.  
  12880. This function returns the remainder of the first parameter divided by the 
  12881. second. 
  12882.  
  12883.  
  12884. Syntax 
  12885. Mod(Numerator, Denominator) 
  12886. Numerator is the number to be divided. 
  12887. Denominator is the number to divide into the numerator. 
  12888.  
  12889. Return Value 
  12890. The remainder of the numerator divided by the denominator 
  12891. -2  (GeneralFailure) if the numbers could not be divided 
  12892.  
  12893. Example 
  12894. FUNCTION Example() 
  12895. Top = Query$("Enter the value for the numerator:") 
  12896. Bottom = Query$("Enter the value for the denominator:") 
  12897. Result = Mod(Top, Bottom) 
  12898. Message(Result) 
  12899. END FUNCTION 
  12900.  
  12901. See also: 
  12902.  
  12903.     IsNumeric 
  12904.     Round 
  12905.  
  12906.  
  12907. ΓòÉΓòÉΓòÉ 293. ModifyAlignment ΓòÉΓòÉΓòÉ
  12908.  
  12909. This function modifies paragraph style alignment options. This function is 
  12910. equivalent to choosing Style Modify Style and choosing Alignment. 
  12911.  
  12912.  
  12913. ModifySelect should be called before this function to define the style to 
  12914. modify. 
  12915.  
  12916. Before the new alignment options take effect for the selected paragraph style, 
  12917. the ModifyReflow function should be called in the macro. 
  12918.  
  12919. Syntax 
  12920. ModifyAlignment(Options, AllLevel, FirstLevel, RestLevel, 0, RightIndent) 
  12921. Options is a flag parameter containing the paragraph style's alignment options. 
  12922. Set the Options parameter to one or more of the following options: 
  12923.     AlignLeft (1) - Left align the paragraph 
  12924.     AlignRight (2) - Right align the paragraph 
  12925.     AlignCenter (4) - Center the paragraph 
  12926.     AlignJustify (8) - Justify the paragraph 
  12927.     IndentBoth (16) - Indent both sides of the paragraph 
  12928.     NoIndentAll (32) - Do not use entire paragraph indention option 
  12929.     NoIndentFirst (64) - Do not use first line indention option 
  12930.     NoIndentRest (128) - Do not use rest of lines indention options 
  12931.     HangingIndent (512) - This paragraph has a hanging indent 
  12932. One of the four alignment options should always be chosen. Multiple options 
  12933. should be added together before they are passed to the function. All levels are 
  12934. in twips (1 inch = 1440 twips). 
  12935. AllLevel is the level to indent all lines in the paragraph. This parameter is 
  12936. ignored if the NoIndentAll flag is set. 
  12937. FirstLevel is the level to indent the first line of the paragraph. This 
  12938. parameter is ignored if the NoIndentFirst flag is set. 
  12939. RestLevel is the level to indent the rest of the lines in the paragraph. This 
  12940. parameter is ignored if the NoIndentRest flag is set. 
  12941. RightIndent is the level to indent all lines in the paragraph from the right. 
  12942. This parameter is ignored if the NoIndentRest flag is set. 
  12943.  
  12944. To display the Modify Style dialog box and allow the user to select the options 
  12945. for modifying paragraph styles: ModifyStyle 
  12946.  
  12947. To modify the tabs used when modifying the style, refer to the ModifyBreaks 
  12948. function. 
  12949.  
  12950. Return Value 
  12951. 1  (TRUE) if the alignment options were set. 
  12952. 0  (UserCancel) if the user canceled the function. 
  12953. -2  (GeneralFailure) if the options were not set. 
  12954.  
  12955. Example 
  12956. FUNCTION Example() 
  12957. NewName = Query$("What do you want to name the new style?", "TestStyle") 
  12958. BaseName = GetStyleName$() 
  12959. CreateStyle(NewName, BaseName, 0) 
  12960. ModifySelect(NewName) 
  12961. ModifyAlignment(AlignLeft, 0, 0, 0, 0, 0) 
  12962. ModifyBreaks(4, 0, 0) 
  12963. ModifyEffects("<#1>", 1, 1440, UpperCase, 0, 16) 
  12964. ModifySpacing(2, 0, 0, 0, 90, 0, 0) 
  12965. ModifyTable(3, 2, ".", ",", "$", (8 + 16 + 128 + 256)) 
  12966. ModifyLines(1, 2, 180, 0, 0, 1440, 65535, 0) 
  12967. ModifyFont("Times New Roman", (20 * 20), 255, UpperCase) 
  12968. SetStyle(NewName) 
  12969. ModifyReflow() 
  12970. TYPE("This[Enter]is what the new[Enter]style looks[Enter]Like...[Enter]") 
  12971. SetStyle(BaseName) 
  12972. END FUNCTION 
  12973.  
  12974. See also: 
  12975.  
  12976.     CreateStyle 
  12977.     DefineStyle 
  12978.     ModifyBreaks 
  12979.     ModifyEffects 
  12980.     ModifyFont 
  12981.     ModifyLines 
  12982.     ModifyReflow 
  12983.     ModifySelect 
  12984.     ModifySpacing 
  12985.     ModifyStyle 
  12986.     ModifyTable 
  12987.  
  12988.  
  12989. ΓòÉΓòÉΓòÉ 294. ModifyBreaks ΓòÉΓòÉΓòÉ
  12990.  
  12991. This function modifies paragraph style page break options. This function is 
  12992. equivalent to choosing Style Modify Style and choosing Breaks. 
  12993.  
  12994.  
  12995. ModifySelect should be called before this function to define the style to 
  12996. modify. 
  12997.  
  12998. Before the new page break options take effect for the selected paragraph style, 
  12999. the ModifyReflow function must be called in the macro. 
  13000.  
  13001. Syntax 
  13002. ModifyBreaks(Options, Style, NumTabs[, Type, Offset]) 
  13003. Options is a flag parameter specifying the break options. Set the Options 
  13004. parameter to one or more of the following options: 
  13005.     NoBreaks (0) - Do not allow page breaks within this paragraph 
  13006.     PageBreakBefore (1) - Put a page break before this paragraph 
  13007.     PageBreakAfter (2) - Put a page break following this paragraph 
  13008.     BreakWithin (4) - Allow page breaks within the paragraph 
  13009.     KeepPrevious (8) - Keep this paragraph with the previous paragraph 
  13010.     KeepNext (16) - Keep this paragraph with the next paragraph 
  13011.     UseStyleTabs (32) - Selects Use style tabs for the specified paragraph 
  13012.     style 
  13013.     (64) - If set, the style defined in the Style parameter is applied to the 
  13014.     next paragraph 
  13015.     ColBreakBefore (128) - Put a column break before this paragraph 
  13016.     ColBreakAfter (256) - Put a column break after this paragraph 
  13017. One of the four break options should always be chosen. The KeepPrevious option 
  13018. may be chosen if the NoBreak, PageBreakAfter, or ColBreakAfter option is 
  13019. chosen. The KeepNext option may be chosen if the NoBreak, PageBreakBefore, or 
  13020. ColBreakBefore option is chosen. 
  13021. Style is the paragraph style to use for the next paragraph. The next style (64) 
  13022. option must also be set in order to apply this paragraph style. 
  13023. NumTabs specifies the number of tabs settings that follow. 
  13024. You must enter a Type and Offset for each tab. 
  13025. Type is the type of tab. The Offset parameter must also be used for each tab. 
  13026.     TabLeft (1) - Left tab 
  13027.     TabCenter (2) - Center tab 
  13028.     TabRight (3) - Right tab 
  13029.     TabNumeric (4) - Numeric tab 
  13030. To display leaders preceding the tab, add one of the following values to the 
  13031. type of tab: 
  13032.     TabHyph (16384) - Displays hyphens 
  13033.     TabDot (32768) - Displays dots 
  13034.     TabLine (49152) - Displays a line 
  13035. Offset is the distance of the tab from the left margin and must be given in 
  13036. twips (1 inch = 1440 twips). The Type parameter must be used for each tab. 
  13037.  
  13038. To display the Modify Style dialog box and allow the user to select the options 
  13039. for modifying paragraph styles: ModifyStyle 
  13040.  
  13041. Return Value 
  13042. 1  (TRUE) if the break options were set. 
  13043. 0  (UserCancel) if the user canceled the function. 
  13044. -2  (GeneralFailure) if the options were not set. 
  13045.  
  13046. Example 
  13047. FUNCTION Example() 
  13048. NewName = Query$("What do you want to name the new style?", "TestStyle") 
  13049. BaseName = GetStyleName$() 
  13050. CreateStyle(NewName, BaseName, 0) 
  13051. ModifySelect(NewName) 
  13052. ModifyAlignment(AlignLeft, 0, 0, 0, 0, 0) 
  13053. ModifyBreaks(4, 0, 0) 
  13054. ModifyEffects("<#1>", 1, 1440, UpperCase, 0, 16, 0) 
  13055. ModifySpacing(2, 0, 0, 0, 90, 0, 0) 
  13056. ModifyTable(3, 2, ".", ",", "$", (8 + 16 + 128 + 256)) 
  13057. ModifyLines(1, 2, 180, 0, 0, 1440, 65535, 0) 
  13058. ModifyFont("Times New Roman", (20 * 20), 255, UpperCase) 
  13059. SetStyle(NewName) 
  13060. ModifyReflow() 
  13061. TYPE("This[Enter]is what the new[Enter]style looks[Enter]Like...[Enter]") 
  13062. SetStyle(BaseName) 
  13063. END FUNCTION 
  13064.  
  13065. See also: 
  13066.  
  13067.     CreateStyle 
  13068.     DefineStyle 
  13069.     ModifyAlignment 
  13070.     ModifyEffects 
  13071.     ModifyFont 
  13072.     ModifyLines 
  13073.     ModifyReflow 
  13074.     ModifySelect 
  13075.     ModifySpacing 
  13076.     ModifyStyle 
  13077.     ModifyTable 
  13078.  
  13079.  
  13080. ΓòÉΓòÉΓòÉ 295. ModifyEffects ΓòÉΓòÉΓòÉ
  13081.  
  13082. This function modifies paragraph style bullets and numbers. This function is 
  13083. equivalent to choosing Style Modify Style and choosing Bullets/Numbers. 
  13084.  
  13085.  
  13086. ModifySelect should be called before this function to define the style to 
  13087. modify. 
  13088.  
  13089. Before the new bullets and numbering options take effect for the selected 
  13090. paragraph style, the ModifyReflow function must be called in the macro. 
  13091.  
  13092. Syntax 
  13093. ModifyEffects(Text, Spacing, Indent, Attr, LevelNum, Align, 0) 
  13094. Text is the leading text for the paragraph. The Text parameter specifies the 
  13095. text, bullet, or numbers that precede each paragraph using this paragraph 
  13096. style. The text must be typed as it would appear in the edit box in the 
  13097. Bullets/Numbers panel in the Modify Style dialog box. Bullets can be inserted 
  13098. by typing the following text where the bullet should be placed: 
  13099.     <Γòû1> - Small  Round Bullet 
  13100.     <Γòû2> - Large  Round Bullet 
  13101.     <Γòû3> - Small  Square Bullet 
  13102.     <Γòû4> - Large  Square Bullet 
  13103.     <Γòû5> - Large  Outline Square Bullet 
  13104.     <Γòû6> - Small  Diamond Bullet 
  13105.     <Γòû7> - Large  Diamond Bullet 
  13106.     <Γòû8> - Small  Open Circle Bullet 
  13107.     <Γòû9> - Large  Open Circle Bullet 
  13108.     <Γòû10> - Check  Mark 
  13109.     <Γòû11> - Tack 
  13110.     <Γòû12> - Square shadow below bullet 
  13111.     <Γòû13> - Square shadow above bullet 
  13112.     <Γòû14> - Check box 
  13113.     <Γòû15> - Square with X bullet 
  13114.     <Γòû16> - Rounded arrowhead top shaded 
  13115.     <Γòû17> - Rounded arrowhead bottom shaded 
  13116. To type the dot in front of the bullet number, turn on Num Lock, hold the ALT 
  13117. key, type 0183 and release the ALT key. 
  13118. Numbers can be inserted by typing the following text where the number should be 
  13119. inserted: 
  13120.     <#1> - 1 2 3 4 5... 
  13121.     <#2> - A B C D E... 
  13122.     <#3> - a b c d e... 
  13123.     <#4> - I II III IV V... 
  13124.     <#5> - i ii iii iv v... 
  13125.     <#6> - * ** *** ****... 
  13126. Spacing is a flag indicating how to space between the text and the paragraph 
  13127. body. The Spacing parameter should be set to one of the following options: 
  13128.     TabIndent (0) - Separate leading text from body with a tab 
  13129.     SpaceIndent (1) - Separate leading text from body with the space specified 
  13130.     in the Indent parameter 
  13131. Indent is the amount of space to use between the text and the paragraph body. 
  13132. The SpaceIndent option should be set for this spacing to be used. 
  13133. The amount of indention must be given in twips (1 inch = 1440 twips). 
  13134. The right alignment option must have enough indention space to line up on the 
  13135. right. For example, when using asterisks, there must be enough space to line up 
  13136. on the rightmost asterisk. 
  13137. Attr is a flag parameter specifying the attribute options for the leading text 
  13138. and can be one of the following: 
  13139.     NormalAttr (0) - Text has no attributes 
  13140.     BoldText (4) - Bold text 
  13141.     ItalicText (8) - Italicized text 
  13142.     UnderlineText (16) - Underlined text 
  13143.     WordUnderlineText (32) - Word underlined text 
  13144.     UpperCase (2048) - Capitalized text 
  13145.     SuperScript (64) - Superscripted text 
  13146. Multiple attributes can be added together. Not all fonts have all attributes 
  13147. and the underline attributes cannot be combined. 
  13148. LevelNum is the outlining level number to use and should be a number from 0 to 
  13149. 9. If this is not an outline style, this option should be set to 0. 
  13150. Align is a flag determining whether to right align the text in the special 
  13151. effect and can be one of the following: 
  13152.     (0) - Do not right align 
  13153.     (16) - Right align 
  13154.  
  13155. To display the Modify Style dialog box and allow the user to select the options 
  13156. for modifying paragraph styles: ModifyStyle 
  13157.  
  13158. Return Value 
  13159. 1  (TRUE) if the effects options were set. 
  13160. 0  (UserCancel) if the user canceled the function. 
  13161. -2  (GeneralFailure) if the options were not set. 
  13162.  
  13163. Example 
  13164. FUNCTION Example() 
  13165. NewName = Query$("What do you want to name the new style?", "TestStyle") 
  13166. BaseName = GetStyleName$() 
  13167. CreateStyle(NewName, BaseName, 0) 
  13168. ModifySelect(NewName) 
  13169. ModifyAlignment(AlignLeft, 0, 0, 0, 0, 0) 
  13170. ModifyBreaks(4, 0, 0) 
  13171. ModifyEffects("<#1>", 1, 1440, UpperCase, 0, 16, 0) 
  13172. ModifySpacing(2, 0, 0, 0, 90, 0, 0) 
  13173. ModifyTable(3, 2, ".", ",", "$", (8 + 16 + 128 + 256)) 
  13174. ModifyLines(1, 2, 180, 0, 0, 1440, 65535, 0) 
  13175. ModifyFont("Times New Roman", (20 * 20), 255, UpperCase) 
  13176. SetStyle(NewName) 
  13177. ModifyReflow() 
  13178. TYPE("This[Enter]is what the new[Enter]style looks[Enter]Like...[Enter]") 
  13179. SetStyle(BaseName) 
  13180. END FUNCTION 
  13181.  
  13182. See also: 
  13183.  
  13184.     CreateStyle 
  13185.     DefineStyle 
  13186.     ModifyAlignment 
  13187.     ModifyBreaks 
  13188.     ModifyFont 
  13189.     ModifyLines 
  13190.     ModifyReflow 
  13191.     ModifySelect 
  13192.     ModifySpacing 
  13193.     ModifyStyle 
  13194.     ModifyTable 
  13195.  
  13196.  
  13197. ΓòÉΓòÉΓòÉ 296. ModifyFont ΓòÉΓòÉΓòÉ
  13198.  
  13199. This function modifies paragraph style font. This function is equivalent to 
  13200. choosing Style Modify Style and choosing Font. Through the menu commands, the 
  13201. user can only select from the fonts available on the printer. Using the macro 
  13202. commands, any type of font can be requested. 
  13203.  
  13204.  
  13205. ModifySelect should be called before this function to define the style to 
  13206. modify. 
  13207.  
  13208. Before the new font options take effect for the selected paragraph style, the 
  13209. ModifyReflow function must be called in the macro. 
  13210.  
  13211. Syntax 
  13212. ModifyFont(FontName, Size, Color, Options) 
  13213. FontName is the name of the font as listed in the Face list box. 
  13214. Size is the size of the font, in twips. The formula for finding the proper 
  13215. point size is pointsize * 20 = twips. 
  13216. Color is the color of the font and can be one of the following: 
  13217.     White (16777215) - White 
  13218.     Cyan (16776960) - Light blue 
  13219.     Yellow (65535) - Yellow 
  13220.     Magenta (16711935) - Purple 
  13221.     Green (65280) - Green 
  13222.     Red (255) - Red 
  13223.     Blue (16711680) - Blue 
  13224.     Black (0) - Black 
  13225. Options is a flag parameter specifying the attribute options and can be one or 
  13226. more of the following: 
  13227.     NormalAttr (0) - Text has no attributes 
  13228.     BoldText (4) - Bold text 
  13229.     ItalicText (8) - Italicized text 
  13230.     UnderlineText (16) - Underlined text 
  13231.     WordUnderlineText (32) - Word underlined text 
  13232.     UpperCase (2048) - All caps text 
  13233.     DoubleLineAttr (256) - Double underline text 
  13234.     VarPitch (1) - Variable pitch font 
  13235.     Serifs (1024) - Serifs in font 
  13236. Multiple attributes can be added together. Not all the fonts have all the 
  13237. attributes and some attributes, such as the caps attributes and the underline 
  13238. attributes, cannot be combined. 
  13239.  
  13240. To display the Modify Style dialog box and allow the user to select the options 
  13241. for modifying paragraph styles: ModifyStyle 
  13242.  
  13243. Return Value 
  13244. 1  (TRUE) if the font options were set. 
  13245. -2  (GeneralFailure) if the options were not set. 
  13246.  
  13247. Example 
  13248. FUNCTION Example() 
  13249. NewName = Query$("What do you want to name the new style?", "TestStyle") 
  13250. BaseName = GetStyleName$() 
  13251. CreateStyle(NewName, BaseName, 0) 
  13252. ModifySelect(NewName) 
  13253. ModifyAlignment(AlignLeft, 0, 0, 0, 0, 0) 
  13254. ModifyBreaks(4, 0, 0) 
  13255. ModifyEffects("<#1>", 1, 1440, UpperCase, 0, 16, 0) 
  13256. ModifySpacing(2, 0, 0, 0, 90, 0, 0) 
  13257. ModifyTable(3, 2, ".", ",", "$", (8 + 16 + 128 + 256)) 
  13258. ModifyLines(1, 2, 180, 0, 0, 1440, 65535, 0) 
  13259. ModifyFont("Times New Roman", (20 * 20), 255, UpperCase) 
  13260. SetStyle(NewName) 
  13261. ModifyReflow() 
  13262. TYPE("This[Enter]is what the new[Enter]style looks[Enter]Like...[Enter]") 
  13263. SetStyle(BaseName) 
  13264. END FUNCTION 
  13265.  
  13266. See also: 
  13267.  
  13268.     CreateStyle 
  13269.     DefineStyle 
  13270.     ModifyAlignment 
  13271.     ModifyBreaks 
  13272.     ModifyEffects 
  13273.     ModifyLines 
  13274.     ModifyReflow 
  13275.     ModifySelect 
  13276.     ModifySpacing 
  13277.     ModifyStyle 
  13278.     ModifyTable 
  13279.  
  13280.  
  13281.  
  13282. ΓòÉΓòÉΓòÉ 297. ModifyLayout ΓòÉΓòÉΓòÉ
  13283.  
  13284. This function displays the Modify Page Layout dialog box. This function is 
  13285. equivalent to choosing Page Modify Page and choosing Layout. This function does 
  13286. not automatically modify the page layout. 
  13287.  
  13288.  
  13289. You must be in Layout Mode to use this function. 
  13290.  
  13291. Syntax 
  13292. ModifyLayout() 
  13293.  
  13294. Return Value 
  13295. 1  (TRUE) if the page layout was modified. 
  13296. 0  (UserCancel) if the user canceled the function. 
  13297. -2  (GeneralFailure) if the layout was not modified. 
  13298.  
  13299. Example 
  13300. FUNCTION Example() 
  13301. ModifyLayout() 
  13302. END FUNCTION 
  13303.  
  13304. See also: 
  13305.  
  13306.     ModLayoutFinish 
  13307.     ModLayoutInit 
  13308.     ModLayoutLeftFooter 
  13309.     ModLayoutLeftHeader 
  13310.     ModLayoutLeftLines 
  13311.     ModLayoutLeftPage 
  13312.     ModLayoutPageSize 
  13313.     ModLayoutRightFooter 
  13314.     ModLayoutRightHeader 
  13315.     ModLayoutRightLines 
  13316.     ModLayoutRightPage 
  13317.  
  13318.  
  13319.  
  13320. ΓòÉΓòÉΓòÉ 298. ModifyLines ΓòÉΓòÉΓòÉ
  13321.  
  13322. This function modifies paragraph style lines. This function is equivalent to 
  13323. choosing Style Modify Style and choosing Lines. 
  13324.  
  13325.  
  13326. ModifySelect should be called before this function to define the style to 
  13327. modify. 
  13328.  
  13329. Before the new line options take effect for the selected paragraph style, the 
  13330. ModifyReflow function must be called in the macro. 
  13331.  
  13332. Syntax 
  13333. ModifyLines(Options, StyleAbove, SpaceAbove, StyleBelow, SpaceBelow, Length, 
  13334. Color, 0) 
  13335. Options is a flag parameter specifying the line options. The Options parameter 
  13336. consists of one or more of the following options: 
  13337.     Off (0) - No lines above or below 
  13338.     LineAbove (1) - Put a line above the paragraph 
  13339.     LineBelow (2) - Put a line below the paragraph 
  13340.     LengthOfText (4) - Line is the length of the text 
  13341.     LengthMargins (8) - Line is the length of the margins 
  13342.     LengthCustom (16) - Line's length is determined by the  length parameter 
  13343. StyleAbove and StyleBelow determine the type of line to print above and below 
  13344. the paragraph, respectively. Available line styles are: 
  13345.     Hairline (1) - Hairline 
  13346.     OnePoint (2) - One point rule 
  13347.     TwoPoint (3) - Two point rule 
  13348.     ThreePoint (4) - Three point rule 
  13349.     FourPoint (5) - Four point rule 
  13350.     FivePoint (6) - Five point rule 
  13351.     SixPoint (7) - Six point rule 
  13352.     DoubleOnePoint (8) - Parallel one point rules 
  13353.     DoubleTwoPoint (9) - Parallel two point rules 
  13354.     ThreeLines (10) - Hairline above and below a two point rule 
  13355.     HairBelow (11) - Hairline below a three point rule 
  13356.     HairAbove (12) - Hairline above a three point rule 
  13357. SpaceAbove is the spacing between the font and the line above the text, in 
  13358. twips. If none, use 0 for this parameter. 
  13359. SpaceBelow is the spacing between the font and the line below the text, in 
  13360. twips. If none, use 0 for this parameter. 
  13361. Length is the length of the line, in twips, if a custom length. 
  13362. Color is the color of the line and can be one of the following: 
  13363.     White (16777215) - White 
  13364.     Cyan (16776960) - Light blue 
  13365.     Yellow (65535) - Yellow 
  13366.     Magenta (16711935) - Purple 
  13367.     Green (65280) - Green 
  13368.     Red (255) - Red 
  13369.     Blue (16711680) - Blue 
  13370.     Black (0) - Black 
  13371.     DarkGray (12566463) - 90% gray scale 
  13372.     MediumGray (8355711) - 50% gray scale 
  13373.     LightGray (4144959) - 20% gray scale 
  13374.     VeryLightGray (1644825) - 10% gray scale 
  13375.  
  13376. To display the Modify Style dialog box and allow the user to select the options 
  13377. for modifying paragraph styles: ModifyStyle 
  13378.  
  13379. Return Value 
  13380. 1  (TRUE) if the line options were set. 
  13381. -2  (GeneralFailure) if the options were not set. 
  13382.  
  13383. Example 
  13384. FUNCTION Example() 
  13385. NewName = Query$("What do you want to name the new style?", "TestStyle") 
  13386. BaseName = GetStyleName$() 
  13387. CreateStyle(NewName, BaseName, 0) 
  13388. ModifySelect(NewName) 
  13389. ModifyAlignment(AlignLeft, 0, 0, 0, 0, 0) 
  13390. ModifyBreaks(4, 0, 0) 
  13391. ModifyEffects("<#1>", 1, 1440, UpperCase, 0, 16, 0) 
  13392. ModifySpacing(2, 0, 0, 0, 90, 0, 0) 
  13393. ModifyTable(3, 2, ".", ",", "$", (8 + 16 + 128 + 256)) 
  13394. ModifyLines(1, 2, 180, 0, 0, 1440, 65535, 0) 
  13395. ModifyFont("Times New Roman", (20 * 20), 255, UpperCase) 
  13396. SetStyle(NewName) 
  13397. ModifyReflow() 
  13398. TYPE("This[Enter]is what the new[Enter]style looks[Enter]Like...[Enter]") 
  13399. SetStyle(BaseName) 
  13400. END FUNCTION 
  13401.  
  13402. See also: 
  13403.  
  13404.     CreateStyle 
  13405.     DefineStyle 
  13406.     ModifyAlignment 
  13407.     ModifyBreaks 
  13408.     ModifyEffects 
  13409.     ModifyFont 
  13410.     ModifyReflow 
  13411.     ModifySelect 
  13412.     ModifySpacing 
  13413.     ModifyStyle 
  13414.     ModifyTable 
  13415.  
  13416.  
  13417.  
  13418.  
  13419. ΓòÉΓòÉΓòÉ 299. ModifyReflow ΓòÉΓòÉΓòÉ
  13420.  
  13421. This function applies changes that have been made to paragraph styles using the 
  13422. other modify paragraph style functions. This function should be called after 
  13423. using the modify paragraph style functions and before editing other text. This 
  13424. function is equivalent to choosing Style Modify Style. 
  13425.  
  13426.  
  13427. This function should be called after using other modify paragraph style 
  13428. functions. 
  13429.  
  13430. Syntax 
  13431. ModifyReflow() 
  13432.  
  13433. Return Value 
  13434. 1  (TRUE) if the changed paragraph styles were applied. 
  13435. -2  (GeneralFailure) if the paragraph styles were not applied. 
  13436.  
  13437. Example 
  13438. FUNCTION Example() 
  13439. NewName = Query$("What do you want to name the new style?", "TestStyle") 
  13440. BaseName = GetStyleName$() 
  13441. CreateStyle(NewName, BaseName, 0) 
  13442. ModifySelect(NewName) 
  13443. ModifyAlignment(AlignLeft, 0, 0, 0, 0, 0) 
  13444. ModifyBreaks(4, 0, 0) 
  13445. ModifyEffects("<#1>", 1, 1440, UpperCase, 0, 16, 0) 
  13446. ModifySpacing(2, 0, 0, 0, 90, 0, 0) 
  13447. ModifyTable(3, 2, ".", ",", "$", (8 + 16 + 128 + 256)) 
  13448. ModifyLines(1, 2, 180, 0, 0, 1440, 65535, 0) 
  13449. ModifyFont("Times New Roman", (20 * 20), 255, UpperCase) 
  13450. SetStyle(NewName) 
  13451. ModifyReflow() 
  13452. TYPE("This[Enter]is what the new[Enter]style looks[Enter]Like...[Enter]") 
  13453. SetStyle(BaseName) 
  13454. END FUNCTION 
  13455.  
  13456. See also: 
  13457.  
  13458.     CreateStyle 
  13459.     DefineStyle 
  13460.     ModifyAlignment 
  13461.     ModifyBreaks 
  13462.     ModifyEffects 
  13463.     ModifyFont 
  13464.     ModifyLines 
  13465.     ModifySelect 
  13466.     ModifySpacing 
  13467.     ModifyStyle 
  13468.     ModifyTable 
  13469.  
  13470.  
  13471.  
  13472.  
  13473.  
  13474. ΓòÉΓòÉΓòÉ 300. ModifySelect ΓòÉΓòÉΓòÉ
  13475.  
  13476. This function selects a paragraph style to modify. The other  Modify  Paragraph 
  13477. Style functions act on the paragraph style selected by this function. This 
  13478. function is the equivalent to choosing Style Select a Style. 
  13479.  
  13480.  
  13481. This function should be called prior to using other modify paragraph style 
  13482. functions. 
  13483.  
  13484. Syntax 
  13485. ModifySelect(Style) 
  13486. Style is the name of an existing paragraph style. 
  13487.  
  13488. To display the Modify Style dialog box and allow the user to select the options 
  13489. for modifying paragraph styles: ModifyStyle 
  13490.  
  13491. Return Value 
  13492. 1  (TRUE) if the paragraph style was selected. 
  13493. -2  (GeneralFailure) if the paragraph style was not selected. 
  13494.  
  13495. Example 
  13496. FUNCTION Example() 
  13497. NewName = Query$("What do you want to name the new style?", "TestStyle") 
  13498. BaseName = GetStyleName$() 
  13499. CreateStyle(NewName, BaseName, 0) 
  13500. ModifySelect(NewName) 
  13501. ModifyAlignment(AlignLeft, 0, 0, 0, 0, 0) 
  13502. ModifyBreaks(4, 0, 0) 
  13503. ModifyEffects("<#1>", 1, 1440, UpperCase, 0, 16, 0) 
  13504. ModifySpacing(2, 0, 0, 0, 90, 0, 0) 
  13505. ModifyTable(3, 2, ".", ",", "$", (8 + 16 + 128 + 256)) 
  13506. ModifyLines(1, 2, 180, 0, 0, 1440, 65535, 0) 
  13507. ModifyFont("Times New Roman", (20 * 20), 255, UpperCase) 
  13508. SetStyle(NewName) 
  13509. ModifyReflow() 
  13510. TYPE("This[Enter]is what the new[Enter]style looks[Enter]Like...[Enter]") 
  13511. SetStyle(BaseName) 
  13512. END FUNCTION 
  13513.  
  13514. See also: 
  13515.  
  13516.     CreateStyle 
  13517.     DefineStyle 
  13518.     ModifyAlignment 
  13519.     ModifyBreaks 
  13520.     ModifyEffects 
  13521.     ModifyFont 
  13522.     ModifyLines 
  13523.     ModifyReflow 
  13524.     ModifySpacing 
  13525.     ModifyStyle 
  13526.     ModifyTable 
  13527.  
  13528.  
  13529. ΓòÉΓòÉΓòÉ 301. ModifySpacing ΓòÉΓòÉΓòÉ
  13530.  
  13531. This function modifies paragraph style spacing. This function is equivalent to 
  13532. choosing Style Modify Style and choosing Spacing. 
  13533.  
  13534.  
  13535. ModifySelect should be called before this function to define the style to 
  13536. modify. 
  13537.  
  13538. Before the new spacing options take effect for the selected paragraph style, 
  13539. the ModifyReflow function must be called in the macro. 
  13540.  
  13541. Syntax 
  13542. ModifySpacing(Options, Amount, ParaAbove, ParaBelow, Tightness, 0, 0) 
  13543. Options is a flag parameter with spacing options. The  options parameter should 
  13544. be set to one of the following options: 
  13545.     SingleSpacing (1) - Use single line spacing 
  13546.     OneOneHalfSpacing (2) - One and one half line spacing 
  13547.     DoubleSpacing (4) - Double line spacing 
  13548.     CustomSpacing (8) - Custom line spacing 
  13549.     AddAlways (16) - Always use line above spacing 
  13550.     AddNotBreak (32) - Use line above spacing only if not at page break 
  13551. Amount is the line spacing to use if custom spacing is selected. 
  13552. ParaAbove is the spacing to use above the paragraph, in twips (1 inch = 1440 
  13553. twips). 
  13554. ParaBelow is the spacing to use below the paragraph, in twips (1 inch = 1440 
  13555. twips). 
  13556. Tightness is the line tightness factor to use and can be one of the following: 
  13557.     TightLines (90) - 90% line tightness 
  13558.     NormalLines (100) - 100% line tightness (normal) 
  13559.     LooseLines (115) - 115% line tightness 
  13560.  
  13561. To display the Modify Style dialog box and allow the user to select the options 
  13562. for modifying paragraph styles: ModifyStyle 
  13563.  
  13564. Return Value 
  13565. 1  (TRUE) if the spacing was set. 
  13566. -2  (GeneralFailure) if the spacing was not set. 
  13567.  
  13568. Example 
  13569. FUNCTION Example() 
  13570. NewName = Query$("What do you want to name the new style?", "TestStyle") 
  13571. BaseName = GetStyleName$() 
  13572. CreateStyle(NewName, BaseName, 0) 
  13573. ModifySelect(NewName) 
  13574. ModifyAlignment(AlignLeft, 0, 0, 0, 0, 0) 
  13575. ModifyBreaks(4, 0, 0) 
  13576. ModifyEffects("<#1>", 1, 1440, UpperCase, 0, 16, 0) 
  13577. ModifySpacing(2, 0, 0, 0, 90, 0, 0) 
  13578. ModifyTable(3, 2, ".", ",", "$", (8 + 16 + 128 + 256)) 
  13579. ModifyLines(1, 2, 180, 0, 0, 1440, 65535, 0) 
  13580. ModifyFont("Times New Roman", (20 * 20), 255, UpperCase) 
  13581. SetStyle(NewName) 
  13582. ModifyReflow() 
  13583. TYPE("This[Enter]is what the new[Enter]style looks[Enter]Like...[Enter]") 
  13584. SetStyle(BaseName) 
  13585. END FUNCTION 
  13586.  
  13587. See also: 
  13588.  
  13589.     CreateStyle 
  13590.     DefineStyle 
  13591.     ModifyAlignment 
  13592.     ModifyBreaks 
  13593.     ModifyEffects 
  13594.     ModifyFont 
  13595.     ModifyLines 
  13596.     ModifyReflow 
  13597.     ModifySelect 
  13598.     ModifyStyle 
  13599.     ModifyTable 
  13600.  
  13601.  
  13602. ΓòÉΓòÉΓòÉ 302. ModifyStyle ΓòÉΓòÉΓòÉ
  13603.  
  13604. This function displays the Modify Style dialog box. This function is equivalent 
  13605. to choosing Style Modify Style, but it cannot automatically modify a paragraph 
  13606. style. To allow the macro to modify paragraph styles directly, use the other 
  13607. modify paragraph style functions. 
  13608.  
  13609.  
  13610. Syntax 
  13611. ModifyStyle() 
  13612.  
  13613. Return Value 
  13614. 1  (TRUE) if the paragraph style was modified. 
  13615. 0  (UserCancel) if the user canceled the function. 
  13616. -2  (GeneralFailure) if the paragraph style could not be modified. 
  13617.  
  13618. Example 
  13619. FUNCTION Example() 
  13620. ModifyStyle() 
  13621. END FUNCTION 
  13622.  
  13623. See also: 
  13624.  
  13625.     CreateStyle 
  13626.     DefineStyle 
  13627.     GetStyleName$ 
  13628.     ModifyAlignment 
  13629.     ModifyBreaks 
  13630.     ModifyEffects 
  13631.     ModifyFont 
  13632.     ModifyLines 
  13633.     ModifyReflow 
  13634.     ModifySelect 
  13635.     ModifySpacing 
  13636.     ModifyTable 
  13637.  
  13638.  
  13639. ΓòÉΓòÉΓòÉ 303. ModifyTable ΓòÉΓòÉΓòÉ
  13640.  
  13641. This function modifies paragraph style table format. This function is 
  13642. equivalent to choosing Style Modify Style and choosing Table. 
  13643.  
  13644.  
  13645. ModifySelect should be called before this function to define the style to 
  13646. modify. 
  13647.  
  13648. Before the new table format options take effect for the selected paragraph 
  13649. style, the ModifyReflow function must be called in the macro. 
  13650.  
  13651. Syntax 
  13652. ModifyTable(CellFormat, Decimals, DecimalPoint, Separator, CurrencySymbol, 
  13653. Options) 
  13654. CellFormat determines the cell format and can be one of the following: 
  13655.     GeneralFormat (1) - Show decimals only if required 
  13656.     FixedFormat (2) - Show a fixed number of decimals 
  13657.     CurrencyFormat (3) - Show the currency symbol 
  13658.     PercentFormat (4) - Display the number with a percent sign 
  13659. Decimals is the number of decimal places to display for numbers. 
  13660. DecimalPoint is the character to use for the decimal point. 
  13661. Separator is the character to use as the thousands separator. 
  13662. CurrencySymbol is the character to use for the currency symbol. 
  13663. Options is a flag parameter with table format options and can be one of the 
  13664. following: 
  13665.     ThousandsSep (8) - Use thousands separator character. The 
  13666.     ThousandsSeparator option should be set if thousands separators are to 
  13667.     display and print. 
  13668.     LeadingNegative (16) - Use leading minus to indicate negative numbers 
  13669.     TrailingNegative (32) - Use trailing minus to indicate negative numbers 
  13670.     ParenthesesNegative (64) - Use parentheses to indicate negative numbers 
  13671.     RedNegative (128) - Negative numbers appear in red 
  13672.     CurrencyLead (256) - Place currency symbol ahead of number 
  13673.     CurrencyTrail (0) - Place currency symbol after number 
  13674. Either LeadingNegative, TrailingNegative, or ParenthesesNegative should be 
  13675. chosen to determine how to display negative numbers. The RedNegative option can 
  13676. be used to display and print negative numbers in red. Either the CurrencyLead 
  13677. or CurrencyTrail option should be used to indicate the position of the currency 
  13678. symbol. 
  13679.  
  13680. To display the Modify Style dialog box and allow the user to select the options 
  13681. for modifying paragraph styles: ModifyStyle 
  13682.  
  13683. Return Value 
  13684. 1  (TRUE) if the table options were set. 
  13685. -2  (GeneralFailure) if the options were not set. 
  13686.  
  13687. Example 
  13688. FUNCTION Example() 
  13689. NewName = Query$("What do you want to name the new style?", "TestStyle") 
  13690. BaseName = GetStyleName$() 
  13691. CreateStyle(NewName, BaseName, 0) 
  13692. ModifySelect(NewName) 
  13693. ModifyAlignment(AlignLeft, 0, 0, 0, 0, 0) 
  13694. ModifyBreaks(4, 0, 0) 
  13695. ModifyEffects("<#1>", 1, 1440, UpperCase, 0, 16, 0) 
  13696. ModifySpacing(2, 0, 0, 0, 90, 0, 0) 
  13697. ModifyTable(3, 2, ".", ",", "$", (8 + 16 + 128 + 256)) 
  13698. ModifyLines(1, 2, 180, 0, 0, 1440, 65535, 0) 
  13699. ModifyFont("Times New Roman", (20 * 20), 255, UpperCase) 
  13700. SetStyle(NewName) 
  13701. ModifyReflow() 
  13702. TYPE("This[Enter]is what the new[Enter]style looks[Enter]Like...[Enter]") 
  13703. SetStyle(BaseName) 
  13704. END FUNCTION 
  13705.  
  13706. See also: 
  13707.  
  13708.     CreateStyle 
  13709.     DefineStyle 
  13710.     ModifyAlignment 
  13711.     ModifyBreaks 
  13712.     ModifyEffects 
  13713.     ModifyFont 
  13714.     ModifyLines 
  13715.     ModifyReflow 
  13716.     ModifySelect 
  13717.     ModifySpacing 
  13718.     ModifyStyle 
  13719.  
  13720.  
  13721. ΓòÉΓòÉΓòÉ 304. ModLayoutFinish ΓòÉΓòÉΓòÉ
  13722.  
  13723. This function applies changes to the page layout after the function 
  13724. ModLayoutInit has been run. This function is equivalent to accepting changes 
  13725. entered by choosing Page Modify Page Layout. 
  13726.  
  13727.  
  13728. You must call this function after calling ModLayoutInit. 
  13729.  
  13730. Syntax 
  13731. ModLayoutFinish() 
  13732.  
  13733. Return Value 
  13734. 1  (TRUE) if the changes were accepted. 
  13735. -2  if the changes were not accepted. 
  13736.  
  13737. Example 
  13738. FUNCTION Example() 
  13739. ModLayoutInit(512) 
  13740. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13741. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13742. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  13743. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  13744. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  13745. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13746. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13747. ModLayoutRightLines(255, 2, 1, 9, 1) 
  13748. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  13749. ModLayoutFinish() 
  13750. END FUNCTION 
  13751.  
  13752. See also: 
  13753.  
  13754.     ModLayoutFinish 
  13755.     ModLayoutInit 
  13756.     ModLayoutLeftFooter 
  13757.     ModLayoutLeftHeader 
  13758.     ModLayoutLeftLines 
  13759.     ModLayoutLeftPage 
  13760.     ModLayoutPageSize 
  13761.     ModLayoutRightFooter 
  13762.     ModLayoutRightHeader 
  13763.     ModLayoutRightLines 
  13764.     ModLayoutRightPage 
  13765.  
  13766.  
  13767.  
  13768.  
  13769.  
  13770. ΓòÉΓòÉΓòÉ 305. ModLayoutInit ΓòÉΓòÉΓòÉ
  13771.  
  13772. This function prepares Ami Pro to accept page layout changes. This function is 
  13773. equivalent to initializing changes made when choosing Page Modify Page Layout. 
  13774.  
  13775.  
  13776. This function must be called prior to any modify page layout functions. 
  13777.  
  13778. You must call this function before calling ModLayoutFinish. 
  13779.  
  13780. Syntax 
  13781. ModLayoutInit(Type) 
  13782. Type is the type of page setup and can be the following: 
  13783.     (512) - All pages 
  13784.  
  13785. Return Value 
  13786. 1  (TRUE) if the initialization for changes was successful. 
  13787. -2  (GeneralFailure) if the initialization failed. 
  13788. -6  (NoMemory) if the function failed because of insufficient memory. 
  13789.  
  13790. Example 
  13791. FUNCTION Example() 
  13792. ModLayoutInit(512) 
  13793. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13794. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13795. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  13796. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  13797. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  13798. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13799. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13800. ModLayoutRightLines(255, 2, 1, 9, 1) 
  13801. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  13802. ModLayoutFinish() 
  13803. END FUNCTION 
  13804.  
  13805. See also: 
  13806.  
  13807.     ModLayoutFinish 
  13808.     ModLayoutInit 
  13809.     ModLayoutLeftFooter 
  13810.     ModLayoutLeftHeader 
  13811.     ModLayoutLeftLines 
  13812.     ModLayoutLeftPage 
  13813.     ModLayoutPageSize 
  13814.     ModLayoutRightFooter 
  13815.     ModLayoutRightHeader 
  13816.     ModLayoutRightLines 
  13817.     ModLayoutRightPage 
  13818.  
  13819.  
  13820.  
  13821.  
  13822. ΓòÉΓòÉΓòÉ 306. ModLayoutLeftFooter ΓòÉΓòÉΓòÉ
  13823.  
  13824. This function modifies the left footer information for the current page layout 
  13825. if the current page layout is not for all pages. This function is equivalent to 
  13826. choosing Page Modify Page Layout, choosing Footer, and choosing Left only. 
  13827.  
  13828.  
  13829. The ModLayoutFinish function must be called after this function to accept the 
  13830. modifications. 
  13831.  
  13832. You must call this function after calling the ModLayoutInit function. 
  13833.  
  13834. Syntax 
  13835. ModLayoutLeftFooter(LeftMargin, TopMargin, RightMargin, BottomMargin, 0, Flag, 
  13836. NumCols, NumTabs[, Type, Offset]) 
  13837. LeftMargin is the distance from the left edge of the paper. 
  13838. TopMargin is the distance from the top edge of the paper. 
  13839. RightMargin is the distance from the right edge of the paper. 
  13840. BottomMargin is the distance from the bottom edge of the paper. 
  13841. The margin parameters are in twips and represent how much space to leave on 
  13842. that edge of the paper. 
  13843. Flag is an options parameter and can have one or more of the following values: 
  13844.     (1) - Balance (if multi-column) 
  13845.     (2) - Gutterline (if multi-column) 
  13846.     (4) - Borderline 
  13847. NumCols is the number of columns for the page. 
  13848. NumTabs specifies the number of tab settings that follow. You must enter a Type 
  13849. and Offset for each tab. 
  13850. Type is the type of tab. The Offset parameter must also be used for each tab. 
  13851.     TabLeft (1) - Left tab 
  13852.     TabCenter (2) - Center tab 
  13853.     TabRight (3) - Right tab 
  13854.     TabNumeric (4) - Numeric tab 
  13855. To display leaders preceding the tab, add one of the following values to the 
  13856. type of tab: 
  13857.     TabHyph (16384) - Displays dashes 
  13858.     TabDot (-32768) - Displays dots 
  13859.     TabLine (-16384) - Displays an underline 
  13860. Offset is the distance of the tab from the left margin and must be given in 
  13861. twips (1 inch = 1440 twips). The Type parameter must also be used for each tab. 
  13862.  
  13863. Return Value 
  13864. 1  (TRUE) if the left footer was modified. 
  13865. -2  (GeneralFailure) if the left footer was not modified. 
  13866.  
  13867. Example 
  13868. FUNCTION Example() 
  13869. ModLayoutInit(512) 
  13870. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13871. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13872. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  13873. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  13874. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  13875. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13876. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13877. ModLayoutRightLines(255, 2, 1, 9, 1) 
  13878. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  13879. ModLayoutFinish() 
  13880. END FUNCTION 
  13881.  
  13882. See also: 
  13883.  
  13884.     ModLayoutFinish 
  13885.     ModLayoutInit 
  13886.     ModLayoutLeftFooter 
  13887.     ModLayoutLeftHeader 
  13888.     ModLayoutLeftLines 
  13889.     ModLayoutLeftPage 
  13890.     ModLayoutPageSize 
  13891.     ModLayoutRightFooter 
  13892.     ModLayoutRightHeader 
  13893.     ModLayoutRightLines 
  13894.     ModLayoutRightPage 
  13895.  
  13896.  
  13897.  
  13898.  
  13899. ΓòÉΓòÉΓòÉ 307. ModLayoutLeftHeader ΓòÉΓòÉΓòÉ
  13900.  
  13901. This function modifies the left header information for the current page layout 
  13902. if the page setting is not for all pages. This function is equivalent to 
  13903. choosing Page Modify Page Layout, choosing Header, and choosing Left only. 
  13904.  
  13905.  
  13906. The ModLayoutFinish function must be called after this function to accept the 
  13907. modifications. 
  13908.  
  13909. You must call this function after calling the ModLayoutInit function. 
  13910.  
  13911. Syntax 
  13912. ModLayoutLeftHeader(LeftMargin, TopMargin, RightMargin, BottomMargin, 0, Flag, 
  13913. NumCols,  NumTabs[, Type, Offset]) 
  13914. LeftMargin is the distance from the left edge of the paper. 
  13915. TopMargin is the distance from the top edge of the paper. 
  13916. RightMargin is the distance from the right edge of the paper. 
  13917. BottomMargin is the distance from the bottom edge of the paper. 
  13918. The margin parameters are in twips (1 inch = 1440 twips) and represent how much 
  13919. space to leave on that edge of the paper. 
  13920. Flag is an options parameter and can have one or more of the following values: 
  13921.     (1) - Balance (if multi-column) 
  13922.     (2) - Gutterline (if multi-column) 
  13923.     (4) - Borderline 
  13924. NumCols is the number of columns for the page. 
  13925. NumTabs specifies the number of tab settings that follow. You must enter a Type 
  13926. and Offset for each tab. 
  13927. Type is the type of tab. The Offset parameter must also be used for each tab. 
  13928.     TabLeft (1) - Left tab 
  13929.     TabCenter (2) - Center tab 
  13930.     TabRight (3) - Right tab 
  13931.     TabNumeric (4) - Numeric tab 
  13932. To display leaders preceding the tab, add one of the following values to the 
  13933. type of tab: 
  13934.     TabHyph (16384) - Displays dashes 
  13935.     TabDot (-32768) - Displays dots 
  13936.     TabLine (-16384) - Displays an underline 
  13937. Offset is the distance of the tab from the left margin and must be given in 
  13938. twips (1 inch = 1440 twips). The Type parameter must also be used for each tab. 
  13939.  
  13940. Return Value 
  13941. 1  (TRUE) if the left header was modified. 
  13942. -2  (GeneralFailure) if the left header was not modified. 
  13943.  
  13944. Example 
  13945. FUNCTION Example() 
  13946. ModLayoutInit(512) 
  13947. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13948. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13949. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  13950. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  13951. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  13952. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13953. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  13954. ModLayoutRightLines(255, 2, 1, 9, 1) 
  13955. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  13956. ModLayoutFinish() 
  13957. END FUNCTION 
  13958.  
  13959. See also: 
  13960.  
  13961.     ModLayoutFinish 
  13962.     ModLayoutInit 
  13963.     ModLayoutLeftFooter 
  13964.     ModLayoutLeftHeader 
  13965.     ModLayoutLeftLines 
  13966.     ModLayoutLeftPage 
  13967.     ModLayoutPageSize 
  13968.     ModLayoutRightFooter 
  13969.     ModLayoutRightHeader 
  13970.     ModLayoutRightLines 
  13971.     ModLayoutRightPage 
  13972.  
  13973.  
  13974.  
  13975.  
  13976. ΓòÉΓòÉΓòÉ 308. ModLayoutLeftLines ΓòÉΓòÉΓòÉ
  13977.  
  13978. This function modifies the lines settings for the left page of the current page 
  13979. layout if the current page layout setting is not for all pages. This function 
  13980. is equivalent to choosing Page Modify Page Layout, choosing Lines, and choosing 
  13981. Left only. 
  13982.  
  13983.  
  13984. The ModLayoutFinish function must be called after this function to accept the 
  13985. modifications. 
  13986.  
  13987. You must call this function after calling the ModLayoutInit function. 
  13988.  
  13989. Syntax 
  13990. ModLayoutLeftLines(GutterShade, GutterStyle, BorderSides, BorderStyle, 
  13991. BorderSpace) 
  13992. GutterShade is the color of the lines and can be one of the following: 
  13993.     White (16777215) - White 
  13994.     Cyan (16776960) - Light blue 
  13995.     Yellow (65535) - Yellow 
  13996.     Magenta (16711935) - Purple 
  13997.     Green (65280) - Green 
  13998.     Red (255) - Red 
  13999.     Blue (16711680) - Blue 
  14000.     Black (0) - Black 
  14001.     DarkGray (12566463) - 90% gray scale 
  14002.     MediumGray (8355711) - 50% gray scale 
  14003.     LightGray (4144959) - 20% gray scale 
  14004.     VeryLightGray (1644825) - 10% gray scale 
  14005. GutterStyle defines the width of the line and can be one of the following: 
  14006.     Hairline (1) - Hairline 
  14007.     OnePoint (2) - One point wide 
  14008.     TwoPoint (3) - Two points wide 
  14009.     ThreePoint (4) - Three points wide 
  14010.     FourPoint (5) - Four points wide 
  14011.     FivePoint (6) - Five points wide 
  14012.     SixPoint (7) - Six points wide 
  14013.     DoubleOnePoint (8) - Parallel one point lines 
  14014.     DoubleTwoPoint (9) - Parallel two point lines 
  14015.     ThreeLines (10) - Hairline above and below a two point line 
  14016.     HairBelow (11) - Hairline below a three point line 
  14017.     HairAbove (12) - Hairline above a three point line 
  14018. BorderSides is one of the following: 
  14019.     (1) - All 
  14020.     (2) - Left 
  14021.     (4) - Right 
  14022.     (8) - Top 
  14023.     (16) - Bottom 
  14024.     To set a combination of Left, Right, Top, or Bottom, add them together. 
  14025. BorderStyle is the width of the border from a range of 1 to 12. See GutterStyle 
  14026. for the values. 
  14027. BorderSpace is the position of the border with the following values: 
  14028.     (1) - Middle 
  14029.     (2) - Inside 
  14030.     (3) - Outside 
  14031.     (4) - Close to Inside 
  14032.     (5) - Close to Outside 
  14033.  
  14034. Return Value 
  14035. 1  (TRUE) if the left page line settings were modified. 
  14036. -2  (GeneralFailure) if the left page line settings were not modified. 
  14037.  
  14038. Example 
  14039. FUNCTION Example() 
  14040. ModLayoutInit(512) 
  14041. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14042. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14043. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  14044. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14045. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  14046. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14047. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14048. ModLayoutRightLines(255, 2, 1, 9, 1) 
  14049. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14050. ModLayoutFinish() 
  14051. END FUNCTION 
  14052.  
  14053. See also: 
  14054.  
  14055.     ModLayoutFinish 
  14056.     ModLayoutInit 
  14057.     ModLayoutLeftFooter 
  14058.     ModLayoutLeftHeader 
  14059.     ModLayoutLeftLines 
  14060.     ModLayoutLeftPage 
  14061.     ModLayoutPageSize 
  14062.     ModLayoutRightFooter 
  14063.     ModLayoutRightHeader 
  14064.     ModLayoutRightLines 
  14065.     ModLayoutRightPage 
  14066.  
  14067.  
  14068. ΓòÉΓòÉΓòÉ 309. ModLayoutLeftPage ΓòÉΓòÉΓòÉ
  14069.  
  14070. This function modifies the left page information for the current page layout if 
  14071. the page setting is not for all pages. This function is equivalent to choosing 
  14072. Page Modify Page Layout, choosing Margins, and choosing Left only. 
  14073.  
  14074.  
  14075. The ModLayoutFinish function must be called after this function to accept the 
  14076. modifications. 
  14077.  
  14078. You must call this function after calling the ModLayoutInit function. 
  14079.  
  14080. Syntax 
  14081. ModLayoutLeftPage(LeftMargin, TopMargin, RightMargin, BottomMargin, 0, Flag, 
  14082. NumCols,  NumTabs[, Type, Offset]) 
  14083. LeftMargin is the distance from the left edge of the paper. 
  14084. TopMargin is the distance from the top edge of the paper. 
  14085. RightMargin is the distance from the right edge of the paper. 
  14086. BottomMargin is the distance from the bottom edge of the paper. 
  14087. The margin parameters are in twips (1 inch = 1440 twips) and represent how much 
  14088. space to leave on that edge of the paper. 
  14089. Flag is an options parameter and can have one or more of the following values: 
  14090.     (1) - Balance (if multi-column) 
  14091.     (2) - Gutterline (if multi-column) 
  14092.     (4) - Borderline 
  14093. NumCols is the number of columns for the page. 
  14094. NumTabs specifies the number of tab settings that follow. You must enter a Type 
  14095. and Offset for each tab. 
  14096. Type is the type of tab. The Offset parameter must also be used for each tab. 
  14097.     TabLeft (1) - Left tab 
  14098.     TabCenter (2) - Center tab 
  14099.     TabRight (3) - Right tab 
  14100.     TabNumeric (4) - Numeric tab 
  14101. To display leaders preceding the tab, add one of the following values to the 
  14102. type of tab: 
  14103.     TabHyph (16384) - Displays dashes 
  14104.     TabDot (-32768) - Displays dots 
  14105.     TabLine (-16384) - Displays an underline 
  14106. Offset is the distance of the tab from the left margin and must be given in 
  14107. twips (1 inch = 1440 twips). The Type parameter must also be used for each tab. 
  14108.  
  14109. Return Value 
  14110. 1(TRUE) if the left page information was modified. 
  14111. -2  (GeneralFailure) if the left page information was not modified. 
  14112.  
  14113. Example 
  14114. FUNCTION Example() 
  14115. ModLayoutInit(512) 
  14116. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14117. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14118. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  14119. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14120. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  14121. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14122. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14123. ModLayoutRightLines(255, 2, 1, 9, 1) 
  14124. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14125. ModLayoutFinish() 
  14126. END FUNCTION 
  14127.  
  14128. See also: 
  14129.  
  14130.     ModLayoutFinish 
  14131.     ModLayoutInit 
  14132.     ModLayoutLeftFooter 
  14133.     ModLayoutLeftHeader 
  14134.     ModLayoutLeftLines 
  14135.     ModLayoutLeftPage 
  14136.     ModLayoutPageSize 
  14137.     ModLayoutRightFooter 
  14138.     ModLayoutRightHeader 
  14139.     ModLayoutRightLines 
  14140.     ModLayoutRightPage 
  14141.  
  14142.  
  14143.  
  14144.  
  14145.  
  14146. ΓòÉΓòÉΓòÉ 310. ModLayoutPageSize ΓòÉΓòÉΓòÉ
  14147.  
  14148. This function modifies the page size information for the current page layout. 
  14149. This function is equivalent to choosing Page Modify Page Layout Page and 
  14150. choosing Pg. Settings. 
  14151.  
  14152.  
  14153. The ModLayoutFinish function must be called after this function to accept the 
  14154. modifications. 
  14155.  
  14156. You must call this function after calling the ModLayoutInit function. 
  14157.  
  14158. Syntax 
  14159. ModLayoutPageSize(Length, Width, 0, 0) 
  14160. Length is the length of the page in twips (1 inch = 1440 twips), if the paper 
  14161. type is custom. 
  14162. Width is the width of the page in twips (1 inch = 1440 twips), if the paper 
  14163. type is custom. 
  14164.  
  14165. Return Value 
  14166. 1  (TRUE) if the page size information was modified. 
  14167. -2  (GeneralFailure) if the page size information was not modified. 
  14168.  
  14169. Example 
  14170. FUNCTION Example() 
  14171. ModLayoutInit(512) 
  14172. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14173. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14174. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  14175. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14176. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  14177. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14178. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14179. ModLayoutRightLines(255, 2, 1, 9, 1) 
  14180. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14181. ModLayoutFinish() 
  14182. END FUNCTION 
  14183.  
  14184. See also: 
  14185.  
  14186.     ModLayoutFinish 
  14187.     ModLayoutInit 
  14188.     ModLayoutLeftFooter 
  14189.     ModLayoutLeftHeader 
  14190.     ModLayoutLeftLines 
  14191.     ModLayoutLeftPage 
  14192.     ModLayoutPageSize 
  14193.     ModLayoutRightFooter 
  14194.     ModLayoutRightHeader 
  14195.     ModLayoutRightLines 
  14196.     ModLayoutRightPage 
  14197.  
  14198.  
  14199. ΓòÉΓòÉΓòÉ 311. ModLayoutRightFooter ΓòÉΓòÉΓòÉ
  14200.  
  14201. This function modifies the footer information for the current page layout if 
  14202. the page setting is for all or right pages. This function is equivalent to 
  14203. choosing Page Modify Page Layout, choosing Footer, and choosing All pages or 
  14204. Right only. 
  14205.  
  14206.  
  14207. The ModLayoutFinish function must be called after this function to accept the 
  14208. modifications. 
  14209.  
  14210. You must call this function after calling the ModLayoutInit function. 
  14211.  
  14212. Syntax 
  14213. ModLayoutRightFooter(LeftMargin, TopMargin, RightMargin, BottomMargin, 0, Flag, 
  14214. NumCols,  NumTabs[, Type, Offset]) 
  14215. LeftMargin is the distance from the left edge of the paper. 
  14216. TopMargin is the distance from the top edge of the paper. 
  14217. RightMargin is the distance from the right edge of the paper. 
  14218. BottomMargin is the distance from the bottom edge of the paper. 
  14219. The margin parameters are in twips (1 inch = 1440 twips) and represent how much 
  14220. space to leave on that edge of the paper. 
  14221. Flag is an options parameter and can have one or more of the following values: 
  14222.     (1) - Balance (if multi-column) 
  14223.     (2) - Gutterline (if multi-column) 
  14224.     (4) - Borderline 
  14225. NumCols is the number of columns for the page. 
  14226. NumTabs specifies the number of tab settings that follow. You must enter a Type 
  14227. and Offset for each tab. 
  14228. Type is the type of tab. The Offset parameter must also be used for each tab. 
  14229.     TabLeft (1) - Left tab 
  14230.     TabCenter (2) - Center tab 
  14231.     TabRight (3) - Right tab 
  14232.     TabNumeric (4) - Numeric tab 
  14233. To display leaders preceding the tab, add one of the following values to the 
  14234. type of tab: 
  14235.     TabHyph (16384) - Displays dashes 
  14236.     TabDot (-32768) - Displays dots 
  14237.     TabLine (-16384) - Displays an underline 
  14238. Offset is the distance of the tab from the left margin and must be given in 
  14239. twips (1 inch = 1440 twips). The Type parameter must also be used for each tab. 
  14240.  
  14241. Return Value 
  14242. 1  (TRUE) if the right footer was modified. 
  14243. -2  (GeneralFailure) if the right footer was not modified. 
  14244.  
  14245. Example 
  14246. FUNCTION Example() 
  14247. ModLayoutInit(512) 
  14248. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14249. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14250. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  14251. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14252. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  14253. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14254. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14255. ModLayoutRightLines(255, 2, 1, 9, 1) 
  14256. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14257. ModLayoutFinish() 
  14258. END FUNCTION 
  14259.  
  14260. See also: 
  14261.  
  14262.     ModLayoutFinish 
  14263.     ModLayoutInit 
  14264.     ModLayoutLeftFooter 
  14265.     ModLayoutLeftHeader 
  14266.     ModLayoutLeftLines 
  14267.     ModLayoutLeftPage 
  14268.     ModLayoutPageSize 
  14269.     ModLayoutRightFooter 
  14270.     ModLayoutRightHeader 
  14271.     ModLayoutRightLines 
  14272.     ModLayoutRightPage 
  14273.  
  14274.  
  14275.  
  14276.  
  14277. ΓòÉΓòÉΓòÉ 312. ModLayoutRightHeader ΓòÉΓòÉΓòÉ
  14278.  
  14279. This function modifies the header information for the current page layout if 
  14280. the page setting is for all or right pages. This function is equivalent to 
  14281. choosing Page Modify Page Layout, choosing Header, and choosing All pages or 
  14282. Right only. 
  14283.  
  14284.  
  14285. The ModLayoutFinish function must be called after this function to accept the 
  14286. modifications. 
  14287.  
  14288. You must call this function after calling the ModLayoutInit function. 
  14289.  
  14290. Syntax 
  14291. ModLayoutRightHeader(LeftMargin, TopMargin, RightMargin, BottomMargin, 0, Flag, 
  14292. NumCols,  NumTabs, Tabs) 
  14293. LeftMargin is the distance from the left edge of the paper. 
  14294. TopMargin is the distance from the top edge of the paper. 
  14295. RightMargin is the distance from the right edge of the paper. 
  14296. BottomMargin is the distance from the bottom edge of the paper. 
  14297. The margin parameters are in twips (1 inch = 1440 twips) and represent how much 
  14298. space to leave on that edge of the paper. 
  14299. Flag is an options parameter and can have one or more of the following values: 
  14300.     (1) - Balance (if multi-column) 
  14301.     (2) - Gutterline (if multi-column) 
  14302.     (4) - Borderline 
  14303. NumCols is the number of columns for the page. 
  14304. NumTabs specifies the number of tab settings that follow. You must enter a Type 
  14305. and Offset for each tab. 
  14306. Type is the type of tab. The Offset parameter must also be used for each tab. 
  14307.     TabLeft (1) - Left tab 
  14308.     TabCenter (2) - Center tab 
  14309.     TabRight (3) - Right tab 
  14310.     TabNumeric (4) - Numeric tab 
  14311. To display leaders preceding the tab, add one of the following values to the 
  14312. type of tab: 
  14313.     TabHyph (16384) - Displays dashes 
  14314.     TabDot (-32768) - Displays dots 
  14315.     TabLine (-16384) - Displays an underline 
  14316. Offset is the distance of the tab from the left margin and must be given in 
  14317. twips (1 inch = 1440 twips). The Type parameter must also be used for each tab. 
  14318.  
  14319. Return Value 
  14320. 1  (TRUE) if the right header was modified. 
  14321. -2  (GeneralFailure) if the right header was not modified. 
  14322.  
  14323. Example 
  14324. FUNCTION Example() 
  14325. ModLayoutInit(512) 
  14326. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14327. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14328. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  14329. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14330. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  14331. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14332. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14333. ModLayoutRightLines(255, 2, 1, 9, 1) 
  14334. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14335. ModLayoutFinish() 
  14336. END FUNCTION 
  14337.  
  14338. See also: 
  14339.  
  14340.     ModLayoutFinish 
  14341.     ModLayoutInit 
  14342.     ModLayoutLeftFooter 
  14343.     ModLayoutLeftHeader 
  14344.     ModLayoutLeftLines 
  14345.     ModLayoutLeftPage 
  14346.     ModLayoutPageSize 
  14347.     ModLayoutRightFooter 
  14348.     ModLayoutRightHeader 
  14349.     ModLayoutRightLines 
  14350.     ModLayoutRightPage 
  14351.  
  14352.  
  14353.  
  14354. ΓòÉΓòÉΓòÉ 313. ModLayoutRightLines ΓòÉΓòÉΓòÉ
  14355.  
  14356. This function modifies the lines settings for the current page layout if the 
  14357. page setting is for all or right pages. This function is equivalent to choosing 
  14358. Page Modify Page Layout, choosing Lines, and choosing All pages or Right only. 
  14359.  
  14360.  
  14361. The ModLayoutFinish function must be called after this function to accept the 
  14362. modifications. 
  14363.  
  14364. You must call this function after calling the ModLayoutInit function. 
  14365.  
  14366. Syntax 
  14367. ModLayoutRightLines(GutterShade, GutterStyle, BorderSides, BorderStyle, 
  14368. BorderSpace) 
  14369. GutterShade is the color of the lines and can be one of the following: 
  14370.     White (16777215) - White 
  14371.     Cyan (16776960) - Light blue 
  14372.     Yellow (65535) - Yellow 
  14373.     Magenta (16711935) - Purple 
  14374.     Green (65280) - Green 
  14375.     Red (255) - Red 
  14376.     Blue (16711680) - Blue 
  14377.     Black (0) - Black 
  14378.     DarkGray (12566463) - 90% gray scale 
  14379.     MediumGray (8355711) - 50% gray scale 
  14380.     LightGray (4144959) - 20% gray scale 
  14381.     VeryLightGray (1644825) - 10% gray scale 
  14382. GutterStyle defines the width of the line and can be one of the following: 
  14383.     Hairline (1) - Hairline 
  14384.     OnePoint (2) - One point wide 
  14385.     TwoPoint (3) - Two points wide 
  14386.     ThreePoint (4) - Three points wide 
  14387.     FourPoint (5) - Four points wide 
  14388.     FivePoint (6) - Five points wide 
  14389.     SixPoint (7) - Six points wide 
  14390.     DoubleOnePoint (8) - Parallel one point lines 
  14391.     DoubleTwoPoint (9) - Parallel two point lines 
  14392.     ThreeLines (10) - Hairline above and below a two point line 
  14393.     HairBelow (11) - Hairline below a three point line 
  14394.     HairAbove (12) - Hairline above a three point line 
  14395. BorderSides is one of the following: 
  14396.     (1) - All 
  14397.     (2) - Left 
  14398.     (4) - Right 
  14399.     (8) - Top 
  14400.     (16) - Bottom 
  14401. To set a combination of Left, Right, Top, or Bottom, add them together. 
  14402. BorderStyle is the width of the border from a range of 1 to 12. See GutterStyle 
  14403. for the values. 
  14404. BorderSpace is the position of the border with the following values: 
  14405.     (1) - Middle 
  14406.     (2) - Inside 
  14407.     (3) - Outside 
  14408.     (4) - Close to Inside 
  14409.     (5) - Close to Outside 
  14410.  
  14411. Return Value 
  14412. 1  (TRUE) if the right page line settings were modified. 
  14413. -2  (GeneralFailure) if the right page line settings were not modified. 
  14414.  
  14415. Example 
  14416. FUNCTION Example() 
  14417. ModLayoutInit(512) 
  14418. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14419. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14420. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  14421. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14422. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  14423. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14424. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14425. ModLayoutRightLines(255, 2, 1, 9, 1) 
  14426. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14427. ModLayoutFinish() 
  14428. END FUNCTION 
  14429.  
  14430. See also: 
  14431.  
  14432.     ModLayoutFinish 
  14433.     ModLayoutInit 
  14434.     ModLayoutLeftFooter 
  14435.     ModLayoutLeftHeader 
  14436.     ModLayoutLeftLines 
  14437.     ModLayoutLeftPage 
  14438.     ModLayoutPageSize 
  14439.     ModLayoutRightFooter 
  14440.     ModLayoutRightHeader 
  14441.     ModLayoutRightLines 
  14442.     ModLayoutRightPage 
  14443.  
  14444.  
  14445. ΓòÉΓòÉΓòÉ 314. ModLayoutRightPage ΓòÉΓòÉΓòÉ
  14446.  
  14447. This function modifies the page information for the current page layout if the 
  14448. page setting is for all or right pages. This function is equivalent to choosing 
  14449. Page Modify Page Layout, choosing Margins, and choosing All pages or Right 
  14450. only. 
  14451.  
  14452.  
  14453. The ModLayoutFinish function must be called after this function to accept the 
  14454. modifications. 
  14455.  
  14456. You must call this function after calling the ModLayoutInit function. 
  14457.  
  14458. Syntax 
  14459. ModLayoutRightPage(LeftMargin, TopMargin, RightMargin, BottomMargin, 0, Flag, 
  14460. NumCols,  NumTabs[, Type, Offset]) 
  14461. LeftMargin is the distance from the left edge of the paper. 
  14462. TopMargin is the distance from the top edge of the paper. 
  14463. RightMargin is the distance from the right edge of the paper. 
  14464. BottomMargin is the distance from the bottom edge of the paper. 
  14465. The margin parameters are in twips (1 inch = 1440 twips) and represent how much 
  14466. space to leave on that edge of the paper. 
  14467. Flag is an options parameter and can have one or more of the following values: 
  14468.     (1) - Balance (if multi-column) 
  14469.     (2) - Gutterline (if multi-column) 
  14470.     (4) - Borderline 
  14471. NumCols is the number of columns for the page. 
  14472. NumTabs specifies the number of tab settings that follow. You must enter a Type 
  14473. and Offset for each tab. 
  14474. Type is the type of tab. The Offset parameter must also be used for each tab. 
  14475.     TabLeft (1) - Left tab 
  14476.     TabCenter (2) - Center tab 
  14477.     TabRight (3) - Right tab 
  14478.     TabNumeric (4) - Numeric tab 
  14479. To display leaders preceding the tab, add one of the following values to the 
  14480. type of tab: 
  14481.     TabHyph (16384) - Displays dashes 
  14482.     TabDot (-32768) - Displays dots 
  14483.     TabLine (-16384) - Displays an underline 
  14484. Offset is the distance of the tab from the left margin and must be given in 
  14485. twips (1 inch = 1440 twips). The Type parameter must also be used for each tab. 
  14486.  
  14487. Return Value 
  14488. 1  (TRUE) if the right page information was modified. 
  14489. -2  (GeneralFailure) if the right page information was not modified. 
  14490.  
  14491. Example 
  14492. FUNCTION Example() 
  14493. ModLayoutInit(512) 
  14494. ModLayoutLeftFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14495. ModLayoutLeftHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14496. ModLayoutLeftLines(255, 2, 1, 9, 1) 
  14497. ModLayoutLeftPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14498. ModLayoutPageSize((11 * 1440), (8.5 * 1440), 0, 0) 
  14499. ModLayoutRightHeader(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14500. ModLayoutRightFooter(1440, 180, 1440, 720, 0, 1, 1, 0) 
  14501. ModLayoutRightLines(255, 2, 1, 9, 1) 
  14502. ModLayoutRightPage(1440, 1440, 1440, 1440, 0, 1, 1, 0) 
  14503. ModLayoutFinish() 
  14504. END FUNCTION 
  14505.  
  14506. See also: 
  14507.  
  14508.     ModLayoutFinish 
  14509.     ModLayoutInit 
  14510.     ModLayoutLeftFooter 
  14511.     ModLayoutLeftHeader 
  14512.     ModLayoutLeftLines 
  14513.     ModLayoutLeftPage 
  14514.     ModLayoutPageSize 
  14515.     ModLayoutRightFooter 
  14516.     ModLayoutRightHeader 
  14517.     ModLayoutRightLines 
  14518.     ModLayoutRightPage 
  14519.  
  14520.  
  14521.  
  14522.  
  14523. ΓòÉΓòÉΓòÉ 315. MouseInterrupt ΓòÉΓòÉΓòÉ
  14524.  
  14525. This function sets a macro function to be called if the user clicks the mouse 
  14526. while the current macro is running. This function is passed the window handle 
  14527. (HWND), a flag, and x and y coordinates. 
  14528.  
  14529.  
  14530. HWND is the handle of the selected window, and flag is a combination of the 
  14531. following bits: 
  14532.     (1) - Left mouse button is down. 
  14533.     (2) - Right mouse button is down. 
  14534.     (4) - Shift key is down. 
  14535.     (8) - Control key is down. 
  14536.  
  14537. X and Y are relative to upper left corner of HWND and are in device units. 
  14538.  
  14539. Syntax 
  14540. MouseInterrupt(Function) 
  14541. Function is the function that is run when a mouse button is pressed. This 
  14542. parameter may contain the macro filename or the function within that file to 
  14543. call. 
  14544.  
  14545. Return Value 
  14546. The previously set MouseInterrupt function. 
  14547.  
  14548. Example 
  14549. FUNCTION Example() 
  14550. MouseInterrupt("MouseInt")  ' Set them 
  14551. TYPE("Click the mouse") 
  14552. FOR i = 1 to 5  ' Kill some time. 
  14553.     FOR j = 1 to 100 
  14554.     NEXT 
  14555.     TYPE("{i}.") 
  14556. NEXT 
  14557. END FUNCTION 
  14558.  
  14559. ' The Interrupt function: just echo the input parameters 
  14560.  
  14561. FUNCTION MouseInt(hwnd, flag, x, y) 
  14562. Message("hwnd {hwnd}, flag {flag}, {x}, {y}") 
  14563. END FUNCTION 
  14564.  
  14565. See Also: 
  14566.  
  14567.     DlgKeyInterrupt 
  14568.     KeyInterrupt 
  14569.  
  14570.  
  14571.  
  14572.  
  14573. ΓòÉΓòÉΓòÉ 316. New ΓòÉΓòÉΓòÉ
  14574.  
  14575. This function displays the New dialog box. This function is equivalent to 
  14576. choosing File New. 
  14577.  
  14578.  
  14579. Syntax 
  14580. New(Style, WithContents, Options) 
  14581. Style is the style sheet file to use with the new file. 
  14582. WithContents determines if the new file is created with the paragraph style 
  14583. sheet contents. It can be one of the following: 
  14584.     NoContents (0) - Do not bring in contents of paragraph style sheet 
  14585.     WithContents (1) - Bring in contents with paragraph style sheet 
  14586. Options determines if the new file is placed in a new window or replaces the 
  14587. currently active document. It can be one of the following values: 
  14588.     (0) - Open another window for the new file 
  14589.     (128) - Close the current document 
  14590.     (512) - Do not run the macro associated with the style sheet, if one exists 
  14591.     (1024) - Show the style sheets by description rather than file name when 
  14592.     the New dialog box displays 
  14593. If the ReplaceCurrent option is used and a document is already open, then the 
  14594. new file replaces the current document in the selected window. If the 
  14595. ReplaceCurrent option is set, then any documents opened thereafter have this 
  14596. option set. 
  14597.  
  14598. To display the New dialog box and allow the user to choose the style sheet file 
  14599. and with contents options: New 
  14600.  
  14601. Return Value 
  14602. 1  (TRUE) if the new file was created. 
  14603. 0  (UserCancel) if the user canceled the function. 
  14604. -2  (GeneralFailure) if the file was not created. 
  14605.  
  14606. Example 
  14607. FUNCTION Example() 
  14608. New("_MACRO.STY", 1, 0) 
  14609. END FUNCTION 
  14610. See also:  FileOpen 
  14611.     GetOpenFileName$ 
  14612.  
  14613.  
  14614.  
  14615.  
  14616. ΓòÉΓòÉΓòÉ 317. NewWindow ΓòÉΓòÉΓòÉ
  14617.  
  14618. This function creates a new window with the same name as the active window. 
  14619. This function is equivalent to choosing Window New Window. 
  14620.  
  14621.  
  14622. Syntax 
  14623. NewWindow() 
  14624.  
  14625. Return Value 
  14626. 1  (TRUE) if the new window was created. 
  14627. -2  (GeneralFailure) if the new window was not created. 
  14628.  
  14629. Example 
  14630. FUNCTION Example() 
  14631. thisfile = GetOpenFileName$() 
  14632. Message("Opening another window for {thisfile}.") 
  14633. NewWindow() 
  14634. END FUNCTION 
  14635.  
  14636. See also: 
  14637.  
  14638.     CascadeWindow 
  14639.     NextWindow 
  14640.     SelectWindow 
  14641.     TileWindow 
  14642.  
  14643.  
  14644. ΓòÉΓòÉΓòÉ 318. NextWindow ΓòÉΓòÉΓòÉ
  14645.  
  14646. This function changes the active document window to the next document window. 
  14647. This function is equivalent to pressing CTRL+TAB. 
  14648.  
  14649.  
  14650. Syntax 
  14651. NextWindow() 
  14652.  
  14653. Return Value 
  14654. This function does not return a value. 
  14655.  
  14656. Example 
  14657. FUNCTION Example() 
  14658. NextWindow() 
  14659. END FUNCTION 
  14660.  
  14661. See also: 
  14662.  
  14663.     CascadeWindow 
  14664.     NewWindow 
  14665.     SelectWindow 
  14666.     TileWindow 
  14667.  
  14668.  
  14669.  
  14670. ΓòÉΓòÉΓòÉ 319. NoHyphenation ΓòÉΓòÉΓòÉ
  14671.  
  14672. This function sets the no hyphenation attribute for selected text or for all 
  14673. following text if no text is selected. It acts as a toggle, turning off the 
  14674. attribute if it is currently on or turning on the attribute if it is currently 
  14675. off. This function is equivalent to choosing Edit Mark Text No Hyphenation. 
  14676.  
  14677.  
  14678. Syntax 
  14679. NoHyphenation() 
  14680.  
  14681. Return Value 
  14682. 1  (TRUE) if the change of hyphenation was successful. 
  14683. -2  (GeneralFailure) if the change of hyphenation was not successful. 
  14684.  
  14685. Example 
  14686. FUNCTION Example() 
  14687. NoHyphenation() 
  14688. END FUNCTION 
  14689.  
  14690. See also: 
  14691.  
  14692.     SetDefOptions 
  14693.  
  14694.  
  14695. ΓòÉΓòÉΓòÉ 320. NormalText ΓòÉΓòÉΓòÉ
  14696.  
  14697. This function removes attributes for selected text or for all following text if 
  14698. no text is selected. This function is equivalent to choosing Text Normal. 
  14699.  
  14700.  
  14701. Syntax 
  14702. NormalText() 
  14703.  
  14704. Return Value 
  14705. 1(TRUE) if the attributes were removed from the text. 
  14706. -6  (NoMemory) if the function failed because of insufficient memory. 
  14707.  
  14708. Example 
  14709. FUNCTION Example() 
  14710. String = "This is a line of text." 
  14711. Bold(1) 
  14712. Italic(1) 
  14713. TYPE("{String}") 
  14714. NormalText() 
  14715. TYPE("{String}") 
  14716. END FUNCTION 
  14717.  
  14718. See also: 
  14719.  
  14720.     Bold 
  14721.     Italic 
  14722.     Underline 
  14723.     WordUnderline 
  14724.  
  14725.  
  14726. ΓòÉΓòÉΓòÉ 321. Notes ΓòÉΓòÉΓòÉ
  14727.  
  14728. This function opens a note located at the insertion point and allows the user 
  14729. to edit it. It is the equivalent of double-clicking on a note. This function 
  14730. does not automatically insert or delete notes. 
  14731.  
  14732.  
  14733. To set the user initials for notes and the default note color, use the 
  14734. UserSetup function. 
  14735.  
  14736. Syntax 
  14737. Notes() 
  14738.  
  14739. Return Value 
  14740. 1  (TRUE) if the notes function was completed. 
  14741. -2  (GeneralFailure) if the notes function was not completed. 
  14742. -6  (NoMemory) if the function failed because of insufficient memory. 
  14743.  
  14744. Example 
  14745. FUNCTION Example() 
  14746. Notes() 
  14747. END FUNCTION 
  14748.  
  14749. See also: 
  14750.  
  14751.     InsertNote 
  14752.     UserSetUp 
  14753.  
  14754.  
  14755. ΓòÉΓòÉΓòÉ 322. Now ΓòÉΓòÉΓòÉ
  14756.  
  14757. This function returns the number of seconds that have elapsed since midnight on 
  14758. January 1, 1970. 
  14759.  
  14760.  
  14761. Syntax 
  14762. Now() 
  14763.  
  14764. Return Value 
  14765. A number corresponding to the number of seconds that have elapsed since 
  14766. midnight on January 1, 1970. 
  14767.  
  14768. Example 
  14769. FUNCTION Example() 
  14770. Born = Query$("What is your Birthday (MM/DD/YYYY)?") 
  14771. Date = FormatDate$(Now(), "h") 
  14772. Time = FormatTime$(Now(), 6) 
  14773. Days = DateDiff(Born, Date) 
  14774. TextDate = FormatDate$(Now(), "d") 
  14775. Message("It is now {Time} on {TextDate}. You are {Days} days old.") 
  14776. END FUNCTION 
  14777.  
  14778. See also: 
  14779.  
  14780.     FormatDate$ 
  14781.     FormatTime$ 
  14782.     GetTime 
  14783.     InsertDate 
  14784.  
  14785.  
  14786.  
  14787. ΓòÉΓòÉΓòÉ 323. OnKey ΓòÉΓòÉΓòÉ
  14788.  
  14789. This function sets an accelerator key when you specify an Ami Pro function or a 
  14790. macro name. Any accelerator key currently set to the specified keystroke is 
  14791. reassigned to the new function or macro. This function is equivalent to 
  14792. choosing Tools Macros Edit and then entering keys in the Shortcut keys text 
  14793. box. 
  14794.  
  14795.  
  14796. Syntax 
  14797. OnKey(Key, Function, MacroName) 
  14798. Key is the keystroke, enclosed in square brackets, to use as an accelerator 
  14799. key, in square brackets. 
  14800. You can use either CTRL or SHIFT, or a combination of the two, with most keys. 
  14801. When assigning a shortcut, you must spell out the shortcut command keys. For 
  14802. example, to assign SHIFT+F2, you must type the actual alphanumeric characters 
  14803. with no spaces. You cannot use F10, SHIFT+F1, or SHIFT+ an alphanumeric key. 
  14804. Function is the Ami Pro function this keystroke should execute. If a macro is 
  14805. to be run, this parameter should be the null string(""). Do not include 
  14806. parentheses around the function. 
  14807. MacroName is the name of the macro to be run. If an Ami Pro function is to be 
  14808. executed, this parameter should be the null string (""). 
  14809. To reassign the keystroke to its original state, set Function equal to 0 and 
  14810. set MacroName equal to the null string (""). 
  14811.  
  14812. Return Value 
  14813. Non zero number (TRUE) if the accelerator key was assigned. 
  14814. 0  (UserCancel) if the user canceled the function. 
  14815. -2  (GeneralFailure) if the accelerator key could not be assigned. 
  14816.  
  14817. Example 
  14818. FUNCTION Example() 
  14819. OnKey([ctrlshifts], SaveAs, "") 
  14820. END FUNCTION 
  14821.  
  14822. See also: 
  14823.  
  14824.     ChangeShortcutKey 
  14825.  
  14826.  
  14827.  
  14828.  
  14829. ΓòÉΓòÉΓòÉ 324. OpenDataFile ΓòÉΓòÉΓòÉ
  14830.  
  14831. This function opens a merge data file. It does not edit the data file 
  14832. automatically. 
  14833.  
  14834.  
  14835. Syntax 
  14836. OpenDataFile(FileName, App) 
  14837. FileName is the name of the document to open. If the file to be opened is not 
  14838. in the current directory or document directory, the full path must be used. 
  14839. App is the Ami Pro file type. To open an Ami Pro file, use the null string 
  14840. (""). 
  14841.  
  14842. Return Value 
  14843. This function returns 1. 
  14844.  
  14845. Example 
  14846. FUNCTION Example() 
  14847. OpenDataFile("senators.sam","") 
  14848. END FUNCTION 
  14849.  
  14850. See also: 
  14851.  
  14852.     CreateDataFile 
  14853.     MergeToFile 
  14854.     OpenMergeFile 
  14855.  
  14856.  
  14857.  
  14858.  
  14859.  
  14860. ΓòÉΓòÉΓòÉ 325. OpenMergeFile ΓòÉΓòÉΓòÉ
  14861.  
  14862. This function opens a merge document file. The user can insert additional field 
  14863. names into the document, continue the merge, or select a data file. 
  14864.  
  14865.  
  14866. Syntax 
  14867. OpenMergeFile(FileName, Options, App) 
  14868. FileName is the name of the document to open. If the file to be opened is not 
  14869. in the current directory or document directory, the full path must be used. To 
  14870. open the 'Untitled' file, use the null string ("") as the file name. 
  14871. Options is a number corresponding to the options for the file you open. To use 
  14872. both options, add them together. 
  14873.     (1) - Required 
  14874.     (128) - Close the current file (must combine with 1) 
  14875. App is the Ami Pro file type. To open an Ami Pro file, use the null string 
  14876. (""). 
  14877.  
  14878. Return Value 
  14879. This function returns 1. 
  14880.  
  14881. Example 
  14882. FUNCTION Example() 
  14883. OpenMergeFile("Merge.sam", 1, "") 
  14884. END FUNCTION 
  14885.  
  14886. See also: 
  14887.  
  14888.     CreateDataFile 
  14889.     MergeToFile 
  14890.     OpenDataFile 
  14891.  
  14892.  
  14893.  
  14894.  
  14895. ΓòÉΓòÉΓòÉ 326. OpenPreviousFile ΓòÉΓòÉΓòÉ
  14896.  
  14897. These functions open one of the last five previously opened Ami Pro files. The 
  14898. function OpenPreviousFile1 is the most recently opened file and 
  14899. OpenPreviousFile5 is the oldest file. Choosing these functions are equivalent 
  14900. to choosing File/#, where # is the number to the left of the file name to open 
  14901. at the bottom of the File menu. 
  14902.  
  14903.  
  14904. The number of recently open files to display may be set using the UserSetup 
  14905. function. 
  14906.  
  14907. Syntax 
  14908. OpenPreviousFile1() 
  14909. OpenPreviousFile2() 
  14910. OpenPreviousFile3() 
  14911. OpenPreviousFile4() 
  14912. OpenPreviousFile5() 
  14913.  
  14914. Return Value 
  14915. 0 (FALSE) if the user cancels the function or if no action is taken. 
  14916. 1 (TRUE) if the file is opened. 
  14917. -2 (GeneralFailure) if the file is not opened. 
  14918.  
  14919. Example 
  14920. FUNCTION Example() 
  14921. OpenPreviousFile1() 
  14922. END FUNCTION 
  14923.  
  14924. See also: 
  14925.  
  14926.     UserSetup 
  14927.  
  14928.  
  14929. ΓòÉΓòÉΓòÉ 327. OutlineLevels ΓòÉΓòÉΓòÉ
  14930.  
  14931. This function changes the number of displayed outline levels. The number of 
  14932. levels set are the number of levels printed if the document is printed. This 
  14933. function is equivalent to clicking the icon for the number of outline levels 
  14934. while in Outline Mode. 
  14935.  
  14936.  
  14937. You must be in Outline Mode to use this function. 
  14938.  
  14939. Syntax 
  14940. OutlineLevels(Levels) 
  14941. Levels is the number of outline levels to display. 
  14942.  
  14943. Return Value 
  14944. This function returns 1. 
  14945.  
  14946. Example 
  14947. FUNCTION Example() 
  14948. Levels = Query$("Levels?") 
  14949. OutlineLevels(Levels) 
  14950. END FUNCTION 
  14951.  
  14952. See also: 
  14953.  
  14954.     OutlineMode 
  14955.     OutlineStyle 
  14956.  
  14957.  
  14958.  
  14959. ΓòÉΓòÉΓòÉ 328. OutlineMode ΓòÉΓòÉΓòÉ
  14960.  
  14961. This function changes the current document in Ami Pro from Draft Mode or Layout 
  14962. Mode to Outline Mode. This function is equivalent to choosing View Outline 
  14963. Mode. 
  14964.  
  14965.  
  14966. Syntax 
  14967. OutlineMode() 
  14968.  
  14969. Return Value 
  14970. 1  (TRUE) if the view mode was changed. 
  14971. 0  (NoAction) if no action was taken because Ami Pro is already in the mode 
  14972. selected. 
  14973.  
  14974. Example 
  14975. FUNCTION Example() 
  14976. OutlineMode() 
  14977. END FUNCTION 
  14978.  
  14979. See also: 
  14980.  
  14981.     DraftMode 
  14982.     EnlargedView 
  14983.     FacingView 
  14984.     FullPageView 
  14985.     GetMode 
  14986.     GetViewLevel 
  14987.     LayoutMode 
  14988.     OutlineMode 
  14989.     StandardView 
  14990.  
  14991.  
  14992.  
  14993.  
  14994.  
  14995. ΓòÉΓòÉΓòÉ 329. OutlineStyle ΓòÉΓòÉΓòÉ
  14996.  
  14997. This function assigns outline styles and options to paragraph styles. This 
  14998. function is equivalent to choosing Style Outline Styles. 
  14999.  
  15000.  
  15001. Syntax 
  15002. OutlineStyle(Count[, Style, Level, Options, BulletText]) 
  15003. Count is the number of levels to which you assign styles. 
  15004. The remaining parameters depend on Count. An entire set of the optional 
  15005. parameters must be present for the number of levels defined by the Count 
  15006. parameter. 
  15007. Style is the paragraph to which you want to assign a style. 
  15008. Level is the outline level in which the style is assigned. 
  15009. Options is the reset options for each outline level. It is one of the following 
  15010. values: 
  15011.     (0) - Do not reset 
  15012.     (2) - Reset after a higher level 
  15013.     (4) - Reset after an intervening style 
  15014.     (8) - Turn on cumulative numbering 
  15015. The Reset after a higher level and Reset after an intervening style options 
  15016. cannot be used together. However, the cumulative numbering value can be 
  15017. combined with either of the other values. 
  15018. BulletText is the leading text for the paragraph. The BulletText parameter 
  15019. specifies the text, bullets, or numbers which must precede each paragraph using 
  15020. this paragraph style. The text must be typed as it would appear in the edit box 
  15021. in the Style Modify Style Bullets & numbers dialog box. Bullets can be inserted 
  15022. by typing the following text where the bullet should be placed: 
  15023.     <Γòû1> - Small  Round Bullet 
  15024.     <Γòû2> - Large  Round Bullet 
  15025.     <Γòû3> - Small  Square Bullet 
  15026.     <Γòû4> - Large  Square Bullet 
  15027.     <Γòû5> - Large  Outline Square Bullet 
  15028.     <Γòû6> - Small  Diamond Bullet 
  15029.     <Γòû7> - Large  Diamond Bullet 
  15030.     <Γòû8> - Small  Open Circle Bullet 
  15031.     <Γòû9> - Large  Open Circle Bullet 
  15032.     <Γòû10> - Check  Mark 
  15033.     <Γòû11> - Tack 
  15034.     <Γòû12> - Square shadow below bullet 
  15035.     <Γòû13> - Square shadow above bullet 
  15036.     <Γòû14> - Check box 
  15037.     <Γòû15> - Square with X bullet 
  15038.     <Γòû16> - Rounded arrowhead top shaded 
  15039.     <Γòû17> - Rounded arrowhead bottom shaded 
  15040. To type the dot in front of the bullet number, turn on Num Lock, hold the ALT 
  15041. key, and type 0183, and release the ALT key. 
  15042.  
  15043. Numbers can be inserted by typing the following text where the number should be 
  15044. inserted: 
  15045.     <#1> - 1 2 3 4 5... 
  15046.     <#2> - A B C D E... 
  15047.     <#3> - a b c d e... 
  15048.     <#4> - I II III IV V... 
  15049.     <#5> - i ii iii iv v... 
  15050.     <#6> - * ** *** ****... 
  15051.  
  15052. Return Value 
  15053. 1  (TRUE) if the outline style is created. 
  15054. 0  (UserCancel) if the user canceled the function. 
  15055.  
  15056. Example 
  15057. FUNCTION Example() 
  15058. OutlineStyle(1, "Body Text", 1, 4, "<Γòû17>") 
  15059. END FUNCTION 
  15060.  
  15061. See also: 
  15062.  
  15063.     ModifyStyle 
  15064.     OutlineLevels 
  15065.     OutlineMode 
  15066.  
  15067.  
  15068.  
  15069.  
  15070.  
  15071. ΓòÉΓòÉΓòÉ 330. PageBreak ΓòÉΓòÉΓòÉ
  15072.  
  15073. This function inserts or removes a page break at the insertion point. This 
  15074. function is equivalent to choosing Page Breaks. 
  15075.  
  15076.  
  15077. Syntax 
  15078. PageBreak(Function) 
  15079. Function is the page break function desired. The Function parameter defines the 
  15080. page break function to use, according to the following list: 
  15081.     InsBreak (1) - Insert page break 
  15082.     DelBreak (2) - Remove page break 
  15083.     CenterBreak (3) - Vertically center text above page break 
  15084.     InsColBreak (4) - Insert column break 
  15085.     DelColBreak (5) - Remove column break 
  15086.  
  15087. To display the Page Breaks dialog box and allow the user to choose the page 
  15088. break options: PageBreak 
  15089.  
  15090. Return Value 
  15091. 1  (TRUE) if the page break was inserted or removed. 
  15092. 0  (UserCancel) if the user canceled the function. 
  15093. -2  (GeneralFailure) if the break was not inserted or removed. 
  15094.  
  15095. Example 
  15096. FUNCTION Example() 
  15097. PageBreak(1) 
  15098. END FUNCTION 
  15099.  
  15100. See also: 
  15101.  
  15102.     InsertLayout 
  15103.  
  15104.  
  15105. ΓòÉΓòÉΓòÉ 331. PageNumber ΓòÉΓòÉΓòÉ
  15106.  
  15107. This function is equivalent to choosing Page Page Numbering. 
  15108.  
  15109.  
  15110. Syntax 
  15111. PageNumber(Text, StartOn, StartNum, Style) 
  15112. Text is the leading text to use for the page number. If no leading text is 
  15113. used, this parameter should be the null string (""). 
  15114. StartOn is the page number to start the numbering on. 
  15115. StartNum is the number to use for the first numbered page. 
  15116. Style is the numbering style to use for the number and can be one of the 
  15117. following: 
  15118.     (1) - 1, 2, 3, 4, 5 
  15119.     (I) - I, II, III, IV, V, VI 
  15120.     (i) - i, ii, iii, iv, v, vi 
  15121.     (A) - A, B, C, D, E, F 
  15122.     (a) - a, b, c, d, e, f 
  15123.  
  15124. To display the Page Numbering dialog box and allow the user to choose the page 
  15125. number: PageNumber 
  15126.  
  15127. Return Value 
  15128. 1  (TRUE) if the page number was inserted. 
  15129. 0  (UserCancel) if the user canceled the function. 
  15130. -2  (GeneralFailure) if the number was not inserted. 
  15131.  
  15132. Example 
  15133. FUNCTION Example() 
  15134. PageNumber("Page", 1, 1, 1) 
  15135. END FUNCTION 
  15136.  
  15137. See also: 
  15138.  
  15139.     LineNumber 
  15140.  
  15141.  
  15142. ΓòÉΓòÉΓòÉ 332. Paste ΓòÉΓòÉΓòÉ
  15143.  
  15144. This function pastes the contents of the clipboard at the location of the 
  15145. insertion point. This function is equivalent to choosing Edit Paste. 
  15146.  
  15147.  
  15148. Syntax 
  15149. Paste() 
  15150.  
  15151. Return Value 
  15152. 1  (TRUE) if the text was pasted. 
  15153. -2  (GeneralFailure) if the text could not be pasted or if there was no text to 
  15154. paste. 
  15155.  
  15156. Example 
  15157. FUNCTION Example() 
  15158. Stuff = Query$("Enter what you want put on the clipboard:") 
  15159. ClipboardWrite(Stuff, 1) 
  15160. CALL Example2() 
  15161. END FUNCTION 
  15162.  
  15163. FUNCTION Example2() 
  15164. Paste() 
  15165. TYPE("[Enter]Should look exactly like the line below:[Enter]") 
  15166. TYPE(ClipboardRead(1)) 
  15167. END FUNCTION 
  15168.  
  15169. See also: 
  15170.  
  15171.     Copy 
  15172.     CurChar$ 
  15173.     CurShade$ 
  15174.     CurWord$ 
  15175.     Cut 
  15176.  
  15177.  
  15178. ΓòÉΓòÉΓòÉ 333. Pause ΓòÉΓòÉΓòÉ
  15179.  
  15180. This function allows the macro to pause for a set period of time before 
  15181. continuing. 
  15182.  
  15183.  
  15184. Syntax 
  15185. Pause(Time) 
  15186. Time is the amount of time to pause, in tenths of seconds. 
  15187.  
  15188. Return Value 
  15189. This function does not return a value. 
  15190.  
  15191. Example 
  15192. FUNCTION Example() 
  15193. TYPE("Hello...") 
  15194. PAUSE(030) 
  15195. TYPE("There!") 
  15196. END FUNCTION 
  15197.  
  15198. See also: 
  15199.  
  15200.     GetTime 
  15201.     HourGlass 
  15202.     RunLater 
  15203.  
  15204.  
  15205. ΓòÉΓòÉΓòÉ 334. PhysicalToLogical ΓòÉΓòÉΓòÉ
  15206.  
  15207. This function returns the logical page number in a master document, given the 
  15208. physical page number. 
  15209.  
  15210.  
  15211. Syntax 
  15212. PhysicalToLogical(Page) 
  15213. Page is the page number that appears when the file is opened for viewing. 
  15214.  
  15215. Return Value 
  15216. The logical page number (the number that actually prints in a master document 
  15217. print). 
  15218. 0  (UserCancel) if the user canceled the function. 
  15219.  
  15220. Example 
  15221. FUNCTION Example() 
  15222. MacFile = GetRunningMacroFile$() 
  15223. Count = GetBookMarkCount() 
  15224. IF Count > 0 
  15225.     DIM Bookmarks(Count) 
  15226.     GetBookMarkNames(&Bookmarks) 
  15227.     DeleteMenu(1, "&Bookmarks") 
  15228.     AddMenu(1, "&Bookmarks") 
  15229.     FOR I = 1 to Count 
  15230.        ThisBookmark = Bookmarks(I) 
  15231.        AddMenuItem(1, "&Bookmarks", ThisBookmark, "{MacFile}!Example2( 
  15232.  {ThisBookmark})", ThisBookmark) 
  15233.     NEXT 
  15234. ELSE 
  15235.     Message("No bookmarks in this document!") 
  15236. ENDIF 
  15237. END FUNCTION 
  15238.  
  15239. FUNCTION Example2(Bkmk) 
  15240. MarkBookMark(Bkmk, FindBookmark) 
  15241. PhysicalPage = GetBookMarkPage(Bkmk) 
  15242. LogicalPage = PhysicalToLogical(GetBookMarkPage(Bkmk)) 
  15243. Message("{Bkmk} is on physical page {PhysicalPage} and logical page 
  15244. {LogicalPage}.") 
  15245. END FUNCTION 
  15246.  
  15247. See also: 
  15248.  
  15249.     GetBookMarkPage 
  15250.     GetFmtPageStr$ 
  15251.  
  15252.  
  15253. ΓòÉΓòÉΓòÉ 335. PrintEnvelope ΓòÉΓòÉΓòÉ
  15254.  
  15255. This function displays the Print Envelope dialog box. This function does not 
  15256. automatically print the envelope. This function is equivalent to choosing File 
  15257. Print Envelope. 
  15258.  
  15259.  
  15260. Syntax 
  15261. PrintEnvelope() 
  15262.  
  15263. Return Value 
  15264. This function returns 1. 
  15265.  
  15266. Example 
  15267. FUNCTION Example() 
  15268. PrintEnvelope() 
  15269. END FUNCTION 
  15270.  
  15271. See also: 
  15272.  
  15273.     FilePrint 
  15274.     PrintSetup 
  15275.  
  15276.  
  15277. ΓòÉΓòÉΓòÉ 336. PrintOptions ΓòÉΓòÉΓòÉ
  15278.  
  15279. This function sets print options to use for print and merge. If this function 
  15280. is not used before printing and merging, the default options are used for 
  15281. printing the document. This function is equivalent to choosing File Print and 
  15282. choosing Options. 
  15283.  
  15284.  
  15285. Syntax 
  15286. PrintOptions(Flag, 0, 0) 
  15287. Flag is a number that defines the value of other print options and may be one 
  15288. or more of the following: 
  15289.     Reverse (2) - Prints the document in reverse order. 
  15290.     Collate (4) - Collate multiple copy output. 
  15291.     CropMarks (16) - Print the document with crop marks. 
  15292.     PrePrinted (64) - Print the document on preprinted forms. 
  15293.     PrintUpdateFields (128) - Updates power fields before printing. 
  15294.     PrintNoPictures (2048) - Prints the document without pictures. To print 
  15295.     with pictures do not use this value. 
  15296. The desired options should be added together to make up the value of the  flag 
  15297. parameter. 
  15298.  
  15299. To display the Merge dialog box and allow the user to set print options for 
  15300. merge: Merge 
  15301.  
  15302. To display the Print dialog box and allow the user to set print options for 
  15303. print: FilePrint 
  15304.  
  15305. Return Value 
  15306. 1  (TRUE) if the print options were set. 
  15307. 0  (UserCancel) if the user canceled the function. 
  15308. -2  (GeneralFailure) if the print options were not set. 
  15309.  
  15310. Example 
  15311. FUNCTION Example() 
  15312. 'print crop marks 
  15313. PrintOptions(16, 0, 0) 
  15314. FilePrint(1, 1, 9999, 1) 
  15315. END FUNCTION 
  15316.  
  15317. See also: 
  15318.  
  15319.     FilePrint 
  15320.     Merge 
  15321.     MergeMacro 
  15322.     MergeToFile 
  15323.  
  15324.  
  15325. ΓòÉΓòÉΓòÉ 337. PrintSetup ΓòÉΓòÉΓòÉ
  15326.  
  15327. This function selects a new printer and printer port for the current document. 
  15328. This function is equivalent to choosing File Printer Setup. 
  15329.  
  15330.  
  15331. Syntax 
  15332. PrintSetup(Printer, Port) 
  15333. Printer is the name of the printer that must be used for this document. 
  15334. Port is the name of the port to which the printer is attached. 
  15335.  
  15336. To display the Printer Setup dialog box and allow the user to select the name 
  15337. of the printer to use or to allow the printer to be configured: PrintSetup 
  15338.  
  15339. Return Value 
  15340. 1  (TRUE) if the named printer was successfully selected for the document. 
  15341. 0  (UserCancel) if the user canceled the function. 
  15342. -2  (GeneralFailure) if the printer name was incorrect. 
  15343.  
  15344. Example 
  15345. FUNCTION Example() 
  15346. PrintSetup("Apple LaserWriter II NTX", "LPT1:") 
  15347. Message("Printer changed to LaserWriter on LPT1") 
  15348. END FUNCTION 
  15349.  
  15350. See also: 
  15351.  
  15352.     FilePrint 
  15353.  
  15354.  
  15355. ΓòÉΓòÉΓòÉ 338. ProtectCells ΓòÉΓòÉΓòÉ
  15356.  
  15357. This function sets protection of the selected table cells. It acts as a toggle, 
  15358. turning off the protection if it is currently on or turning on the protection 
  15359. if it is currently off. This function is equivalent to choosing Table Protect 
  15360. Cells. 
  15361.  
  15362.  
  15363. The insert point must be in a table to use this function. 
  15364.  
  15365. Syntax 
  15366. ProtectCells([on]) 
  15367. On is an optional parameter that turns protection on. 
  15368. Return Value 
  15369. 1  (TRUE) if the cells were protected or unprotected. 
  15370. -2  (GeneralFailure) if the cells could not be protected or unprotected or if 
  15371. the program was not in  tables mode. 
  15372. -6  (NoMemory) if the function failed because of insufficient memory. 
  15373.  
  15374. Example 
  15375. FUNCTION Example() 
  15376. ProtectCells() 
  15377. END FUNCTION 
  15378.  
  15379. See also: 
  15380.  
  15381.     ConnectCells 
  15382.     TableLayout 
  15383.     Tables 
  15384.  
  15385.  
  15386. ΓòÉΓòÉΓòÉ 339. Query ΓòÉΓòÉΓòÉ
  15387.  
  15388. This function displays a message box with a specified prompt, an edit box for 
  15389. the user to enter string data to be sent back to the macro, and OK and Cancel 
  15390. buttons. You can use Query$ to request information from the user. 
  15391.  
  15392.  
  15393. Syntax 
  15394. Query$(Prompt[, Text]) 
  15395. Prompt is a string passed as a prompt to the user. Ami Pro accepts a maximum of 
  15396. 80 characters. However, the number of characters that actually display depends 
  15397. on the font used for dialog boxes. 
  15398. Text is an optional parameter that displays in the edit box as a default. 
  15399.  
  15400. Return Value 
  15401. The string typed by the user. 
  15402. Null string ("") if the user does not type anything. 
  15403. If the user chooses Cancel instead of OK, the macro executes the ONCANCEL 
  15404. routine (if one has been defined). 
  15405.  
  15406. Example 
  15407. FUNCTION Example() 
  15408. name = Query$("What is your name?", "Cassie") 
  15409. Message("Hi, {name}") 
  15410. END FUNCTION 
  15411.  
  15412. See also: 
  15413.  
  15414.     Decide 
  15415.     DialogBox 
  15416.     Message 
  15417.     Using the ONCANCEL Statement 
  15418.     UserControl 
  15419.  
  15420.  
  15421.  
  15422. ΓòÉΓòÉΓòÉ 340. QuickAddCol ΓòÉΓòÉΓòÉ
  15423.  
  15424. This function sums a column and places the results in the current cell. This 
  15425. function is equivalent to choosing Table Quick Add Column. 
  15426.  
  15427.  
  15428. Syntax 
  15429. QuickAddCol() 
  15430.  
  15431. Return Value 
  15432. 1  (TRUE) if the column was added. 
  15433. -6  (NoMemory) if the function failed because of insufficient memory. 
  15434.  
  15435. Example 
  15436. FUNCTION Example() 
  15437. Message("Adding the current column of numbers") 
  15438. QuickAddCol() 
  15439. END FUNCTION 
  15440.  
  15441. See also: 
  15442.  
  15443.     SetFormula 
  15444.     EditFormula 
  15445.     QuickAddRow 
  15446.  
  15447.  
  15448.  
  15449. ΓòÉΓòÉΓòÉ 341. QuickAddRow ΓòÉΓòÉΓòÉ
  15450.  
  15451. This function sums a row and places the results in the current cell. This 
  15452. function is equivalent to choosing Table Quick Add Row. 
  15453.  
  15454.  
  15455. Syntax 
  15456. QuickAddRow() 
  15457.  
  15458. Return Value 
  15459. 1  (TRUE) if the row was added. 
  15460. -6  (NoMemory) if the function failed because of insufficient memory. 
  15461.  
  15462. Example 
  15463. FUNCTION Example() 
  15464. Message("Adding the current row of numbers") 
  15465. QuickAddRow() 
  15466. END FUNCTION 
  15467.  
  15468. See also: 
  15469.  
  15470.     EditFormula 
  15471.     QuickAddCol 
  15472.     SetFormula 
  15473.  
  15474.  
  15475.  
  15476. ΓòÉΓòÉΓòÉ 342. ReadMail ΓòÉΓòÉΓòÉ
  15477.  
  15478. This function allows you to view any messages that have been received. This 
  15479. function is equivalent to clicking the mail button on the status bar (to the 
  15480. left of the Insert Type Rev button). If the mail server is running, the server 
  15481. is activated so you can view the mail that has been received. 
  15482.  
  15483.  
  15484. This function is only available if Lotus Notes is installed. 
  15485.  
  15486. Syntax 
  15487. ReadMail() 
  15488.  
  15489. Return Value 
  15490. 1  (TRUE) if the mail server was activated to view the mail. 
  15491. 0  (NoAction) if the mail server was not running or if there is no mail. 
  15492.  
  15493. Example 
  15494. FUNCTION Example() 
  15495. result = ReadMail() 
  15496. IF result = 0 
  15497.     Message("No mail.") 
  15498. ENDIF 
  15499. END FUNCTION 
  15500.  
  15501. See also: 
  15502.  
  15503.     SendMail 
  15504.  
  15505.  
  15506.  
  15507. ΓòÉΓòÉΓòÉ 343. RecClose ΓòÉΓòÉΓòÉ
  15508.  
  15509. This function closes the data file that was opened by the RecOpen function. 
  15510. This data file is in memory. 
  15511.  
  15512.  
  15513. Syntax 
  15514. RecClose(Handle) 
  15515. Handle is the file ID handle returned by the RecOpen function. 
  15516.  
  15517. Return Value 
  15518. 1  (TRUE) if the data file was closed. 
  15519. -2  (GeneralFailure) if the data file could not be closed. 
  15520.  
  15521. Example 
  15522. FUNCTION Example() 
  15523. DIM field(12) 
  15524. handle = RecOpen("DATAFILE.SAM", "") 
  15525. Message(handle) 
  15526. IF handle THEN 
  15527.     numfields = RecFieldCount(handle) 
  15528.     Message("There are {numfields} fields:") 
  15529.     IF numfields>12 THEN 
  15530.        Message("Warning - Cannot display all fields") 
  15531.        numfields=12 
  15532.     ENDIF 
  15533.     FOR I = 1 to numfields 
  15534.        name=(RecFieldName$(handle, I)) 
  15535.        Message("Field name = {name}") 
  15536.        field(i)=name 
  15537.     NEXT 
  15538.     WHILE RecNextRec(handle)=0 
  15539.        FOR i=1 TO numfields 
  15540.            name=(RecGetField(handle, field(i))) 
  15541.            Message("Field value = {name}") 
  15542.        NEXT 
  15543.     WEND 
  15544.     RecClose(handle) 
  15545. ELSE 
  15546.     Message("Could not open document") 
  15547. ENDIF 
  15548. END FUNCTION 
  15549.  
  15550. See also: 
  15551.  
  15552.     RecFieldCount 
  15553.     RecFieldName$ 
  15554.     RecGetField 
  15555.     RecNextRec 
  15556.     RecOpen 
  15557.  
  15558.  
  15559. ΓòÉΓòÉΓòÉ 344. RecFieldCount ΓòÉΓòÉΓòÉ
  15560.  
  15561. This function counts the number of fields in the specified data file. This data 
  15562. file is in memory. 
  15563.  
  15564.  
  15565. Syntax 
  15566. RecFieldCount(Handle) 
  15567. Handle is the file ID handle returned by the RecOpen function. 
  15568.  
  15569. Return Value 
  15570. The number of fields in the data file. 
  15571. -2  (GeneralFailure) if the number of fields could not be determined. 
  15572.  
  15573. Example 
  15574. FUNCTION Example() 
  15575. DIM field(12) 
  15576. handle = RecOpen("DATAFILE.SAM", "") 
  15577. Message(handle) 
  15578. IF handle THEN 
  15579.     numfields = RecFieldCount(handle) 
  15580.     Message("There are {numfields} fields:") 
  15581.     IF numfields>12 THEN 
  15582.        Message("Warning - Cannot display all fields") 
  15583.        numfields=12 
  15584.     ENDIF 
  15585.     FOR I = 1 to numfields 
  15586.        name=(RecFieldName$(handle, I)) 
  15587.        Message("Field name = {name}") 
  15588.        field(i)=name 
  15589.     NEXT 
  15590.     WHILE RecNextRec(handle)=0 
  15591.        FOR i=1 TO numfields 
  15592.            name=(RecGetField(handle, field(i))) 
  15593.            Message("Field value = {name}") 
  15594.        NEXT 
  15595.     WEND 
  15596.     RecClose(handle) 
  15597. ELSE 
  15598.     Message("Could not open document") 
  15599. ENDIF 
  15600. END FUNCTION 
  15601.  
  15602. See also: 
  15603.  
  15604.     RecClose 
  15605.     RecFieldName$ 
  15606.     RecGetField 
  15607.     RecNextRec 
  15608.     RecOpen 
  15609.  
  15610.  
  15611. ΓòÉΓòÉΓòÉ 345. RecFieldName ΓòÉΓòÉΓòÉ
  15612.  
  15613. This function retrieves the name of the field for the specified field number. 
  15614. The name is retrieved from the data file in memory. 
  15615.  
  15616.  
  15617. Syntax 
  15618. RecFieldName$(Handle, FieldNumber) 
  15619. Handle is the file ID handle returned by the RecOpen function. 
  15620. FieldNumber is the number of the field name to retrieve from the field names 
  15621. paragraph in the data file. 
  15622.  
  15623. Return Value 
  15624. A string containing the requested field name. 
  15625. -2  (GeneralFailure) if the field name could not be extracted. 
  15626.  
  15627. Example 
  15628. FUNCTION Example() 
  15629. DIM field(12) 
  15630. handle = RecOpen("DATAFILE.SAM", "") 
  15631. Message(handle) 
  15632. IF handle THEN 
  15633.     numfields = RecFieldCount(handle) 
  15634.     Message("There are {numfields} fields:") 
  15635.     IF numfields>12 THEN 
  15636.        Message("Warning - Cannot display all fields") 
  15637.        numfields=12 
  15638.     ENDIF 
  15639.     FOR I = 1 to numfields 
  15640.        name=(RecFieldName$(handle, I)) 
  15641.        Message("Field name = {name}") 
  15642.        field(i)=name 
  15643.     NEXT 
  15644.     WHILE RecNextRec(handle)=0 
  15645.        FOR i=1 TO numfields 
  15646.            name=(RecGetField(handle, field(i))) 
  15647.            Message("Field value = {name}") 
  15648.        NEXT 
  15649.     WEND 
  15650.     RecClose(handle) 
  15651. ELSE 
  15652.     Message("Could not open document") 
  15653. ENDIF 
  15654. END FUNCTION 
  15655.  
  15656. See also: 
  15657.  
  15658.     RecClose 
  15659.     RecFieldCount 
  15660.     RecGetField 
  15661.     RecNextRec 
  15662.     RecOpen 
  15663.  
  15664.  
  15665. ΓòÉΓòÉΓòÉ 346. RecGetField ΓòÉΓòÉΓòÉ
  15666.  
  15667. This function retrieves the contents of the specified field in the current 
  15668. record. The name is retrieved from the data file in memory. 
  15669.  
  15670.  
  15671. Syntax 
  15672. RecGetField(Handle, "FieldName") 
  15673. Handle is the file ID handle returned by the RecOpen function. 
  15674. FieldName is the name of the field to retrieve from the current record in the 
  15675. data file. 
  15676.  
  15677. Return Value 
  15678. The contents of the specified field. 
  15679. -2  (GeneralFailure) if the contents could not be retrieved. 
  15680.  
  15681. Example 
  15682. FUNCTION Example() 
  15683. DIM field(12) 
  15684. handle = RecOpen("DATAFILE.SAM", "") 
  15685. Message(handle) 
  15686. IF handle THEN 
  15687.     numfields = RecFieldCount(handle) 
  15688.     Message("There are {numfields} fields:") 
  15689.     IF numfields>12 THEN 
  15690.        Message("Warning - Cannot display all fields") 
  15691.        numfields=12 
  15692.     ENDIF 
  15693.     FOR I = 1 to numfields 
  15694.        name=(RecFieldName$(handle, I)) 
  15695.        Message("Field name = {name}") 
  15696.        field(i)=name 
  15697.     NEXT 
  15698.     WHILE RecNextRec(handle)=0 
  15699.        FOR i=1 TO numfields 
  15700.            name=(RecGetField(handle, field(i))) 
  15701.            Message("Field value = {name}") 
  15702.        NEXT 
  15703.     WEND 
  15704.     RecClose(handle) 
  15705. ELSE 
  15706.     Message("Could not open document") 
  15707. ENDIF 
  15708. END FUNCTION 
  15709.  
  15710. See also: 
  15711.  
  15712.     RecClose 
  15713.     RecFieldCount 
  15714.     RecFieldName$ 
  15715.     RecNextRec 
  15716.     RecOpen 
  15717.  
  15718.  
  15719. ΓòÉΓòÉΓòÉ 347. RecNextRec ΓòÉΓòÉΓòÉ
  15720.  
  15721. This function advances the record pointer to the next record in the specified 
  15722. data file. This data file is in memory. 
  15723.  
  15724.  
  15725. Syntax 
  15726. RecNextRec(Handle) 
  15727. Handle is the file ID handle returned by the RecOpen function. 
  15728.  
  15729. Return Value 
  15730. 0  if the action was successful. 
  15731. -1  if the end of the file was reached. 
  15732.  
  15733. Example 
  15734. FUNCTION Example() 
  15735. DIM field(12) 
  15736. handle = RecOpen("DATAFILE.SAM", "") 
  15737. Message(handle) 
  15738. IF handle THEN 
  15739.     numfields = RecFieldCount(handle) 
  15740.     Message("There are {numfields} fields:") 
  15741.     IF numfields>12 THEN 
  15742.        Message("Warning - Cannot display all fields") 
  15743.        numfields=12 
  15744.     ENDIF 
  15745.     FOR I = 1 to numfields 
  15746.        name=(RecFieldName$(handle, I)) 
  15747.        Message("Field name = {name}") 
  15748.        field(i)=name 
  15749.     NEXT 
  15750.     WHILE RecNextRec(handle)=0 
  15751.        FOR i=1 TO numfields 
  15752.            name=(RecGetField(handle, field(i))) 
  15753.            Message("Field value = {name}") 
  15754.        NEXT 
  15755.     WEND 
  15756.     RecClose(handle) 
  15757. ELSE 
  15758.     Message("Could not open document") 
  15759. ENDIF 
  15760. END FUNCTION 
  15761.  
  15762. See also: 
  15763.  
  15764.     RecClose 
  15765.     RecFieldCount 
  15766.     RecFieldName$ 
  15767.     RecGetField 
  15768.     RecOpen 
  15769.  
  15770.  
  15771. ΓòÉΓòÉΓòÉ 348. RecOpen ΓòÉΓòÉΓòÉ
  15772.  
  15773. This function allows you to open an existing data file. 
  15774.  
  15775.  
  15776. Syntax 
  15777. RecOpen(FileName, Description[, Options]) 
  15778. FileName is the name of the data file to open. You must include the full path 
  15779. as well as the file name. 
  15780. Description is the description file. If the data file is an Ami Pro document, 
  15781. the description is the null string (""). 
  15782. Options is the filter type when import filters are used to read the data file. 
  15783.  
  15784. Return Value 
  15785. A positive number if the record is opened. 
  15786. 0  (FALSE) if the record is not opened. 
  15787.  
  15788. Example 
  15789. FUNCTION Example() 
  15790. DIM field(12) 
  15791. handle = RecOpen("DATAFILE.SAM", "") 
  15792. Message(handle) 
  15793. IF handle THEN 
  15794.     numfields = RecFieldCount(handle) 
  15795.     Message("There are {numfields} fields:") 
  15796.     IF numfields>12 THEN 
  15797.        Message("Warning - Cannot display all fields") 
  15798.        numfields=12 
  15799.     ENDIF 
  15800.     FOR I = 1 to numfields 
  15801.        name=(RecFieldName$(handle, I)) 
  15802.        Message("Field name = {name}") 
  15803.        field(i)=name 
  15804.     NEXT 
  15805.     WHILE RecNextRec(handle)=0 
  15806.        FOR i=1 TO numfields 
  15807.            name=(RecGetField(handle, field(i))) 
  15808.            Message("Field value = {name}") 
  15809.        NEXT 
  15810.     WEND 
  15811.     RecClose(handle) 
  15812. ELSE 
  15813.     Message("Could not open document") 
  15814. ENDIF 
  15815. END FUNCTION 
  15816.  
  15817. See also: 
  15818.  
  15819.     RecClose 
  15820.     RecFieldCount 
  15821.     RecFieldName$ 
  15822.     RecGetField 
  15823.     RecNextRec 
  15824.  
  15825.  
  15826.  
  15827. ΓòÉΓòÉΓòÉ 349. RemoveLayout ΓòÉΓòÉΓòÉ
  15828.  
  15829. This function deletes the page layout for the current page. The page layout for 
  15830. the previous page is effective for the current page. If the page layout deleted 
  15831. was for the first page, the original (default) page layout is in effect. This 
  15832. function is equivalent to choosing Page Insert Page Layout Remove. 
  15833.  
  15834.  
  15835. You must be in Layout Mode to use this function. 
  15836.  
  15837. Syntax 
  15838. RemoveLayout() 
  15839.  
  15840. Return Value 
  15841. 1  (TRUE) if the page layout was deleted. 
  15842. -2  if the page layout was not deleted. 
  15843. 0  (NoAction) if no action was taken. 
  15844. -6  (NoMemory) if the function failed because of insufficient memory. 
  15845.  
  15846. Example 
  15847. FUNCTION Example() 
  15848. choice = Decide("This will remove the current page layout. Continue?") 
  15849. IF choice = 1 
  15850.   RemoveLayout() 
  15851. ENDIF 
  15852. END FUNCTION 
  15853.  
  15854. See also: 
  15855.  
  15856.     InsertLayout 
  15857.     RevertLayout 
  15858.  
  15859.  
  15860. ΓòÉΓòÉΓòÉ 350. RenameDocInfoField ΓòÉΓòÉΓòÉ
  15861.  
  15862. This function renames the eight user defined document information fields. This 
  15863. function is equivalent to choosing File Doc Info, selecting Fields, and then 
  15864. selecting Rename Fields. 
  15865.  
  15866.  
  15867. Syntax 
  15868. RenameDocInfoField(FieldNumber, Field) 
  15869. FieldNumber is the number of the field to rename. The first field number is 0. 
  15870. Field is the new name for the field. 
  15871.  
  15872. To display the Document Info dialog box and allow the user to choose names for 
  15873. the fields: DocInfo 
  15874.  
  15875. Return Value 
  15876. 1  (TRUE) if the new document info field name was saved. 
  15877. -2  (GeneralFailure) if the name was not saved. 
  15878.  
  15879. Example 
  15880. FUNCTION Example() 
  15881. FieldNum = Query$("What field do you want to rename?") 
  15882. FieldName = Query$("What do you want to rename field #{FieldNum} to?") 
  15883. RenameDocInfoField(FieldNum, FieldName) 
  15884. END FUNCTION 
  15885.  
  15886. See also: 
  15887.  
  15888.     DocInfo 
  15889.     InsertDocInfo 
  15890.  
  15891.  
  15892. ΓòÉΓòÉΓòÉ 351. RenameMenuItem ΓòÉΓòÉΓòÉ
  15893.  
  15894. This function gives a new name to an existing menu item. RenameMenuItem does 
  15895. not change the functionality of the menu item, but simply gives it a new name. 
  15896. The new name displays the next time the user displays the pulldown menu. 
  15897.  
  15898.  
  15899. Syntax 
  15900. RenameMenuItem(BarID, Menu[, CascadeMenu], OldName, NewName) 
  15901. BarID is the identification number of the menu bar and must always be 1. 
  15902. Menu is the name of the pull down menu that contains the item you wish to 
  15903. rename. This must match exactly the name of the pull down menu you want to 
  15904. modify, including ampersand (&) characters. An ampersand is placed before a 
  15905. character that has an underline. 
  15906. CascadeMenu is the optional Cascade menu name that contains the item you wish 
  15907. to rename. This must match exactly the name of the cascade menu you want to 
  15908. modify, including ampersand (&) characters. 
  15909. OldName is the current name of the menu item. 
  15910. NewName is the new name to use for the menu item. 
  15911.  
  15912. Return Value 
  15913. 1  (TRUE) if the item was successfully renamed. 
  15914. 0  (FALSE) if the item could not be found. 
  15915.  
  15916. Example 
  15917. FUNCTION Example() 
  15918. RenameMenuItem(1, "&File", "E&xit", "&Quit") 
  15919. END FUNCTION 
  15920.  
  15921. See also: 
  15922.  
  15923.     AddMenu 
  15924.     AddMenuItem 
  15925.     ChangeMenuAction 
  15926.     CheckMenuItem 
  15927.     DeleteMenu 
  15928.     DeleteMenuItem 
  15929.     GrayMenuItem 
  15930.  
  15931.  
  15932.  
  15933.  
  15934. ΓòÉΓòÉΓòÉ 352. Replace ΓòÉΓòÉΓòÉ
  15935.  
  15936. This function finds and optionally replaces text or paragraph styles in a 
  15937. document. This function is equivalent to choosing Edit Find & Replace. If the 
  15938. macro replaces all the occurrences of a phrase or paragraph style, the macro 
  15939. works as if the user initiated Find & Replace and issued the Replace All 
  15940. command. If the ReplaceAll flag is not used, this function finds the first 
  15941. occurrence of the target phrase and continues with the macro. If the ReplaceAll 
  15942. flag is not used, this function does not perform a replacement. 
  15943.  
  15944.  
  15945. The Replace function is not interactive. If an interactive Find & Replace is 
  15946. desired, use the FindReplace function. 
  15947.  
  15948. A macro must be edited to insert this non-recordable function. 
  15949.  
  15950. Syntax 
  15951. Replace(SourceAttr, DestAttr, Flag, FindString, ReplaceString) 
  15952. SourceAttr is the attribute combination for the source string and can be one or 
  15953. more of the following: 
  15954.     NormalAttr (0) - Text without any attributes 
  15955.     BoldText (4) - Bold  Text 
  15956.     ItalicText (8) - Italicized text 
  15957.     UnderlineText (16) - Underlined text 
  15958.     WordUnderlineText (32) - Word underlined text 
  15959.     SmallCaps (-32768) - Small caps text 
  15960. Multiple attributes can be specified by adding the SourceAttr values together. 
  15961. DestAttr is the attribute combination for the destination string and can be one 
  15962. or more of the following: 
  15963.     NormalAttr (0) - Text without any attributes 
  15964.     BoldText (4) - Bold  Text 
  15965.     ItalicText (8) - Italicized text 
  15966.     UnderlineText (16) - Underlined text 
  15967.     WordUnderlineText (32) - Word underlined text 
  15968.     SmallCaps (-32768) - Small caps text 
  15969. Multiple attributes can be specified by adding the DestAttr values together. 
  15970. Flag is a flag that defines the options for the Find & Replace and can be one 
  15971. or more of the following: 
  15972.     FindExact (1) - Find only text with same capitalization as typed in search 
  15973.     string 
  15974.     FindStyles (2) - Find/replace paragraph styles instead of text 
  15975.     FindWholeWord (4) - Find only whole words 
  15976.     FindBackwards (8) - Find from the current cursor position to the beginning 
  15977.     of the document 
  15978.     ReplaceExact (16) - Replace using capitalization specified for replace 
  15979.     string 
  15980.     ReplaceExactAttr (32) - Replace using attributes specified, rather than as 
  15981.     found 
  15982.     FindExactAttr (64) - Find only text with same attributes as specified 
  15983.     ReplaceAll (1024) - Replace all occurrences without stopping for 
  15984.     confirmation. If the ReplaceAll flag is not used, this function does not 
  15985.     perform a replacement. 
  15986.     FindFromPage1 (8192) - Start search on page 1 of document 
  15987.     FindCurrentStream (16384) - Find only in the current text stream 
  15988.     Note: Setting this option turns off the option to search in other text 
  15989.     streams, unlike the other flags, which turn on the option. 
  15990. Multiple options can be specified by adding values together. 
  15991. FindString is the string or paragraph style to search for. 
  15992. ReplaceString is the string or paragraph style name to replace with. If the 
  15993. ReplaceAll flag is not used, this parameter is ignored. 
  15994.  
  15995. To display the Find/Replace dialog box and allow the user to determine the 
  15996. parameters for the find and replace operation: FindReplace 
  15997.  
  15998. Return Value 
  15999. 1  (TRUE) if the find/replace function was successful. 
  16000. -7  (EndFile) if the end of the file was reached or if no match was found. 
  16001. Since a global replacement always reaches the end of the file, this function 
  16002. always returns EndFile if the ReplaceAll option is used. 
  16003. -6  (NoMemory) if the function failed because of insufficient memory. 
  16004.  
  16005. Example 
  16006. FUNCTION Example() 
  16007. Message("Replacing a's with x's") 
  16008. Replace(0, 0, 0, "a", "x") 
  16009. END FUNCTION 
  16010.  
  16011. See also: 
  16012.  
  16013.     FindReplace 
  16014.     GoToCmd 
  16015.  
  16016.  
  16017.  
  16018.  
  16019. ΓòÉΓòÉΓòÉ 353. Restore ΓòÉΓòÉΓòÉ
  16020.  
  16021. This function restores the Ami Pro window to the size of the last non-full 
  16022. screen window. This function is equivalent to choosing System Restore. 
  16023.  
  16024.  
  16025. Syntax 
  16026. Restore() 
  16027.  
  16028. Return Value 
  16029. This function does not return a value. 
  16030.  
  16031. Example 
  16032. FUNCTION Example() 
  16033. Restore() 
  16034. END FUNCTION 
  16035.  
  16036. See also: 
  16037.  
  16038.     Maximize 
  16039.     Minimize 
  16040.  
  16041.  
  16042. ΓòÉΓòÉΓòÉ 354. Revert ΓòÉΓòÉΓòÉ
  16043.  
  16044. This function cancels changes made to the document since it was last saved and 
  16045. displays the previously saved version of the document. This function is 
  16046. equivalent to choosing File Revert to Saved. 
  16047.  
  16048.  
  16049. Normally, the user is given a chance to abort the revert. If you want to avoid 
  16050. this message in your macro, use the Messages function to turn off messages 
  16051. before using this function. 
  16052.  
  16053. Syntax 
  16054. Revert() 
  16055.  
  16056. Return Value 
  16057. 1  (TRUE) if the file successfully reverted to the previous version. 
  16058. -2  (GeneralFailure) if the file could not be reverted. 
  16059.  
  16060. Example 
  16061. FUNCTION Example() 
  16062. Revert() 
  16063. END FUNCTION 
  16064.  
  16065. See also: 
  16066.  
  16067.     Messages 
  16068.     SaveAs 
  16069.     Save 
  16070.  
  16071.  
  16072. ΓòÉΓòÉΓòÉ 355. RevertLayout ΓòÉΓòÉΓòÉ
  16073.  
  16074. You can use RevertLayout to insert a page layout that uses the settings in 
  16075. effect for the first page of the document. This function is equivalent to 
  16076. choosing Page Insert Page Layout Revert. 
  16077.  
  16078.  
  16079. Syntax 
  16080. RevertLayout() 
  16081.  
  16082. Return Value 
  16083. 1  (TRUE) if the page layout was successfully reverted. 
  16084. -6  (NoMemory) if the function failed because of insufficient memory. 
  16085.  
  16086. Example 
  16087. FUNCTION Example() 
  16088. RevertLayout() 
  16089. END FUNCTION 
  16090.  
  16091. See also: 
  16092.  
  16093.     InsertLayout 
  16094.     RemoveLayout 
  16095.  
  16096.  
  16097. ΓòÉΓòÉΓòÉ 356. ReviewRevisions ΓòÉΓòÉΓòÉ
  16098.  
  16099. This function initiates Revision Marking Review. If any revisions are found, 
  16100. the Review Revision Marking dialog box is displayed and the user may decide 
  16101. whether to accept, cancel, or skip the revision. This function does not 
  16102. automatically accept or cancel a revision. This function is equivalent to 
  16103. choosing Tools Revision Marking and choosing Review Revisions. 
  16104.  
  16105.  
  16106. Syntax 
  16107. ReviewRevisions() 
  16108.  
  16109. Return Value 
  16110. 1  (TRUE) if the mode was changed. 
  16111. 0  (UserCancel) if the user canceled the function. 
  16112. -2  (GeneralFailure) if the mode could not be changed. 
  16113.  
  16114. Example 
  16115. FUNCTION Example() 
  16116. ' Review revisions and turn off revision marking 
  16117. RevisionMarking(2 0) 
  16118. ReviewRevisions() 
  16119. END FUNCTION 
  16120.  
  16121. See also: 
  16122.  
  16123.     RevisionMarking 
  16124.     RevisionMarkOpts 
  16125.  
  16126.  
  16127.  
  16128.  
  16129.  
  16130. ΓòÉΓòÉΓòÉ 357. RevisionInsertion ΓòÉΓòÉΓòÉ
  16131.  
  16132. This function marks selected text as a revision insertion. This function is 
  16133. equivalent to choosing Edit Mark Text Revision Insertion. 
  16134.  
  16135.  
  16136. Syntax 
  16137. RevisionInsertion() 
  16138.  
  16139. Return Value 
  16140. 1 (TRUE) if the revision was accepted. 
  16141. 0 (NoAction) if no action was taken. 
  16142.  
  16143. Example 
  16144. FUNCTION Example() 
  16145. Message("Marking selected text for revision insertion.") 
  16146. RevisionInsertion() 
  16147. END FUNCTION 
  16148.  
  16149. See also: 
  16150.  
  16151.     ReviewRevisions 
  16152.     RevisionMarking 
  16153.     RevisionMarkOpts 
  16154.  
  16155.  
  16156.  
  16157. ΓòÉΓòÉΓòÉ 358. RevisionMarking ΓòÉΓòÉΓòÉ
  16158.  
  16159. This function turns revision marking on or off and lets you determine what 
  16160. revision marking function to perform. This function is equivalent to choosing 
  16161. Tools Revision Marking. 
  16162.  
  16163.  
  16164. Syntax 
  16165. RevisionMarking(Which, State) 
  16166. Which defines which function to perform and can be one of the following: 
  16167.     MarkRevisions (1) - Changes the revision state only 
  16168.     ReviewRevisions (2) - Step through each revision mark from the beginning of 
  16169.     the document 
  16170.     AcceptRevisions (3) - Accept all revisions in the document 
  16171.     CancelRevisions (4) - Cancel all revisions in the document 
  16172. State is a flag which determines if revision marking is in effect and can be 
  16173. one of the following: 
  16174.     RevOn (1) - Turn on revision marking 
  16175.     RevOff (0) - Turn off revision marking 
  16176.  
  16177. To display the Revision Marking dialog box and allow the user to select the 
  16178. revision marking function: RevisionMarking 
  16179.  
  16180. Return Value 
  16181. 1  (TRUE) if the changes were accepted. 
  16182. 0  (UserCancel/FALSE) if the user canceled the function or if no action was 
  16183. taken. 
  16184.  
  16185. Example 
  16186. FUNCTION Example() 
  16187. Message("Turn on revision marking.") 
  16188. RevisionMarking(1, 1) 
  16189. END FUNCTION 
  16190.  
  16191. See also: 
  16192.  
  16193.     ReviewRevisions 
  16194.     RevisionInsertion 
  16195.     RevisionMarkOpts 
  16196.  
  16197.  
  16198. ΓòÉΓòÉΓòÉ 359. RevisionMarkOpts ΓòÉΓòÉΓòÉ
  16199.  
  16200. This function is used to set the attributes and colors for marking insertions 
  16201. and deletions for revision marking. Options may also be changed for showing 
  16202. marks in margins. This function is equivalent to choosing Tools Revision 
  16203. Marking and choosing Options. 
  16204.  
  16205.  
  16206. Syntax 
  16207. RevisionMarkOpts(InsFlag, InsUseColor, InsColor, DelFlag, DelChar, DelUseColor, 
  16208. DelColor, MarksFlag, MarksChar, Position) 
  16209. InsFlag defines which attributes to use for marking insertions and can be one 
  16210. of the following: 
  16211.     RevNoAttr (0) - No attribute set for marking insertions 
  16212.     RevBold (1) - Use bold attribute for marking insertions 
  16213.     RevItalic (2) - Use italic attribute for marking insertions 
  16214.     RevbUnderline (3) - Use underline attribute for marking insertions 
  16215.     RevDblUnderline (4) - Use double underline attribute for marking insertions 
  16216. InsUseColor indicates if color is to be used for marking insertions and can be 
  16217. one of the following: 
  16218.     ColorOn (1) - Use color 
  16219.     ColorOff (0) - Do not use color 
  16220. InsColor is the color to use for marking insertions and can be one of the 
  16221. following: 
  16222.     White (16777215) 
  16223.     Cyan (16776960) 
  16224.     Yellow (65535) 
  16225.     Magenta (16711935) 
  16226.     Green (65280) 
  16227.     Red (255) 
  16228.     Blue (16711680) 
  16229.     Black (0) 
  16230. DelFlag indicates which attributes to use for marking deletions and can be one 
  16231. of the following: 
  16232.     RevNoAttr (0) - No attribute set for marking deletions 
  16233.     RevStrikeThru (1) - Strike through the delete characters 
  16234.     RevOverstrike (2) - Use the DelChar parameter to overstrike the deleted 
  16235.     characters 
  16236. DelChar is the overstrike character to use for marking deletions. 
  16237. DelUseColor sets the flag if color is to be used for marking deletions and can 
  16238. be one of the following: 
  16239.     ColorOn (1) - Use color 
  16240.     ColorOff (0) - Do not use color 
  16241. DelColor is the color to use for marking deletions and can be one of the 
  16242. following: 
  16243.     White (16777215) 
  16244.     Cyan (16776960) 
  16245.     Yellow (65535) 
  16246.     Magenta (16711935) 
  16247.     Green (65280) 
  16248.     Red (255) 
  16249.     Blue (16711680) 
  16250.     Black (0) 
  16251. MarksFlag defines the kind of mark used to show marks in margins. It is one of 
  16252. the following values: 
  16253.     RevNoAttr (0) - No attribute set for showing marks in margins 
  16254.     RevBars (1) - Use revision bar when showing marks in margins 
  16255.     RevChar (2) - Use the MarksChar to show marks in margins 
  16256. MarksChar is the character used for showing marks in margins. 
  16257. Position defines in which margin the marks indicator is displayed and can be 
  16258. one of the following: 
  16259.     RevMarkLeft (0) - Show marks in left margin 
  16260.     RevMarkRight (1) - Show marks in right margin 
  16261.     RevMarkRightLeft (2) - Show marks for even pages in the left margin and odd 
  16262.     pages in the right margin 
  16263.  
  16264. To display the  revision  marking  options dialog box and allow the user to 
  16265. select the options: RevisionMarkOpts 
  16266.  
  16267. Return Value 
  16268. 1 if the attributes are set. 
  16269. 0 (UserCancel) if the user canceled the function. 
  16270.  
  16271. Example 
  16272. FUNCTION Example() 
  16273. RevisionMarkOpts(RevItalic, ColorOn, 16711680, RevStrikeThru, 0, ColorOn, 255, 
  16274. RevBars, 0, RevMarkRightLeft) 
  16275. RevisionMarking(1, 1) 
  16276. END FUNCTION 
  16277.  
  16278. See also: 
  16279.  
  16280.     ReviewRevisions 
  16281.     RevisionInsertion 
  16282.     RevisionMarking 
  16283.  
  16284.  
  16285. ΓòÉΓòÉΓòÉ 360. RexxCmd ΓòÉΓòÉΓòÉ
  16286.  
  16287. This function executes an external REXX command file and can pass arguments to 
  16288. REXX. REXX can retrieve the arguments by using the ARG function. 
  16289.  
  16290.  
  16291. If the REXX script includes a RETURN FINALRESULT statement, the return value is 
  16292. available to the Ami Pro macro as the return value. 
  16293.  
  16294. Syntax 
  16295. RexxCmd(REXX_CMD_FILE, [Arg1, Arg2, ...]) 
  16296. REXX_CMD_FILE is the name of the REXX command file to execute. 
  16297. Arg1, Arg2... are any input values expected by the REXX command file. 
  16298.  
  16299. Return Value 
  16300. Return value from REXX script. 
  16301.  
  16302. Example 
  16303. Function Main() 
  16304. Fname = "Charlie" 
  16305. Stat = RexxCmd("c:\amipro\macros\myrexx.cmd", Fname) 
  16306. End Function 
  16307.  
  16308. See also: 
  16309.  
  16310.     Integrating REXX Commands 
  16311.     RexxFunction 
  16312.  
  16313.  
  16314.  
  16315.  
  16316.  
  16317. ΓòÉΓòÉΓòÉ 361. RexxFunction ΓòÉΓòÉΓòÉ
  16318.  
  16319. This functions executes a single REXX statement from within an Ami Pro macro. 
  16320. This function takes a string giving the REXX statement, and returns the REXX 
  16321. return value from that statement. 
  16322.  
  16323.  
  16324. You must use the REXX statement RETURN to obtain a return variable. 
  16325.  
  16326. Syntax 
  16327. RexxFunction(REXX_statement) 
  16328. REXX_statement is the REXX statement you want to execute. You must use the 
  16329. correct REXX syntax for that statement. 
  16330. For additional information on REXX statements, select the information icon in 
  16331. the OS/2 System folder and select REXX information. 
  16332.  
  16333. Return Value 
  16334. OK = 0 or the return variable from REXX. 
  16335.  
  16336. Example 
  16337. Function Main() 
  16338. Number = -100 
  16339. ' get the absolute value and a random number 
  16340. AbsNum = RexxFunction("return abs({number})") 
  16341. RndNum = RexxFunction("return Random(100)") 
  16342. Message("Absolute value is {AbsNum}, random number is {RndNum}") 
  16343.  
  16344. ' this will load the RexxUtil dll 
  16345. RexxFunction("Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'") 
  16346. RexxFunction ("Call SysloadFuncs") 
  16347.  
  16348. DriveC = RexxFunction("return SysDriveInfo(""c:"")") 
  16349. Message("Infomation about drive c: {DriveC}") 
  16350.  
  16351. End function 
  16352.  
  16353. See also: 
  16354.  
  16355.     Integrating REXX Commands 
  16356.     RexxCmd 
  16357.  
  16358.  
  16359.  
  16360. ΓòÉΓòÉΓòÉ 362. Right ΓòÉΓòÉΓòÉ
  16361.  
  16362. This function retrieves the specified number of characters from the right end 
  16363. of the specified string. 
  16364.  
  16365.  
  16366. Syntax 
  16367. Right$(Text, Length) 
  16368. Text is the string to parse. 
  16369. Length is the number of characters from the right end of the string to parse. 
  16370.  
  16371. Return Value 
  16372. A string containing the specified characters parsed from the original string 
  16373. that may be the null string. 
  16374.  
  16375. Example 
  16376. FUNCTION Example() 
  16377. DEFSTR Char; 
  16378. OpenFile = GetOpenFileName$() 
  16379. I = LEN(OpenFile) 
  16380. WHILE "\" != Assign(&Char, MID$(OpenFile, I, 1)) 
  16381.     I = I - 1 
  16382. WEND 
  16383. FileName = Right$(OpenFile, (LEN(OpenFile) - I)) 
  16384. Message("The current file is {FileName}.") 
  16385. END FUNCTION 
  16386.  
  16387. See also: 
  16388.  
  16389.     Instr 
  16390.     Left$ 
  16391.     LEN 
  16392.     MID$ 
  16393.  
  16394.  
  16395. ΓòÉΓòÉΓòÉ 363. RightAlign ΓòÉΓòÉΓòÉ
  16396.  
  16397. This function acts as a toggle to turn right alignment on or off for a 
  16398. paragraph of text. This function is equivalent to choosing Text Alignment 
  16399. Right. 
  16400.  
  16401.  
  16402. Syntax 
  16403. RightAlign() 
  16404.  
  16405. Return Value 
  16406. 1  (TRUE) if the text was right aligned, or if alignment was removed. 
  16407. -6  (NoMemory) if the function failed because of insufficient memory. 
  16408.  
  16409. Example 
  16410. FUNCTION Example() 
  16411. String = "This is a line of Text. " 
  16412. FOR i = 1 to 10 
  16413.     Paste() 
  16414. NEXT 
  16415. LeftAlign() 
  16416. END FUNCTION 
  16417.  
  16418. See also: 
  16419.  
  16420.     Center 
  16421.     Justify 
  16422.     LeftAlign 
  16423.     NormalText 
  16424.  
  16425.  
  16426. ΓòÉΓòÉΓòÉ 364. RightEdge ΓòÉΓòÉΓòÉ
  16427.  
  16428. This function scrolls the document to the right edge of the page without moving 
  16429. the insertion point. This function is equivalent to dragging the slider box on 
  16430. the horizontal scroll bar to the extreme right. 
  16431.  
  16432.  
  16433. Syntax 
  16434. RightEdge() 
  16435.  
  16436. Return Value 
  16437. This function returns 1. 
  16438.  
  16439. Example 
  16440. FUNCTION Example() 
  16441. RightEdge() 
  16442. END FUNCTION 
  16443.  
  16444. See also: 
  16445.  
  16446.     CharLeft 
  16447.     CharRight 
  16448.     EndOfFile 
  16449.     LeftEdge 
  16450.     LineDown 
  16451.     LineUp 
  16452.     ScreenDown 
  16453.     ScreenLeft 
  16454.     ScreenRight 
  16455.     ScreenUp 
  16456.     TopOfFile 
  16457.  
  16458.  
  16459. ΓòÉΓòÉΓòÉ 365. Round ΓòÉΓòÉΓòÉ
  16460.  
  16461. This function rounds a number to an integer. Values with fractional parts 
  16462. greater than or equal to .5 are rounded up to the next highest integer value. 
  16463. Those with fractional parts less than .5 are rounded down to the next lowest 
  16464. integer. 
  16465.  
  16466.  
  16467. Syntax 
  16468. Round(Value) 
  16469. Value is the number to be rounded. 
  16470.  
  16471. Return Value 
  16472. This function returns an integer. 
  16473.  
  16474. Example 
  16475. FUNCTION Example() 
  16476. Number = Query$("What number do you want to round?") 
  16477. Round(Number) 
  16478. END FUNCTION 
  16479.  
  16480. See also: 
  16481.  
  16482.     IsNumeric 
  16483.     Mod 
  16484.  
  16485.  
  16486. ΓòÉΓòÉΓòÉ 366. RunLater ΓòÉΓòÉΓòÉ
  16487.  
  16488. This function allows one macro to start another at a later time. While waiting 
  16489. for the called macro to start, control is turned back to the user. 
  16490.  
  16491.  
  16492. Syntax 
  16493. RunLater(MacroName[!Function[(parm1[, parm2...])]][, Hours:]Minutes[.Seconds]) 
  16494. MacroName is the macro to run at a later time. 
  16495. Hours is the number of hours to wait before playing back the macro. 
  16496. Minutes is the number of minutes to wait before playing back the macro. 
  16497. Seconds is the number of seconds to wait before playing back the macro. 
  16498.  
  16499. Return Value 
  16500. This function does not return a value. 
  16501.  
  16502. Example 
  16503. FUNCTION Example() 
  16504. MacFile = GetRunningMacroFile$() 
  16505. RunLater("{MacFile}!Example2()", 0.10) 
  16506. END FUNCTION 
  16507.  
  16508. FUNCTION Example2() 
  16509. Message("It is now 10 seconds after you pushed ""OK"" in the message box.") 
  16510. END FUNCTION 
  16511.  
  16512. See also: 
  16513.  
  16514.     GetTime 
  16515.     Pause 
  16516.  
  16517.  
  16518. ΓòÉΓòÉΓòÉ 367. Save ΓòÉΓòÉΓòÉ
  16519.  
  16520. This function saves the currently active document to disk. This function is 
  16521. equivalent to choosing File Save. This function cannot be used to save an 
  16522. Untitled document. You should use the SaveAs function to save an Untitled 
  16523. document. 
  16524.  
  16525.  
  16526. Syntax 
  16527. Save() 
  16528.  
  16529. Return Value 
  16530. 1  (TRUE) if the file was saved. 
  16531. 0  (UserCancel/FALSE) if the user canceled the function. 
  16532. -2  (GeneralFailure) if the file was not saved, if the file was password 
  16533. protected and password verification failed, if the file was read-only, or if 
  16534. the file to be saved was untitled. 
  16535.  
  16536. Example 
  16537. FUNCTION Example() 
  16538. result = Save() 
  16539. IF result = 0 
  16540.     Message("Use SaveAs") 
  16541. ENDIF 
  16542. END FUNCTION 
  16543.  
  16544. See also: 
  16545.  
  16546.     Revert 
  16547.     SaveAs 
  16548.  
  16549.  
  16550. ΓòÉΓòÉΓòÉ 368. SaveAs ΓòÉΓòÉΓòÉ
  16551.  
  16552. This function saves the document on the screen with a different name or file 
  16553. type. This function is equivalent to choosing File Save As. 
  16554.  
  16555.  
  16556. Syntax 
  16557. SaveAs(FileName, Options, Description, App) 
  16558. FileName is the name of the file to save the document as. This parameter may 
  16559. optionally include a path. 
  16560. Options are options for saving the file if saving as an Ami Pro document. It is 
  16561. one of the following values: 
  16562.     0 - Ami Pro file or Non-ASCII file 
  16563.     4 - ASCII file 
  16564.     KeepFormat (32) - Keep format 
  16565.     Password (64) - Use password protection 
  16566. If saving as an Ami Pro Macro file type, use only the KeepFormat value. 
  16567. Description is the document description of the new file. 
  16568. App is the name of the filter that appears in the amipro3.ini file. Use the 
  16569. null string ("") to specify an Ami Pro file. 
  16570.  
  16571. To display the Save As dialog box and allow the user to choose the name of the 
  16572. file: SaveAs 
  16573.  
  16574. Return Value 
  16575. 1  (TRUE) if the file was saved. 
  16576. 0  (UserCancel) if the user canceled the function. 
  16577. -2  (GeneralFailure) if the file was not saved. 
  16578.  
  16579. Example 
  16580. FUNCTION Example() 
  16581. SaveAs("test.sam", 32, "Test file", "") 
  16582. END FUNCTION 
  16583.  
  16584. See also: 
  16585.  
  16586.     FileOpen 
  16587.     Revert 
  16588.     Save 
  16589.  
  16590.  
  16591.  
  16592.  
  16593. ΓòÉΓòÉΓòÉ 369. SaveAsNewStyle ΓòÉΓòÉΓòÉ
  16594.  
  16595. This function saves the current document's paragraph styles to a new paragraph 
  16596. style sheet. This function is equivalent to choosing Style Save as a Style 
  16597. Sheet. 
  16598.  
  16599.  
  16600. Syntax 
  16601. SaveAsNewStyle(Name, WithContents, MacroName, RunMacro, Description) 
  16602. Name is the name to name the new style sheet. 
  16603. WithContents is a flag that determines whether to save the document's contents 
  16604. in the new paragraph style sheet and can be one of the following: 
  16605.     (1) - Save the contents of the file in the paragraph style sheet 
  16606.     (0) - Do not save the file's contents in the paragraph style sheet 
  16607. MacroName is the name of the macro to run when a new file is opened with the 
  16608. selected paragraph style sheet. 
  16609. RunMacro determines whether or not to run MacroName when the new file with the 
  16610. selected paragraph style sheet is opened. It is one of the following values: 
  16611.     (1) - Run the macro 
  16612.     (0) - Do not run the macro 
  16613. Description is the style sheet description. 
  16614.  
  16615. To display a dialog box to allow the user to select the name for the new 
  16616. paragraph style sheet: SaveAsNewStyle 
  16617.  
  16618. Return Value 
  16619. 1  (TRUE) if the paragraph style sheet was saved. 
  16620. 0  (UserCancel) if the user canceled the function. 
  16621.  
  16622. Example 
  16623. FUNCTION Example() 
  16624. SaveAsNewStyle("Example.sty", 1, "", "", "My example style sheet") 
  16625. END FUNCTION 
  16626.  
  16627. See also: 
  16628.  
  16629.  
  16630.  
  16631. ΓòÉΓòÉΓòÉ 370. ScreenDown ΓòÉΓòÉΓòÉ
  16632.  
  16633. This function scrolls the document down one screen without moving the insertion 
  16634. point. This function is equivalent to clicking above the slider box on the 
  16635. vertical scroll bar. 
  16636.  
  16637.  
  16638. Syntax 
  16639. ScreenDown() 
  16640.  
  16641. Return Value 
  16642. 1  (TRUE) if the document was able to scroll. 
  16643. -2  (GeneralFailure) if the document could not be scrolled. 
  16644.  
  16645. Example 
  16646. FUNCTION Example() 
  16647. ScreenDown() 
  16648. END FUNCTION 
  16649.  
  16650. See also: 
  16651.  
  16652.     CharLeft 
  16653.     CharRight 
  16654.     EndOfFile 
  16655.     LeftEdge 
  16656.     LineDown 
  16657.     LineUp 
  16658.     RightEdge 
  16659.     ScreenLeft 
  16660.     ScreenRight 
  16661.     ScreenUp 
  16662.     TopOfFile 
  16663.  
  16664.  
  16665. ΓòÉΓòÉΓòÉ 371. ScreenLeft ΓòÉΓòÉΓòÉ
  16666.  
  16667. This function scrolls the document left one screen without moving the insertion 
  16668. point. This function is equivalent to clicking to the right of the slider box 
  16669. on the horizontal scroll bar. 
  16670.  
  16671.  
  16672. Syntax 
  16673. ScreenLeft() 
  16674.  
  16675. Return Value 
  16676. 1  (TRUE) if the document was able to scroll. 
  16677. -2  (GeneralFailure) if the document could not be scrolled. 
  16678.  
  16679. Example 
  16680. FUNCTION Example() 
  16681. ScreenLeft() 
  16682. END FUNCTION 
  16683.  
  16684. See also: 
  16685.  
  16686.     CharLeft 
  16687.     CharRight 
  16688.     EndOfFile 
  16689.     LeftEdge 
  16690.     LineDown 
  16691.     LineUp 
  16692.     RightEdge 
  16693.     ScreenDown 
  16694.     ScreenRight 
  16695.     ScreenUp 
  16696.     TopOfFile 
  16697.  
  16698.  
  16699. ΓòÉΓòÉΓòÉ 372. ScreenRight ΓòÉΓòÉΓòÉ
  16700.  
  16701. This function scrolls the document right one screen without moving the 
  16702. insertion point. This function is equivalent to clicking to the left of the 
  16703. slider box on the horizontal scroll bar. 
  16704.  
  16705.  
  16706. Syntax 
  16707. ScreenRight() 
  16708.  
  16709. Return Value 
  16710. 1  (TRUE) if the document was able to scroll. 
  16711. -2  (GeneralFailure) if the document could not be scrolled. 
  16712.  
  16713. Example 
  16714. FUNCTION Example() 
  16715. ScreenRight() 
  16716. END FUNCTION 
  16717.  
  16718. See also: 
  16719.  
  16720.     CharLeft 
  16721.     CharRight 
  16722.     EndOfFile 
  16723.     LeftEdge 
  16724.     LineDown 
  16725.     LineUp 
  16726.     RightEdge 
  16727.     ScreenDown 
  16728.     ScreenLeft 
  16729.     ScreenUp 
  16730.     TopOfFile 
  16731.  
  16732.  
  16733. ΓòÉΓòÉΓòÉ 373. ScreenUp ΓòÉΓòÉΓòÉ
  16734.  
  16735. This function scrolls the document up one screen without moving the insertion 
  16736. point. This function is equivalent to clicking below the slider box on the 
  16737. vertical scroll bar. 
  16738.  
  16739.  
  16740. Syntax 
  16741. ScreenUp() 
  16742.  
  16743. Return Value 
  16744. 1  (TRUE) if the document was able to scroll. 
  16745. -2  (GeneralFailure) if the document could not be scrolled. 
  16746.  
  16747. Example 
  16748. FUNCTION Example() 
  16749. ScreenUp() 
  16750. END FUNCTION 
  16751.  
  16752. See also: 
  16753.  
  16754.     CharLeft 
  16755.     CharRight 
  16756.     EndOfFile 
  16757.     LeftEdge 
  16758.     LineDown 
  16759.     LineUp 
  16760.     RightEdge 
  16761.     ScreenDown 
  16762.     ScreenLeft 
  16763.     ScreenRight 
  16764.     TopOfFile 
  16765.  
  16766.  
  16767.  
  16768.  
  16769. ΓòÉΓòÉΓòÉ 374. SelectColumn ΓòÉΓòÉΓòÉ
  16770.  
  16771. This function selects a column in a table. The column that contains the 
  16772. insertion point is selected. This function is equivalent to choosing Table 
  16773. Select Column. 
  16774.  
  16775.  
  16776. The insertion point must be in the table before performing this function. 
  16777.  
  16778. Syntax 
  16779. SelectColumn() 
  16780.  
  16781. Return Value 
  16782. 1 (TRUE) if the column is selected. 
  16783. 0 (NoAction) if no action is taken. The table may not exist or may not be 
  16784. selected. 
  16785.  
  16786. Example 
  16787. FUNCTION Example() 
  16788. SelectColumn() 
  16789. END FUNCTION 
  16790.  
  16791. See also: 
  16792.  
  16793.     SelectEntireTable 
  16794.     SelectRow 
  16795.  
  16796.  
  16797. ΓòÉΓòÉΓòÉ 375. SelectEntireTable ΓòÉΓòÉΓòÉ
  16798.  
  16799. This function selects the entire table. This function is equivalent to choosing 
  16800. Table Select Entire Table. 
  16801.  
  16802.  
  16803. The insertion point must be in the table before performing this function. 
  16804.  
  16805. Syntax 
  16806. SelectEntireTable() 
  16807.  
  16808. Return Value 
  16809. 1 (TRUE) if the entire table is selected. 
  16810. 0 (NoAction) if no action is taken. The table may not exist or may not be 
  16811. selected. 
  16812.  
  16813. Example 
  16814. FUNCTION Example() 
  16815. SelectEntireTable() 
  16816. END FUNCTION 
  16817.  
  16818. See also: 
  16819.  
  16820.     DeleteEntireTable 
  16821.     SelectColumn 
  16822.     SelectRow 
  16823.  
  16824.  
  16825. ΓòÉΓòÉΓòÉ 376. SelectFrameByName ΓòÉΓòÉΓòÉ
  16826.  
  16827. This function allows you to select a frame by name. Use the MarkBookMark 
  16828. function to name the frames. 
  16829.  
  16830.  
  16831. Syntax 
  16832. SelectFrameByName(FrameName) 
  16833. FrameName is the name of the frame you want to select. 
  16834.  
  16835. Return Value 
  16836. 0  if the frame could not be found. 
  16837.  
  16838. Example 
  16839. FUNCTION Example() 
  16840. myframe = Query$("Enter the name of the bookmark set to the frame you want to 
  16841. select:") 
  16842. SelectFrameByName(myframe) 
  16843. END FUNCTION 
  16844.  
  16845. See also: 
  16846.  
  16847.     GoToCmd 
  16848.     MarkBookMark 
  16849.  
  16850.  
  16851. ΓòÉΓòÉΓòÉ 377. SelectRow ΓòÉΓòÉΓòÉ
  16852.  
  16853. This function selects a row in a table. The row that contains the insertion 
  16854. point is selected. This function is equivalent to choosing Table Select Row. 
  16855.  
  16856.  
  16857. The insertion point must be in the table before performing this function. 
  16858.  
  16859. Syntax 
  16860. SelectRow() 
  16861.  
  16862. Return Value 
  16863. 1 (TRUE) if the row is selected. 
  16864. 0 (NoAction) if no action is taken. The table may not exist or may not be 
  16865. selected. 
  16866.  
  16867. Example 
  16868. FUNCTION Example() 
  16869. SelectRow() 
  16870. END FUNCTION 
  16871.  
  16872. See also: 
  16873.  
  16874.     SelectColumn 
  16875.     SelectEntireTable 
  16876.  
  16877.  
  16878. ΓòÉΓòÉΓòÉ 378. SelectStyle ΓòÉΓòÉΓòÉ
  16879.  
  16880. This function allows the user to select a new paragraph style. This function is 
  16881. equivalent to choosing Style Select a Style. This function does not 
  16882. automatically select a new paragraph style. 
  16883.  
  16884.  
  16885. To have the macro select a paragraph style for the user, use the SetStyle 
  16886. function. 
  16887.  
  16888. Syntax 
  16889. SelectStyle() 
  16890.  
  16891. Return Value 
  16892. 1  (TRUE) if the new paragraph style was selected. 
  16893. 0  (UserCancel) if the user canceled the function. 
  16894. -2  (GeneralFailure) if the paragraph style was not selected. 
  16895.  
  16896. Example 
  16897. FUNCTION Example() 
  16898. SelectStyle() 
  16899. END FUNCTION 
  16900.  
  16901. See also: 
  16902.  
  16903.     ModifyStyle 
  16904.     SetStyle 
  16905.  
  16906.  
  16907. ΓòÉΓòÉΓòÉ 379. SelectWindow ΓòÉΓòÉΓòÉ
  16908.  
  16909. This function allows you to give any document in Ami Pro the focus and make it 
  16910. the active document. This function is equivalent to choosing Window and 
  16911. selecting an open file name. 
  16912.  
  16913.  
  16914. Syntax 
  16915. SelectWindow(FileName) 
  16916. FileName is the name of the document to get the focus. This name must match the 
  16917. name in the title bar of the document. 
  16918.  
  16919. Return Value 
  16920. 0  if the document was not selected, or was not found. 
  16921.  
  16922. Example 
  16923. FUNCTION Example() 
  16924. filename = Query$("Name the window to select (name must match exactly).") 
  16925. SelectWindow(filename) 
  16926. END FUNCTION 
  16927.  
  16928. See also: 
  16929.  
  16930.     CascadeWindow 
  16931.     NewWindow 
  16932.     NextWindow 
  16933.     TileWindow 
  16934.  
  16935.  
  16936. ΓòÉΓòÉΓòÉ 380. SendFrameToBack ΓòÉΓòÉΓòÉ
  16937.  
  16938. This function sends the selected frame to the rear of a stack of frames. This 
  16939. function is equivalent to choosing Frame Send to Back. 
  16940.  
  16941.  
  16942. Syntax 
  16943. SendFrameToBack() 
  16944.  
  16945. Return Value 
  16946. 1  (TRUE) if the frame was sent to the back. 
  16947. 0  (NoAction) if no action was taken because the frame was already in the back. 
  16948.  
  16949. Example 
  16950. FUNCTION Example() 
  16951. x = strfield$(CursorPosition$(), 1, ",") 
  16952. y = strfield$(CursorPosition$(), 2, ",") 
  16953. AddFrame(x, y, (x + 1440), (y - 1440)) 
  16954. MarkBookMark("Frame1", AddBookmark) 
  16955. AddFrame((x + 360), (y - 360), (x + 1800), (y - 1800)) 
  16956. MarkBookMark("Frame2", AddBookmark) 
  16957. SendFrameToBack() 
  16958. MarkBookMark("Frame1", FindBookmark) 
  16959. Message("The First frame is in front.") 
  16960. MarkBookMark("Frame2", FindBookmark) 
  16961. BringFrameToFront() 
  16962. Message("The Second frame is in front.") 
  16963. END FUNCTION 
  16964.  
  16965. See also: 
  16966.  
  16967.     AddFrame 
  16968.     AddFrameDLG 
  16969.     BringFrameToFront 
  16970.     GoToCmd 
  16971.  
  16972.  
  16973.  
  16974. ΓòÉΓòÉΓòÉ 381. SendMail ΓòÉΓòÉΓòÉ
  16975.  
  16976. This functions allows you to send a mail message using a mail server. 
  16977. Currently, Ami Pro supports cc:Mail and Lotus Notes. If the text has been 
  16978. selected in the current document, the text is copied to the clipboard and then 
  16979. sent as a note. This function is equivalent to choosing File Send Mail. 
  16980.  
  16981.  
  16982. You can only use one mail server. This function is only available if a mail 
  16983. server compatible with Ami Pro is installed. 
  16984.  
  16985. Syntax 
  16986. SendMail(Attach) 
  16987. Attach is used to save and attach the active document to the note. It is one of 
  16988. the following values: 
  16989.     Attach (1) - Save and attach the active document to the note 
  16990.     No (0) - Do not attach the active document to the note 
  16991.  
  16992. To display the Send Mail dialog box: SendMail 
  16993.  
  16994. Return Value 
  16995. 1  (TRUE) if the mail was sent. 
  16996. 0  (UserCancel/FALSE) if the user canceled the function or if no action was 
  16997. taken. 
  16998. -2  (GeneralFailure) if the mail server was not found or if it could not be 
  16999. activated. 
  17000.  
  17001. Example 
  17002. FUNCTION Example() 
  17003. Message("Saving and sending this doc") 
  17004. Save() 
  17005. SendMail(1) 
  17006. END FUNCTION 
  17007.  
  17008. See also: 
  17009.  
  17010.     ReadMail 
  17011.  
  17012.  
  17013. ΓòÉΓòÉΓòÉ 382. SetBackPath ΓòÉΓòÉΓòÉ
  17014.  
  17015. This function sets the default path for backup files. This function is 
  17016. equivalent to choosing Tools User Setup and choosing Paths. 
  17017.  
  17018.  
  17019. Syntax 
  17020. SetBackPath(NewPath) 
  17021. NewPath is the desired new backup path. 
  17022.  
  17023. Return Value 
  17024. 1  (TRUE) if the path was successfully set. 
  17025. -2  (BadPath) if the path could not be set because of an invalid directory 
  17026. name. 
  17027.  
  17028. Example 
  17029. FUNCTION Example() 
  17030. Backup = Query$("Please enter the desired backup path:" GetBackPath$()) 
  17031. Docs = Query$("Please enter the desired document path:" GetDocPath$()) 
  17032. Styles = Query$("Please enter the desired styles path:" GetStylePath$()) 
  17033. SetDocPath(Docs) 
  17034. SetStylePath(Styles) 
  17035. SetBackPath(Backup) 
  17036. END FUNCTION 
  17037.  
  17038. See also: 
  17039.  
  17040.     GetBackPath$ 
  17041.     GetDocPath$ 
  17042.     GetStylePath$ 
  17043.     SetDocPath 
  17044.     SetStylePath 
  17045.  
  17046.  
  17047. ΓòÉΓòÉΓòÉ 383. SetDataFile ΓòÉΓòÉΓòÉ
  17048.  
  17049. This function sets the data and description file for the InsertMerge function. 
  17050.  
  17051.  
  17052. Syntax 
  17053. SetDataFile(RecFile, RecFileFlag, DescFile, DescFileFlag) 
  17054. RecFile is the record file to use when performing a merge. 
  17055. RecFileFlag is the flag to identify whether the DataFile is an Ami Pro file. If 
  17056. it is an Ami Pro file, the RecFileFlag parameter should be set to 0. 
  17057. DescFile is the description file to use when the record file is not an Ami Pro 
  17058. file. If no description file is needed, insert an empty string (""). 
  17059. DescFileFlag is the flag to identify whether the DescFile is an Ami Pro file. 
  17060. If it is an Ami Pro file, the DescFileFlag parameter should be set to 0. 
  17061.  
  17062. Return Value 
  17063. 1  (TRUE) if the record and description files are set. 
  17064. -3  if invalid input. 
  17065. 0  (NoAction) if no action was taken. 
  17066.  
  17067. Example 
  17068. FUNCTION Example() 
  17069. SetDataFile ("Testrel.sam", 0, "", 0) 
  17070. InsertMerge() 
  17071. END FUNCTION 
  17072.  
  17073. See also: 
  17074.  
  17075.     InsertMerge 
  17076.  
  17077.  
  17078. ΓòÉΓòÉΓòÉ 384. SetDefOptions ΓòÉΓòÉΓòÉ
  17079.  
  17080. This function sets editing defaults for using Ami Pro. This function is 
  17081. equivalent to choosing Tools User Setup and choosing Options. 
  17082.  
  17083.  
  17084. Syntax 
  17085. SetDefOptions(Options, HotZone) 
  17086. Options is a flag containing default options and can be one or more of the 
  17087. following: 
  17088.     DoWindows (2) - Control widows and orphans in the document 
  17089.     (4) Print in background (speed option) 
  17090.     (16) - Save for fast display graphic display speed option - saves screen 
  17091.     snapshot files (~ISD*.TMP) as part of the document. 
  17092.     (64) - Conserve disk space graphic display speed option - stores screen 
  17093.     snapshot files (~ISD*.TMP) in RAM when a page is displayed. 
  17094.     (128) - Hyphenate last word in paragraph 
  17095.     (256) - Hyphenate last word in column/page 
  17096. To set more than one option, add the options together. 
  17097. HotZone is the number of characters to use for the hyphenation hot zone. You 
  17098. can specify any number between 2 and 9. 
  17099.  
  17100. To display the Defaults dialog box and allow the user to select editing 
  17101. defaults: UserSetup 
  17102.  
  17103. Return Value 
  17104. 1  (TRUE) if the default settings were successfully set. 
  17105. 0  (UserCancel) if the user canceled the function. 
  17106.  
  17107. Example 
  17108. FUNCTION Example() 
  17109. SetDefOptions(0, 5) 
  17110. END FUNCTION 
  17111.  
  17112. See also: 
  17113.  
  17114.     LoadOptions 
  17115.     SetBackPath 
  17116.     SetDocPath 
  17117.     SetStylePath 
  17118.     UserSetup 
  17119.     ViewPreferences 
  17120.  
  17121.  
  17122. ΓòÉΓòÉΓòÉ 385. SetDlgCallBack ΓòÉΓòÉΓòÉ
  17123.  
  17124. This function is used to flag a control in the next displayed dialog box as a 
  17125. callback. If the contents of the control are modified once the dialog box is 
  17126. displayed, the specified macro is called. 
  17127.  
  17128.  
  17129. A callback is a macro function that is initiated by a displayed dialog box and 
  17130. executes without closing that box. 
  17131.  
  17132. Syntax 
  17133. SetDlgCallBack(ID, MacroName!Function) 
  17134. ID is the ID of the control that you want to monitor. 
  17135. Macroname is the filename of the macro file containing the function to be 
  17136. executed. If the macro file does not exist in the current macros directory, the 
  17137. full path must be used. 
  17138. Function is the name of the function to be executed if the specified object is 
  17139. modified. MacroName and Function are separated by an exclamation mark. 
  17140. You may not send any parameters or even use parenthesis with this parameter. 
  17141. The specified function is called with three parameters: the windows handle for 
  17142. the dialog box, the ID specified, and the contents of the specified object. 
  17143.  
  17144. Return Value 
  17145. This function does not return a value. 
  17146.  
  17147. Example 
  17148. FUNCTION Example() 
  17149. MacFile = GetRunningMacroFile$() 
  17150. SetDlgCallBack(50, "{MacFile}!Message1") 
  17151. Box = DialogBox(".", "ExampleBox") 
  17152. IF Box = 0 
  17153.     EXIT FUNCTION 
  17154. ENDIF 
  17155. TYPE(GetDialogField$(8002)) 
  17156. END FUNCTION 
  17157.  
  17158. FUNCTION Message1(hdlg, id, text) 
  17159. Name = GetDlgItemText(hdlg, 8000) 
  17160. Message("The contents of the first box are {Name}.") 
  17161. Message("We will now fill the second box with the inverse of {Name}.") 
  17162. FOR I = len(Name) to 1 step -1 
  17163.     Name2 = strcat$(Name2, MID$(Name, I, 1)) 
  17164. NEXT 
  17165. SetDlgItemText(hdlg, 8002, Name2) 
  17166. END FUNCTION 
  17167.  
  17168. DIALOG ExampleBox 
  17169. -2134376448 8 106 38 160 54 "" "" "Sample Dialog Box" 
  17170. FONT 6 "Helv" 
  17171. 50 6 62 12 8000 1350631552 "edit" "" 0 
  17172. 4 6 44 10 1000 1342177280 "static" "Your Name:" 0 
  17173. 50 20 62 12 1003 1342177287 "static" "" 0 
  17174. 4 22 44 10 1002 1342177280 "static" "Reversed:" 0 
  17175. 52 22 58 8 8002 1342177280 "static" "" 0 
  17176. 116 4 40 14 1 1342242817 "button" "OK" 0 
  17177. 116 20 40 14 2 1342242816 "button" "Cancel" 0 
  17178. 100 36 56 14 50 1342242816 "button" "&Run Example..." 0 
  17179. END DIALOG 
  17180.  
  17181. See also: 
  17182.  
  17183.     DialogBox 
  17184.     FillEdit 
  17185.     FillList 
  17186.     GetDialogField$ 
  17187.     GetDLGItem 
  17188.     GetDLGItemText 
  17189.     SetDLGItemText 
  17190.  
  17191.  
  17192. ΓòÉΓòÉΓòÉ 386. SetDlgItemText ΓòÉΓòÉΓòÉ
  17193.  
  17194. This function sets the contents of a specified control in a callback, while the 
  17195. dialog box remains displayed. 
  17196.  
  17197.  
  17198. Syntax 
  17199. SetDlgItemText( Handle, ID, Text) 
  17200. Handle is the windows handle to the dialog box to be modified and it was passed 
  17201. to the callback function. 
  17202. ID is the control ID in which to set the contents. 
  17203. Text is the string data (if modifying an edit, combo, or list box, or static 
  17204. text), or a Boolean TRUE or FALSE value (if modifying a radio button or check 
  17205. box) to set the contents of the control to. 
  17206.  
  17207. Return Value 
  17208. 1  (TRUE) if the function was successful. 
  17209. 0  (FALSE) if the function failed. 
  17210.  
  17211. Example 
  17212. FUNCTION Example() 
  17213. MacFile = GetRunningMacroFile$() 
  17214. SetDlgCallBack(50, "{MacFile}!Message1") 
  17215. Box = DialogBox(".", "ExampleBox") 
  17216. IF Box = -1 
  17217.     Message("Could not find dialog box!") 
  17218.     EXIT FUNCTION 
  17219. ELSEIF Box = 0 
  17220.     EXIT FUNCTION 
  17221. ENDIF 
  17222. TYPE(GetDialogField$(8002)) 
  17223. END FUNCTION 
  17224.  
  17225. FUNCTION Message1(hdlg, id, text) 
  17226. Name = GetDlgItemText(hdlg, 8000) 
  17227. Message("The contents of the first box are {Name}.") 
  17228. Message("We will now fill the second box with the inverse of {Name}.") 
  17229. FOR I = len(Name) to 1 step -1 
  17230.     Name2 = strcat$(Name2, MID$(Name, I, 1)) 
  17231. NEXT 
  17232. SetDlgItemText(hdlg, 8002, Name2) 
  17233. END FUNCTION 
  17234.  
  17235. DIALOG ExampleBox 
  17236. -2134376448 8 106 38 160 54 "" "" "Sample Dialog Box" 
  17237. FONT 6 "Helv" 
  17238. 50 6 62 12 8000 1350631552 "edit" "" 0 
  17239. 4 6 44 10 1000 1342177280 "static" "Your Name:" 0 
  17240. 50 20 62 12 1003 1342177287 "static" "" 0 
  17241. 4 22 44 10 1002 1342177280 "static" "Reversed:" 0 
  17242. 52 22 58 8 8002 1342177280 "static" "" 0 
  17243. 116 4 40 14 1 1342242817 "button" "OK" 0 
  17244. 116 20 40 14 2 1342242816 "button" "Cancel" 0 
  17245. 100 36 56 14 50 1342242816 "button" "&Run Example..." 0 
  17246. END DIALOG 
  17247.  
  17248. See also: 
  17249.  
  17250.     DialogBox 
  17251.     FillEdit 
  17252.     FillList 
  17253.     GetDialogField$ 
  17254.     GetDLGItem 
  17255.     GetDLGItemText 
  17256.  
  17257.  
  17258. ΓòÉΓòÉΓòÉ 387. SetDocPath ΓòÉΓòÉΓòÉ
  17259.  
  17260. This function sets the default path for document storage. This function is 
  17261. equivalent to choosing Tools User Setup and choosing Paths. 
  17262.  
  17263.  
  17264. Syntax 
  17265. SetDocPath(NewPath) 
  17266. NewPath is the desired new default document path. 
  17267.  
  17268. Return Value 
  17269. 1  (TRUE) if the path was successfully set. 
  17270. -2  (GeneralFailure) if the path could not be set. 
  17271.  
  17272. Example 
  17273. FUNCTION Example() 
  17274. Backup = Query$("Please enter the desired backup path:" GetBackPath$()) 
  17275. Docs = Query$("Please enter the desired document path:" GetDocPath$()) 
  17276. Styles = Query$("Please enter the desired styles path:" GetStylePath$()) 
  17277. SetDocPath(Docs) 
  17278. SetStylePath(Styles) 
  17279. SetBackPath(Backup) 
  17280. END FUNCTION 
  17281.  
  17282. See also: 
  17283.  
  17284.     GetBackPath$ 
  17285.     GetDocPath$ 
  17286.     GetStylePath$ 
  17287.     SetBackPath 
  17288.     SetStylePath 
  17289.     UserSetup 
  17290.     ViewPreferences 
  17291.  
  17292.  
  17293. ΓòÉΓòÉΓòÉ 388. SetDocVar ΓòÉΓòÉΓòÉ
  17294.  
  17295. This function creates or updates a document variable in the current document. A 
  17296. document variable is used to store information in the document and may be 
  17297. retrieved by using the GetDocVar function. 
  17298.  
  17299.  
  17300. Syntax 
  17301. SetDocVar(Name, Text) 
  17302. Name is the name for the document variable by which it may be accessed. 
  17303. Text is the information that is stored in the document variable. 
  17304. The two strings combined must not exceed 250 bytes in length. 
  17305.  
  17306. Return Value 
  17307. This function returns 1. 
  17308.  
  17309. Example 
  17310. FUNCTION Example() 
  17311. SetDocVar("answer 1", "George Washington") 
  17312. END FUNCTION 
  17313.  
  17314. See also: 
  17315.  
  17316.     GetDocVar 
  17317.  
  17318.  
  17319. ΓòÉΓòÉΓòÉ 389. SetFormula ΓòÉΓòÉΓòÉ
  17320.  
  17321. This function inserts a formula into the current table cell. This function is 
  17322. equivalent to choosing Table Edit Formula. 
  17323.  
  17324.  
  17325. Syntax 
  17326. SetFormula(Formula) 
  17327. Formula is the formula that is typed into the table cell. 
  17328. To allow the user to type the formula for the cell: EditFormula 
  17329.  
  17330. Return Value 
  17331. 1  (TRUE) if the formula was inserted. 
  17332. -6  (NoMemory) if the function failed because of insufficient memory. 
  17333.  
  17334. Example 
  17335. FUNCTION Example() 
  17336. radius = Query$("What is the radius?") 
  17337. SetFormula(3.1415926 * radius * radius) 
  17338. END FUNCTION 
  17339.  
  17340. See also: 
  17341.  
  17342.     EditFormula 
  17343.  
  17344.  
  17345. ΓòÉΓòÉΓòÉ 390. SetFrameDefaults ΓòÉΓòÉΓòÉ
  17346.  
  17347. This function sets the defaults for the frame. This function is equivalent to 
  17348. choosing Frame Modify Frame Layout and choosing Make Default. 
  17349.  
  17350.  
  17351. You must call FrameModInit before calling SetFrameDefaults. The FrameModFinish 
  17352. function must be called after this function to accept the modifications. 
  17353.  
  17354. Syntax 
  17355. SetFrameDefaults(BorderWhere, ThickType, PosType, 0, ShadeType, BackType, 
  17356. DefType, LeftMargin, BottomMargin, TopMargin, RightMargin, ShadowLeft, 
  17357. ShadowTop, ShadowRight, ShadowBottom, ShadowColor, Rounded) 
  17358. BorderWhere is the lines around a frame. It is one of the following values: 
  17359.     1 - All 
  17360.     2 - Left 
  17361.     4 - Right 
  17362.     8 - Top 
  17363.     16 - Bottom 
  17364. ThickType is the thickness of the border. It is one of the following values: 
  17365.     Hairline (1) - Hairline 
  17366.     OnePoint (2) - One point rule 
  17367.     TwoPoint (3) - Two point rule 
  17368.     ThreePoint (4) - Three point rule 
  17369.     FourPoint (5) - Four point rule 
  17370.     FivePoint (6) - Five point rule 
  17371.     SixPoint (7) - Six point rule 
  17372.     DoubleOnePoint (8) - Parallel one point rule 
  17373.     DoubleTwoPoint (9) - Parallel two point rule 
  17374.     ThreeLines (10) - Hairline above and below a two point rule 
  17375.     HairBelow (11) - Hairline below a three point rule 
  17376.     HairAbove (12) - Hairline above a three point rule 
  17377. PosType is the position of the border around a frame. It is one of the 
  17378. following values: 
  17379.     1 - Middle 
  17380.     2 - Inside 
  17381.     3 - Outside 
  17382.     4 - Close to Inside 
  17383.     5 - Close to outside 
  17384. You can only choose one value for the PosType parameter. 
  17385. ShadeType sets the line color. It can be one of the following values: 
  17386.     Black - 0 
  17387.     Blue - 16727905 
  17388.     Cyan - 16776960 
  17389.     Green - 65280 
  17390.     Magenta - 16711935 
  17391.     MedBlue - 16744448 
  17392.     Orange - 33279 
  17393.     Pink - 8388863 
  17394.     Purple - 16711809 
  17395.     Red - 255 
  17396.     White - 16777215 
  17397.     Yellow - 65535 
  17398. BackType sets the background color. It can be one of the values listed under 
  17399. ShadeType. 
  17400. DefType is a setting based on: how the text should wrap around a frame, whether 
  17401. a frame is transparent or opaque, where it is placed on a page, and whether a 
  17402. macro is assigned to a frame. It is one of the following values: 
  17403.     TextFrame (512) - Always use in combination with other values. It is a 
  17404.     required value. 
  17405.     Opaque (64) - Hide text or picture behind frame 
  17406.     Transparent(0) - Displays text or pictures behind frame. 
  17407.     Wraparound (128) - Display text above, below, to the left, or to the right 
  17408.     of the frame 
  17409.     NoWrapBeside (131072) - Display text above and below frame, but not to the 
  17410.     left or right of the frame 
  17411.     If you do not specify Wraparound or NoWrapBeside, the frame uses the 
  17412.     default setting of no wrap around. 
  17413.     AnchorFrame (524288) - Used to anchor frame in its current position or to a 
  17414.     carriage return. You cannot use any repeat values with this value. 
  17415.     RepeatFrame (256) - Repeat frame on multiple pages. To repeat on all pages, 
  17416.     do not use in combination with RepeatEven or RepeatOdd. 
  17417.     RepeatOdd (8192) - Repeat frame on odd pages. Use with the RepeatFrame 
  17418.     value. 
  17419.     RepeatEven (4194304) - Repeat frame on even pages. Use with the RepeatFrame 
  17420.     value. 
  17421.     Borders (65536) - Use if frame has borders 
  17422.     RunMacro (134217728) - Run a macro each time the frame is selected 
  17423. You can add the values together to get the DefType parameter. The syntax is "N 
  17424. &0x300c0", where "N" is the DefType value. 
  17425. LeftMargin is the desired left margin of the frame in twips (1 inch = 1440 
  17426. twips). 
  17427. BottomMargin is the desired bottom margin of the frame in twips (1 inch = 1440 
  17428. twips). 
  17429. TopMargin is the desired top margin of the frame in twips (1 inch = 1440 
  17430. twips). 
  17431. RightMargin is the desired right margin of the frame in twips (1 inch = 1440 
  17432. twips). 
  17433. ShadowLeft is the distance that the shadow is offset from the left side of the 
  17434. frame in twips (1 inch = 1440 twips). It can be one of the following values or 
  17435. a custom value: 
  17436.     None (0) - No shadow 
  17437.     Shallow (57) - Shallow shadow 
  17438.     Normal (100) - Normal shadow 
  17439.     Deep (172) - Deep shadow 
  17440. ShadowTop is the distance that the shadow is offset from the top of the frame 
  17441. in twips (1 inch = 1440 twips). It can be one of the values listed under 
  17442. ShadowLeft or a custom value. 
  17443. ShadowRight is the distance that the shadow is offset from the right side of 
  17444. the frame in twips (1 inch = 1440 twips). It can be one of the values listed 
  17445. under ShadowLeft or a custom value. 
  17446. ShadowBottom is the distance that the shadow is offset from the bottom of the 
  17447. frame in twips (1 inch = 1440 twips). It can be one of the values listed under 
  17448. ShadowLeft or a custom value. 
  17449. ShadowColor sets the color for the frame shadow. It can be one of the values 
  17450. listed under ShadeType. 
  17451. Rounded is the percentage that the corners are rounded (0% = square and 100% = 
  17452. circle). 
  17453.  
  17454. Return Value 
  17455. This function returns 1. 
  17456.  
  17457. Example 
  17458. FUNCTION Example() 
  17459. SetFrameDefaults(1, 1, 1, 0, 0, 255, 1677721, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) 
  17460. END FUNCTION 
  17461.  
  17462. See also: 
  17463.  
  17464.     FrameModBorders 
  17465.     FrameModFinish 
  17466.     FrameModInit 
  17467.     FrameModLines 
  17468.     FrameModType 
  17469.  
  17470.  
  17471.  
  17472.  
  17473. ΓòÉΓòÉΓòÉ 391. SetGlobalArray ΓòÉΓòÉΓòÉ
  17474.  
  17475. This function assigns a value stored in a local array variable element to a 
  17476. global array variable element. 
  17477.  
  17478.  
  17479. Syntax 
  17480. SetGlobalArray(Name, Index, Value) 
  17481. Name is the name or the ID number of the global array to set. 
  17482. Index is the element of the array in which to place the value. 
  17483. Value is the value that should be stored in the array element. 
  17484.  
  17485. Return Value 
  17486. 1  (TRUE) if the value was successfully set. 
  17487. 0  (FALSE) if the value could not be set. If you attempt to set a global 
  17488. variable that does not exist, a run-time error results. 
  17489.  
  17490. Example 
  17491. FUNCTION Example() 
  17492. AllocGlobalVar("Names", 5)'Allocate space for a 5 element global variable 
  17493. AllocGlobalVar("Numbers", 5)'Allocate space for a 5 element global variable 
  17494. AllocGlobalVar("YourName", 1)'Allocate space for a single element global 
  17495. variable. 
  17496. FOR I = 1 to 5'Do the following 5 times. 
  17497.     SetGlobalArray("Names", I, Query$("Enter Name Number {I}")) 
  17498.     'Fill a global array with the return from QUERY 
  17499.     SetGlobalArray("Numbers", I, (100/I))'Fill a global array with a number 
  17500. NEXT 
  17501. NewName = Query$("What is your name?")'Query the user for his/her name 
  17502. SetGlobalVar("YourName", NewName)'Set a global variable to that value 
  17503. CALL Example2()'Call the following function 
  17504. END FUNCTION 
  17505.  
  17506. FUNCTION Example2() 
  17507. Name = GetGlobalVar$("YourName")'Get the value of the global variable 
  17508. Message("Your name is {Name}.")'Message that value in a box. 
  17509. FOR I = 1 to 5'Do the following 5 times. 
  17510.     TheirName = GetGlobalArray$("Names", I)'Get the value of the current 
  17511.  element from the array 
  17512.     TheirNumber = GetGlobalArray$("Numbers", I)'Get the value of the current 
  17513.  element from the array 
  17514.     TYPE("Name #{I} is {TheirName}, and the number is {TheirNumber}.[Enter]") 
  17515.     'Type the values to the screen. 
  17516. NEXT 
  17517. FreeGlobalVar("Names")'Clear the space for the first global array 
  17518. FreeGlobalVar("Numbers")'Clear the space for the second global array 
  17519. FreeGlobalVar("YourName")'Clear the space for the global variable 
  17520. END FUNCTION 
  17521.  
  17522. See also: 
  17523.  
  17524.     AllocGlobalVar 
  17525.     FreeGlobalVar 
  17526.     GetGlobalArray$ 
  17527.     GetGlobalVar$ 
  17528.     GetGlobalVarCount 
  17529.     GetGlobalVarNames 
  17530.     Global Variables 
  17531.     SetGlobalVar 
  17532.     Using Variables 
  17533.  
  17534.  
  17535. ΓòÉΓòÉΓòÉ 392. SetGlobalVar ΓòÉΓòÉΓòÉ
  17536.  
  17537. This function assigns the value stored in a single element local variable to a 
  17538. global variable. 
  17539.  
  17540.  
  17541. Syntax 
  17542. SetGlobalVar(Name, Value) 
  17543. Name is the name or the ID number of the global variable to set. 
  17544. Value is the value to store into the global variable. 
  17545.  
  17546. Return Value 
  17547. 1  (TRUE) if the value was successfully set. 
  17548. 0  (FALSE) if the value could not be set. If you attempt to set a global 
  17549. variable that does not exist, a run-time error results. 
  17550.  
  17551. Example 
  17552. FUNCTION Example() 
  17553. Again: 
  17554. Count = GetGlobalVarCount() 
  17555. IF Count < 1 
  17556.     Count = 1 
  17557. ELSE 
  17558.     DIM Globals(Count) 
  17559.     GetGlobalVarNames(&Globals) 
  17560.     FillEdit(9000, &Globals) 
  17561. ENDIF 
  17562. Box = DialogBox(".", "ExampleBox") 
  17563. IF Box = 0 
  17564.     EXIT FUNCTION 
  17565. ELSEIF Box = 3 AND GetDialogField$(9000) != "" 
  17566.     FreeGlobalVar(GetDialogField$(9000)) 
  17567. ELSEIF Box = 4 AND GetDialogField$(9000) != "" 
  17568.     Message(GetGlobalVar$(GetDialogField$(9000))) 
  17569. ELSEIF Box = 5 
  17570.     AllocGlobalVar(Query$("Name for new global variable:"), Query$("Number of 
  17571.  elements?")) 
  17572. ELSEIF Box = 6 AND GetDialogField$(9000) != "" 
  17573.     SetGlobalVar(GetDialogField$(9000), Query$("What do you want in it?")) 
  17574. ENDIF 
  17575. GoTo Again 
  17576. END FUNCTION 
  17577.  
  17578. DIALOG ExampleBox 
  17579. -2134376448 7 98 20 160 102 "" "" "Global Variables" 
  17580. FONT 6 "Helv" 
  17581. 116 4 40 14 2 1342242817 "button" "Done" 0 
  17582. 116 20 40 14 3 1342242816 "button" "Free" 0 
  17583. 116 36 40 14 4 1342242816 "button" "Show..." 0 
  17584. 116 52 40 14 5 1342242816 "button" "Allocate..." 0 
  17585. 116 68 40 14 6 1342242816 "button" "Set..." 0 
  17586. 6 14 102 82 9000 1352728579 "listbox" "" 0 
  17587. 8 4 98 8 1000 1342177280 "static" "Currently Allocated Globals:" 0 
  17588. END DIALOG 
  17589.  
  17590. See also: 
  17591.  
  17592.     AllocGlobalVar 
  17593.     FreeGlobalVar 
  17594.     GetGlobalArray$ 
  17595.     GetGlobalVar$ 
  17596.     GetGlobalVarCount 
  17597.     GetGlobalVarNames 
  17598.     Global Variables 
  17599.     SetGlobalArray 
  17600.     Using Variables 
  17601.  
  17602.  
  17603.  
  17604.  
  17605. ΓòÉΓòÉΓòÉ 393. SetIconPath ΓòÉΓòÉΓòÉ
  17606.  
  17607. This function sets the default path for the SmartIcons files. This function is 
  17608. equivalent to choosing Tools User Setup and choosing Paths. 
  17609.  
  17610.  
  17611. Syntax 
  17612. SetIconPath(NewPath) 
  17613. NewPath is the desired new path for the SmartIcons files. 
  17614.  
  17615. Return Value 
  17616. 1 (TRUE) if the path was successfully set. 
  17617. -2 (GeneralFailure) if the path could not be set. 
  17618.  
  17619. Example 
  17620. FUNCTION Example() 
  17621. SetIconPath("c:\amipro\icons") 
  17622. END FUNCTION 
  17623.  
  17624. See also: 
  17625.  
  17626.     SetBackPath 
  17627.     SetDocPath 
  17628.     SetMacroPath 
  17629.     SetStylePath 
  17630.     UserSetup 
  17631.  
  17632.  
  17633.  
  17634.  
  17635.  
  17636. ΓòÉΓòÉΓòÉ 394. SetIconSize ΓòÉΓòÉΓòÉ
  17637.  
  17638. This function sets the icon size of the icon set. This function is equivalent 
  17639. to choosing Tools SmartIcons and choosing Icon Size. 
  17640.  
  17641.  
  17642. A macro must be edited to insert this non-recordable function. 
  17643.  
  17644. Syntax 
  17645. SetIconSize(Size) 
  17646. Size is one of the following values: 
  17647.     (1) - Small (VGA) 
  17648.     (3) - Large (Super VGA) 
  17649.  
  17650. Return Value 
  17651. 1 (TRUE) if the SmartIcon size changes. 
  17652. 0 (NoAction) if no action is taken. 
  17653.  
  17654. Example 
  17655. FUNCTION Example() 
  17656. SetIconSize(2) 
  17657. END FUNCTION 
  17658.  
  17659. See also: 
  17660.  
  17661.     ChangeIcons 
  17662.     HideIconBar 
  17663.     IconBottom 
  17664.     IconCustomize 
  17665.     IconFloating 
  17666.     IconRight 
  17667.     IconTop 
  17668.     ShowIconBar 
  17669.  
  17670.  
  17671. ΓòÉΓòÉΓòÉ 395. SetIndexFile ΓòÉΓòÉΓòÉ
  17672.  
  17673. This function sets the file name used to generate an index. It records the 
  17674. index file name for use in the Tools Generate Index dialog box and in the File 
  17675. Master Document Index Options dialog box. This function is equivalent to 
  17676. choosing File Master Document and choosing Index Options. 
  17677.  
  17678.  
  17679. This function should be used prior to the Generate function when generating an 
  17680. index. 
  17681.  
  17682. Syntax 
  17683. SetIndexFile(Separators, IndexFile) 
  17684. Separators indicates whether or not alphabetic separators are used in the 
  17685. index. It is one of the following values: 
  17686.     Yes (1) - Include alphabetic separators. 
  17687.     No (2) - Do not include alphabetic separators. 
  17688. IndexFile is the file name for the index file. 
  17689. To allow the user to view the TOC, Index dialog box and enter the index file 
  17690. name: Generate 
  17691.  
  17692. Return Value 
  17693. This function returns 1. 
  17694.  
  17695. Example 
  17696. FUNCTION Example() 
  17697. docpath=GetDocPath$() 
  17698. ' do not include alpha separators 
  17699. SetIndexFile (2, "{docpath}test.sam") 
  17700. END FUNCTION 
  17701.  
  17702. See also: 
  17703.  
  17704.     Generate 
  17705.     SetTOCFile 
  17706.  
  17707.  
  17708. ΓòÉΓòÉΓòÉ 396. SetMacroPath ΓòÉΓòÉΓòÉ
  17709.  
  17710. This function sets the default path for macro storage. This function is 
  17711. equivalent to choosing Tools User Setup and choosing Paths. 
  17712.  
  17713.  
  17714. Syntax 
  17715. SetMacroPath(NewPath) 
  17716. NewPath is the desired new default path for macros. 
  17717.  
  17718. Return Value 
  17719. 1  (TRUE) if the macro path was set. 
  17720. -2  (GeneralFailure) if the macro path could not be set. 
  17721.  
  17722. Example 
  17723. FUNCTION Example() 
  17724. SetMacroPath("C:\Amipro\Macros") 
  17725. END FUNCTION 
  17726.  
  17727. See also: 
  17728.  
  17729.     SetBackPath 
  17730.     SetDocPath 
  17731.     SetIconPath 
  17732.     SetStylePath 
  17733.     UserSetup 
  17734.  
  17735.  
  17736. ΓòÉΓòÉΓòÉ 397. SetMasterFiles ΓòÉΓòÉΓòÉ
  17737.  
  17738. This function determines which files comprise a master document. It makes the 
  17739. current file a master document. This function is equivalent to choosing File 
  17740. Master Document and including the files for the master document. 
  17741.  
  17742.  
  17743. Syntax 
  17744. SetMasterFiles(Size, Count, File1[, File2...]) 
  17745. Size is the amount of buffer space allocated to hold the files. It is 
  17746. determined by adding up all of the characters in each filename, plus the number 
  17747. of files, plus one. 
  17748. Count is the number of files in the master document. 
  17749. File1 is the name of the first file in the list of master documents. If the 
  17750. file does not exist in the current documents directory, the full path to the 
  17751. file must be used. 
  17752. File2 and any other files are treated the same as file1, above. 
  17753.  
  17754. To display the Master Document dialog box and allow the user to specify the 
  17755. files: MasterDoc 
  17756.  
  17757. Return Value 
  17758. 1  (TRUE) if the master files list was set. 
  17759. -2  (GeneralFailure) if the master files list could not be set. 
  17760.  
  17761. Example 
  17762. FUNCTION Example() 
  17763. size = 1 + len("TEST.SAM") + 1 
  17764. SetMasterFiles(size, 1, "TEST.SAM") 
  17765. END FUNCTION 
  17766.  
  17767. See also: 
  17768.  
  17769.     GetMasterFilesCount 
  17770.     GetMasterFiles 
  17771.  
  17772.  
  17773. ΓòÉΓòÉΓòÉ 398. SetStyle ΓòÉΓòÉΓòÉ
  17774.  
  17775. This function assigns the named paragraph style to the current paragraph. This 
  17776. function is equivalent to selecting a paragraph style name from the status bar. 
  17777.  
  17778.  
  17779. Syntax 
  17780. SetStyle(Style) 
  17781. Style is the name of a paragraph style in the current style sheet or document. 
  17782. To allow the user to select the name of the paragraph style to be used: 
  17783. SelectStyle 
  17784.  
  17785. Return Value 
  17786. This function returns 1. 
  17787.  
  17788. Example 
  17789. FUNCTION Example() 
  17790. curstyle = GetStyleName$() 
  17791. newstyle = "Number List" 
  17792. SetStyle(newstyle) 
  17793. TYPE("This is what the {newstyle} style looks like.[Enter]") 
  17794. SetStyle(curstyle) 
  17795. END FUNCTION 
  17796.  
  17797. See also: 
  17798.  
  17799.     GetStyleName$ 
  17800.     ModifyStyle 
  17801.     SelectStyle 
  17802.  
  17803.  
  17804.  
  17805.  
  17806. ΓòÉΓòÉΓòÉ 399. SetStylePath ΓòÉΓòÉΓòÉ
  17807.  
  17808. This function sets the default path for style sheet storage. This function is 
  17809. equivalent to choosing Tools User Setup and choosing Paths. 
  17810.  
  17811.  
  17812. Syntax 
  17813. SetStylePath(NewPath) 
  17814. NewPath is the desired new path for paragraph style sheets. 
  17815.  
  17816. Return Value 
  17817. 1  (TRUE) if the path was successfully set. 
  17818. -2  (GeneralFailure) if the path could not be set. 
  17819.  
  17820. Example 
  17821. FUNCTION Example() 
  17822. Backup = Query$("Please enter the desired backup path:" GetBackPath$()) 
  17823. Docs = Query$("Please enter the desired document path:" GetDocPath$()) 
  17824. Styles = Query$("Please enter the desired styles path:" GetStylePath$()) 
  17825. SetDocPath(Docs) 
  17826. SetStylePath(Styles) 
  17827. SetBackPath(Backup) 
  17828. END FUNCTION 
  17829.  
  17830. See also: 
  17831.  
  17832.     GetBackPath$ 
  17833.     GetDocPath$ 
  17834.     GetStylePath$ 
  17835.     SetBackPath 
  17836.     SetDocPath 
  17837.     SetIconPath 
  17838.     UserSetup 
  17839.  
  17840.  
  17841. ΓòÉΓòÉΓòÉ 400. SetTOCFile ΓòÉΓòÉΓòÉ
  17842.  
  17843. This function sets the destination file for a table of contents that was 
  17844. generated from the current file. It records the information for use in the 
  17845. Tools Generate TOC dialog box and in the File Master Document TOC Options 
  17846. dialog box. This function is equivalent to choosing File Master Document and 
  17847. choosing TOC Options. 
  17848.  
  17849.  
  17850. This function should be used prior to the Generate function when creating a 
  17851. table of contents. 
  17852.  
  17853. This function does not check the path to see if it is valid. 
  17854.  
  17855. Syntax 
  17856. SetTOCFile(TOCFile) 
  17857. TOCFile is the filename for the generated table of contents. 
  17858.  
  17859. To allow the user to view the TOC, Index dialog box and enter the TOC file 
  17860. name: Generate. 
  17861.  
  17862. Return Value 
  17863. This function returns 1. 
  17864.  
  17865. Example 
  17866. FUNCTION Example() 
  17867. SetTOCFile("TestToc.sam") 
  17868. END FUNCTION 
  17869.  
  17870. See also: 
  17871.  
  17872.     Generate 
  17873.  
  17874.  
  17875.  
  17876. ΓòÉΓòÉΓòÉ 401. ShowIconBar ΓòÉΓòÉΓòÉ
  17877.  
  17878. This function displays the set of SmartIcons in its default location on the 
  17879. screen. This function is equivalent to choosing View Show SmartIcons. 
  17880.  
  17881.  
  17882. Syntax 
  17883. ShowIconBar() 
  17884.  
  17885. Return Value 
  17886. 1  (TRUE) if the SmartIcon bar is displayed. 
  17887. 0  (NoAction) if no action was taken because the SmartIcon bar was already 
  17888. displayed. 
  17889.  
  17890. Example 
  17891. FUNCTION Example() 
  17892. ReturnValue = HideIconBar() 
  17893. IF ReturnValue != 1 
  17894.     IF Decide("Icon bar already hidden! Would you like it displayed?") 
  17895.        ShowIconBar() 
  17896.     ENDIF 
  17897. ENDIF 
  17898. END FUNCTION 
  17899.  
  17900. See also: 
  17901.  
  17902.     HideIconBar 
  17903.     IconBottom 
  17904.     IconCustomize 
  17905.     IconFloating 
  17906.     IconLeft 
  17907.     IconRight 
  17908.     IconTop 
  17909.     ShowTabRuler 
  17910.     ToggleIconBar 
  17911.     ToggleIconBar 
  17912.     ViewPreferences 
  17913.  
  17914.  
  17915. ΓòÉΓòÉΓòÉ 402. ShowTabRuler ΓòÉΓòÉΓòÉ
  17916.  
  17917. This function displays the tab ruler at the top of the screen. This function is 
  17918. equivalent to choosing View Show Ruler. 
  17919.  
  17920.  
  17921. Syntax 
  17922. ShowTabRuler() 
  17923.  
  17924. Return Value 
  17925. 1  (TRUE) if the tab ruler is displayed. 
  17926. 0  (NoAction) if no action was taken because the tab ruler was already 
  17927. displayed. 
  17928.  
  17929. Example 
  17930. FUNCTION Example() 
  17931. ShowTabRuler() 
  17932. END FUNCTION 
  17933.  
  17934. See also: 
  17935.  
  17936.     HideTabRuler 
  17937.     ShowIconBar 
  17938.     ToggleTabRuler 
  17939.     ViewPreferences 
  17940.  
  17941.  
  17942. ΓòÉΓòÉΓòÉ 403. SingleStep ΓòÉΓòÉΓòÉ
  17943.  
  17944. This function allows you to debug macros by stepping through each macro 
  17945. statement one line at a time. 
  17946.  
  17947.  
  17948. SingleStep uses two modes. In the first of these, if you have the macro to be 
  17949. debugged open in a window and a SingleStep statement in it, the line currently 
  17950. executing is highlighted in the macro file and a modeless dialog box displays. 
  17951. If the macro to be debugged is not open, a dialog box displays the currently 
  17952. running statement. 
  17953.  
  17954. If the macro is in a window you can: 
  17955.     Resume - Removes the dialog box and continues to the next break point, 
  17956.     continues to the next SingleStep(1), or goes to the end of the macro. 
  17957.     Single Step - Executes the current instruction then pauses again. 
  17958.     Step Through - If a CALL statement is made, the macro from the CALL 
  17959.     statement executes to completion and control returns to the original macro. 
  17960.     Variables - This brings up a modal dialog box showing the list of local 
  17961.     variables currently set in the currently running macro. You may change the 
  17962.     contents of a variable here at run time. If the variable is an array, the 
  17963.     number of elements in the array display and may not be changed. 
  17964.     Break Points - This brings up a modal dialog box showing the list of 
  17965.     currently active breakpoints. The Break Points list box lists the filename, 
  17966.     an exclamation point, the function name, a period, and then the line number 
  17967.     within that function. 
  17968.     Set BP - This sets a break point on the current line. This assumes, of 
  17969.     course, that you are still in the macro window or in another window that 
  17970.     contains a running macro. 
  17971.     Break points cannot be set on empty lines or commented lines or lines with 
  17972.     ELSE, WEND, or ENDIF. Break points may only be placed on a line with an 
  17973.     executable code statement and it must be after a SingleStep() function in 
  17974.     the macro. 
  17975.     Cancel - This cancels the macro. If your macro has an ONCANCEL statement, 
  17976.     it is executed. 
  17977.  
  17978. If your macro modifies open documents, make sure these documents are not the 
  17979. currently executing macros. Note that when the macro first pauses, the line 
  17980. about to be executed is selected and can easily be deleted. 
  17981.  
  17982. Syntax 
  17983. SingleStep(State) 
  17984. State determines whether single step mode is off (0) or on (1). 
  17985.  
  17986. Return Value 
  17987. This function does not return a value. 
  17988.  
  17989. Example 
  17990. FUNCTION Example() 
  17991. SingleStep(1) 
  17992. FOR I = 1 to 10 
  17993.     TYPE("Hello...") 
  17994. NEXT 
  17995. END FUNCTION 
  17996.  
  17997. See also: 
  17998.  
  17999.     AnswerMsgBox 
  18000.     DebuggingMacros 
  18001.     IgnoreKeyboard 
  18002.     KeyInterrupt 
  18003.     Macro Error Messages 
  18004.     Messages 
  18005.     UserControl 
  18006.     Using the ONCANCEL Statement 
  18007.     Using the SingleStep and IgnoreKeyboard Functions 
  18008.  
  18009.  
  18010.  
  18011.  
  18012.  
  18013.  
  18014. ΓòÉΓòÉΓòÉ 404. SizeColumnRow ΓòÉΓòÉΓòÉ
  18015.  
  18016. This function sets the column and row width and height. This function is 
  18017. equivalent to choosing Table Column/Row Size. If the automatic row height 
  18018. option is set for the table, the row height option is ignored. 
  18019.  
  18020.  
  18021. Syntax 
  18022. SizeColumnRow(ColWidth, 0, RowHeight, 0) 
  18023. ColWidth is the width of the column in twips. 
  18024. RowHeight is the height of the row in twips. 
  18025. Multiply the desired number of inches by 1440 to determine the value in twips. 
  18026. (1 inch = 1440 twips). 
  18027.  
  18028. To display a dialog box to allow the user to size columns and rows: 
  18029. SizeColumnRow 
  18030.  
  18031. Return Value 
  18032. 1  (TRUE) if the rows and columns were sized. 
  18033. 0  (UserCancel) if the user canceled the function. 
  18034. -2  (GeneralFailure) if the rows and columns were not sized. 
  18035.  
  18036. Example 
  18037. FUNCTION Example() 
  18038. SizeColumnRow(720, 0, 180, 0) 
  18039. END FUNCTION 
  18040.  
  18041. See also: 
  18042.  
  18043.     DeleteColumnRow 
  18044.     InsertColumnRow 
  18045.  
  18046.  
  18047. ΓòÉΓòÉΓòÉ 405. SmallCaps ΓòÉΓòÉΓòÉ
  18048.  
  18049. This function sets the small capitalization for selected text or for all 
  18050. following text if no text is selected. It acts as a toggle, turning off small 
  18051. caps if it is currently on, and turning on small caps if it is currently off. 
  18052. This function is equivalent to choosing Text Caps SmallCaps. 
  18053.  
  18054.  
  18055. Syntax 
  18056. SmallCaps() 
  18057.  
  18058. Return Value 
  18059. 1  (TRUE) if the attribute was set. 
  18060. -6  (NoMemory) if the function failed because of insufficient memory. 
  18061.  
  18062. Example 
  18063. FUNCTION Example() 
  18064. WHILE "" = CurShade$() 
  18065.     UserControl("Select the text to modify, then choose Resume...") 
  18066. WEND 
  18067. SmallCaps() 
  18068. END FUNCTION 
  18069.  
  18070. See also: 
  18071.  
  18072.     LowerCase 
  18073.     UpperCase 
  18074.  
  18075.  
  18076. ΓòÉΓòÉΓòÉ 406. Spacing ΓòÉΓòÉΓòÉ
  18077.  
  18078. This function sets line spacing for the current paragraph or selected 
  18079. paragraphs. This function is equivalent to choosing Text Spacing. 
  18080.  
  18081.  
  18082. Syntax 
  18083. Spacing(Amount) 
  18084. Amount is the new spacing to set. The Amount parameter determines fixed line 
  18085. spacing according to the following list: 
  18086.     SpaceStyle (0) - Use the line spacing specified in the paragraph style 
  18087.     SpaceSingle (-1) - Use single spacing 
  18088.     SpaceOneHalf (-2) - Use 1 1/2 line spacing 
  18089.     SpaceDouble (-3) - Use double spacing 
  18090. To set custom line spacing, the Amount parameter should be a positive integer 
  18091. representing line spacing in twips. To determine twips from points, multiply 
  18092. the point size by 20. 
  18093.  
  18094. To display the Spacing dialog box and allow the user to determine the new 
  18095. spacing: Spacing 
  18096.  
  18097. Return Value 
  18098. 1  (TRUE) if the line spacing was successfully changed. 
  18099. 0  (UserCancel) if the user canceled the function. 
  18100. -6  (NoMemory) if the function failed because of insufficient memory. 
  18101.  
  18102. Example 
  18103. FUNCTION Example() 
  18104. Spacing(-2) 
  18105. END FUNCTION 
  18106.  
  18107. See also: 
  18108.  
  18109.     Center 
  18110.     FontChange 
  18111.     Justify 
  18112.     LeftAlign 
  18113.     NormalText 
  18114.     RightAlign 
  18115.  
  18116.  
  18117. ΓòÉΓòÉΓòÉ 407. SpecialEffects ΓòÉΓòÉΓòÉ
  18118.  
  18119. This function sets special effects for selected text or for all following text 
  18120. if no text is selected. This function is equivalent to choosing Text Special 
  18121. Effects. 
  18122.  
  18123.  
  18124. Syntax 
  18125. SpecialEffects(Which, OverStrikeChar) 
  18126. Which is a flag representing the special effects to use and can be one of the 
  18127. following: 
  18128.     Superscript (64) - Superscript text 
  18129.     Subscript (128) - Subscript text 
  18130.     DoubleUnderline (256) - Double underline text 
  18131.     Strikethrough (512) - Strikethrough text 
  18132.     Overstrike (1024) - Overstrike text with character given in OverStrike 
  18133.     parameter 
  18134. OverStrikeChar is the character used to overstrike the text. The Overstrike 
  18135. value in the Which parameter must also be set. 
  18136. More than one special effect can be chosen by adding the values for the desired 
  18137. effects together. 
  18138.  
  18139. To display the Special Effects dialog box and allow the user to determine 
  18140. special effects settings: SpecialEffects 
  18141.  
  18142. Return Value 
  18143. 1  (TRUE) if the special effects were applied. 
  18144. 0  (UserCancel) if the user canceled the function. 
  18145. -6  (NoMemory) if the function failed because of insufficient memory. 
  18146.  
  18147. Example 
  18148. FUNCTION Example() 
  18149. SpecialEffects(Superscript + DoubleUnderline, "") 
  18150. END FUNCTION 
  18151.  
  18152. See also: 
  18153.  
  18154.     NormalText 
  18155.     Underline 
  18156.     WordUnderline 
  18157.  
  18158.  
  18159. ΓòÉΓòÉΓòÉ 408. SpellCheck ΓòÉΓòÉΓòÉ
  18160.  
  18161. This function allows you to check the spelling of words or documents. This 
  18162. function is equivalent to choosing Tools Spell Check. 
  18163.  
  18164.  
  18165. A macro must be edited to insert this non-recordable function. 
  18166.  
  18167. Syntax 
  18168. SpellCheck(Options) 
  18169. Options is a flag representing the options to use for the spell check, and can 
  18170. be one or more of the following: 
  18171.     SpellBegin (1) - Starts the spell checking from the beginning of the 
  18172.     document. 
  18173.     CurrentStream (2) - Spell checks only the current stream. Do not set this 
  18174.     flag if you want all streams to be spell checked. 
  18175.     NoDoubleWord (4) - Ignores repeated words. 
  18176.     IgnoreNums (8) - Ignores words containing numbers. 
  18177.     IgnoreInitCaps (16) - Checks the spelling of words that do not begin with a 
  18178.     capital letter. 
  18179.     TurboCheck (32) - Speeds up the spell checking by only checking the 
  18180.     documents that have been flagged as changed since the last spell check. 
  18181.     SpellAlt (64) - Checks for alternate spelling entered by the user. 
  18182.  
  18183. To display the Spell Check dialog box and allow the user to select the 
  18184. parameters: SpellCheck 
  18185.  
  18186. Return Value 
  18187. 1  (TRUE) if the spell check was done. 
  18188. 0  (UserCancel) if the user canceled the function. 
  18189. -2  (GeneralFailure) if the spell check could not be done. 
  18190.  
  18191. Example 
  18192. FUNCTION Example() 
  18193. SpellCheck(1) 
  18194. END FUNCTION 
  18195.  
  18196. See also: 
  18197.  
  18198.     ChangeLanguage 
  18199.     Thesaurus 
  18200.  
  18201.  
  18202.  
  18203.  
  18204. ΓòÉΓòÉΓòÉ 409. StandardView ΓòÉΓòÉΓòÉ
  18205.  
  18206. This function changes the current view level to standard view. This function is 
  18207. equivalent to choosing View Standard. 
  18208.  
  18209.  
  18210. Syntax 
  18211. StandardView() 
  18212.  
  18213. Return Value 
  18214. This function returns 1. 
  18215.  
  18216. Example 
  18217. FUNCTION Example() 
  18218. StandardView() 
  18219. END FUNCTION 
  18220.  
  18221. See also: 
  18222.  
  18223.     CustomView 
  18224.     EnlargedView 
  18225.     FacingView 
  18226.     FullPageView 
  18227.     GetViewLevel 
  18228.     LayoutMode 
  18229.  
  18230.  
  18231. ΓòÉΓòÉΓòÉ 410. StatusBarMsg ΓòÉΓòÉΓòÉ
  18232.  
  18233. This function displays a message in the Ami Pro status bar. The macro does not 
  18234. pause. The message can be reset by calling this function with the null string 
  18235. ("") as its parameter. 
  18236.  
  18237.  
  18238. Syntax 
  18239. StatusBarMsg(Message) 
  18240. Message is the string of text to be displayed in the program's status bar. If 
  18241. the null string ("") is sent, the default Ami Pro status bar is restored. 
  18242.  
  18243. Return Value 
  18244. 1  (TRUE) if the message was displayed. 
  18245. -2  (GeneralFailure) if the message could not be displayed. 
  18246.  
  18247. Example 
  18248. FUNCTION Example() 
  18249. IgnoreKeyboard(1) 
  18250. HourGlass(1) 
  18251. StatusBarMsg("Importing graphic file...") 
  18252. ImportPicture("Bitmap", "C:\AMIPRO\ICONS\123W.BMP", ".BMP", 0) 
  18253. StatusBarMsg("") 
  18254. HourGlass(0) 
  18255. IgnoreKeyboard(0) 
  18256. END FUNCTION 
  18257.  
  18258. See also: 
  18259.  
  18260.     AnswerMsgBox 
  18261.     HourGlass 
  18262.     IgnoreKeyboard 
  18263.     KeyInterrupt 
  18264.     Messages 
  18265.  
  18266.  
  18267. ΓòÉΓòÉΓòÉ 411. strcat ΓòÉΓòÉΓòÉ
  18268.  
  18269. This function concatenates strings together to make a longer string. Any number 
  18270. of strings can be appended together at a time. 
  18271.  
  18272.  
  18273. Syntax 
  18274. strcat$(Text1, Text2[, Text3...]) 
  18275. Text1 is a string to which Text2 is appended. 
  18276. Text2 is a string which is appended to Text1. 
  18277. Text3 is a string which is appended to Text1 and Text2. 
  18278.  
  18279. Return Value 
  18280. This function returns the new string. 
  18281.  
  18282. Example 
  18283. FUNCTION Example() 
  18284. MacFile = GetRunningMacroFile$() 
  18285. SetDlgCallBack(50, "{MacFile}!Message1") 
  18286. Box = DialogBox(".", "ExampleBox") 
  18287. IF Box = -1 
  18288.     Message("Could not find dialog box!") 
  18289.     EXIT FUNCTION 
  18290. ELSEIF Box = 0 
  18291.     EXIT FUNCTION 
  18292. ENDIF 
  18293. TYPE(GetDialogField$(8002)) 
  18294. END FUNCTION 
  18295.  
  18296. FUNCTION Message1(hdlg, id, text) 
  18297. Name = GetDlgItemText(hdlg, 8000) 
  18298. Message("The contents of the first box are {Name}.") 
  18299. Message("We will now fill the second box with the inverse of {Name}.") 
  18300. FOR I = len(Name) to 1 step -1 
  18301.     Name2 = strcat$(Name2, MID$(Name, I, 1)) 
  18302. NEXT 
  18303. SetDlgItemText(hdlg, 8002, Name2) 
  18304. END FUNCTION 
  18305.  
  18306. DIALOG ExampleBox 
  18307. -2134376448 8 106 38 160 54 "" "" "Sample Dialog Box" 
  18308. FONT 6 "Helv" 
  18309. 50 6 62 12 8000 1350631552 "edit" "" 0 
  18310. 4 6 44 10 1000 1342177280 "static" "Your Name:" 0 
  18311. 50 20 62 12 1003 1342177287 "static" "" 0 
  18312. 4 22 44 10 1002 1342177280 "static" "Reversed:" 0 
  18313. 52 22 58 8 8002 1342177280 "static" "" 0 
  18314. 116 4 40 14 1 1342242817 "button" "OK" 0 
  18315. 116 20 40 14 2 1342242816 "button" "Cancel" 0 
  18316. 100 36 56 14 50 1342242816 "button" "&Run Example..." 0 
  18317. END DIALOG 
  18318.  
  18319. See also: 
  18320.  
  18321.     ASC 
  18322.     FormatNum$ 
  18323.     LCASE$ 
  18324.     LEN 
  18325.     MID$ 
  18326.     strchr 
  18327.     strfield$ 
  18328.     UCASE$ 
  18329.  
  18330.  
  18331. ΓòÉΓòÉΓòÉ 412. strchr ΓòÉΓòÉΓòÉ
  18332.  
  18333. This function searches the specified string for a character. It returns the 
  18334. location of the character within the string. 
  18335.  
  18336.  
  18337. Syntax 
  18338. strchr(Offset, Text, Char) 
  18339. Offset is the location in the string to begin searching. Offset is one based. 
  18340. To search from the beginning of the string, use an offset of 1. 
  18341. Text is a string that is searched for a specific character. 
  18342. Char is the first character to be searched for. 
  18343.  
  18344. Return Value 
  18345. The number of characters into the string at which the desired character was 
  18346. found. 
  18347. -1 if the desired character is not found in the string, the function returns. 
  18348.  
  18349. Example 
  18350. FUNCTION Example() 
  18351. String = Query$("Enter the string:") 
  18352. Offset = 0 
  18353. Char = Query$("What char to search for?") 
  18354. Position = Strchr(Offset, String, Char) 
  18355. Message(Position) 
  18356. END FUNCTION 
  18357.  
  18358. See also: 
  18359.  
  18360.     ASC 
  18361.     CHR$ 
  18362.     FormatNum$ 
  18363.     Instr 
  18364.     LCASE$ 
  18365.     Left$ 
  18366.     LEN 
  18367.     MID$ 
  18368.     Right$ 
  18369.     strcat$ 
  18370.     strfield$ 
  18371.     UCASE$ 
  18372.  
  18373.  
  18374. ΓòÉΓòÉΓòÉ 413. strfield ΓòÉΓòÉΓòÉ
  18375.  
  18376. This function is used to extract individual fields from a field delimited 
  18377. string. The function assumes a record format where variable length fields are 
  18378. separated from each other with a unique character. 
  18379.  
  18380.  
  18381. Syntax 
  18382. strfield$(Text, FieldNumber, Separator) 
  18383. Text is the string from which the field is extracted. 
  18384. FieldNumber is the number of the field to be extracted (1 = first field). 
  18385. Separator is the character which separates the fields. 
  18386.  
  18387. Return Value 
  18388. This function returns the extracted field. 
  18389.  -1 if there are not enough fields in the string. 
  18390. The null string ("") if the desired field is empty. 
  18391.  
  18392. Example 
  18393. FUNCTION Example() 
  18394. LayoutMode() 
  18395. IF not IsFrameSelected() 
  18396.     Pos = CursorPosition$() 
  18397.     x = strfield$(Pos, 1, ",") 
  18398.     y = strfield$(Pos, 2, ",") 
  18399.     AddFrame(x, y, (x + 1440), (y - 1440)) 
  18400. ENDIF 
  18401. Type("[enter]") 
  18402. END FUNCTION 
  18403.  
  18404. See also: 
  18405.  
  18406.     ASC 
  18407.     CHR$ 
  18408.     strcat$ 
  18409.     strchr 
  18410.     LCASE$ 
  18411.     UCASE$ 
  18412.     MID$ 
  18413.     LEN 
  18414.     FormatNum$ 
  18415.  
  18416.  
  18417.  
  18418. ΓòÉΓòÉΓòÉ 414. StyleManagement ΓòÉΓòÉΓòÉ
  18419.  
  18420. This function allows the user to view the Style Management dialog box and 
  18421. assign function keys to paragraph styles. This function is equivalent to 
  18422. choosing Style Style Management. 
  18423.  
  18424.  
  18425. This function does not manage paragraph styles automatically. 
  18426.  
  18427. Syntax 
  18428. StyleManagement() 
  18429.  
  18430. Return Value 
  18431. 1  (TRUE) if the changes were accepted. 
  18432. 0  (UserCancel) if the user canceled the function. 
  18433.  
  18434. Example 
  18435. FUNCTION Example() 
  18436. StyleManagement() 
  18437. END FUNCTION 
  18438.  
  18439. See also: 
  18440.  
  18441.     ModifyStyle 
  18442.     SaveAsNewStyle 
  18443.  
  18444.  
  18445. ΓòÉΓòÉΓòÉ 415. TableGetRange ΓòÉΓòÉΓòÉ
  18446.  
  18447. This function returns the starting and ending rows selected if the insertion 
  18448. point is in a table. If a single cell or no cell is selected, the starting row 
  18449. equals the ending row. If you are not in a table, the passed variables are not 
  18450. changed. 
  18451.  
  18452.  
  18453. Syntax 
  18454. TableGetRange(&StartRow, &StartCol, &EndRow, &EndCol) 
  18455. &StartRow contains the row the insertion point is in. 
  18456. &StartCol contains the column the insertion point is in. 
  18457. &EndRow contains the last selected row. 
  18458. &EndCol contains the last selected column. 
  18459. If a range is selected in the table, StartRow and StartCol are different from 
  18460. EndRow and EndCol. 
  18461. If you are not in the  tables mode, StartRow, StartCol, EndRow, and EndCol are 
  18462. not changed. 
  18463.  
  18464. Return Value 
  18465.  1  (TRUE) if you are in  tables  mode, the variables are updated. 
  18466.  0  (FALSE) if you are not in  tables mode. 
  18467.  
  18468. Example 
  18469. FUNCTION Example() 
  18470. DEFSTR StartRow, StartCol, EndRow, EndCol; 
  18471. Tables(1, TRUE, 4, 10) 
  18472. TableLayout(2, Off, 1440, 0, 1440, 0, On, On, 9, Off, On, Off) 
  18473. WHILE StartRow != 2 
  18474. TYPE("[Right]") 
  18475. TableGetRange(&StartRow, &StartCol, &EndRow, &EndCol) 
  18476. WEND 
  18477. TYPE("[SHIFTRight][SHIFTRight]") 
  18478. ConnectCells() 
  18479. TableLines(AllSides, 0, 0, OnePoint, 0) 
  18480. END FUNCTION 
  18481.  
  18482. See also: 
  18483.  
  18484.     TableLayout 
  18485.     Tables 
  18486.  
  18487.  
  18488. ΓòÉΓòÉΓòÉ 416. TableLayout ΓòÉΓòÉΓòÉ
  18489.  
  18490. This function sets the layout of an existing table. This function is equivalent 
  18491. to choosing Table Modify Table Layout. 
  18492.  
  18493.  
  18494. Syntax 
  18495. TableLayout(2, AutoHeight, ColWidth, 0, RowHeight, 0, Center, LineAround, 
  18496. LineStyle, HonorProtect, SpanPages, DisableMouse) 
  18497. AutoHeight is a flag indicating whether the automatic row height option is 
  18498. enabled. The AutoHeight parameter should be set to 1 (On) if the height of rows 
  18499. should be allowed to grow automatically, or 0 (Off) if the row height should be 
  18500. fixed. 
  18501. ColWidth is the default width of the columns in twips (1 inch = 1440 twips). 
  18502. RowHeight is the default height of the rows in twips (1 inch = 1440 twips). If 
  18503. AutoHeight=On, RowHeight is ignored but must be set. 
  18504. Center is a flag indicating whether a page table should be centered on the page 
  18505. and can be one of the following: 
  18506.     1 (On) if the table should be centered on the page. 
  18507.     0 (Off) if the table is not to be centered on the page. 
  18508. If the table is in a frame, this parameter is ignored, but should still be set. 
  18509. LineAround is a flag indicating whether there should be a line around the 
  18510. table, and may be one of the following: 
  18511.     1 (On) if a line should be drawn around the table. 
  18512.     0 (Off) if no line should be drawn around the table. 
  18513. LineStyle is the paragraph style to use for the line around the table and may 
  18514. be one of the following: 
  18515.     Hairline (1) - Hairline 
  18516.     OnePoint (2) - One point rule 
  18517.     TwoPoint (3) - Two point rule 
  18518.     ThreePoint (4) - Three point rule 
  18519.     FourPoint (5) - Four point rule 
  18520.     FivePoint (6) - Five point rule 
  18521.     SixPoint (7) - Six point rule 
  18522.     DoubleOnePoint (8) - Parallel one point rules 
  18523.     DoubleTwoPoint (9) - Parallel two point rules 
  18524.     ThreeLines (10) - Hairline above and below a two point rule 
  18525.     HairBelow (11) - Hairline below a three point rule 
  18526.     HairAbove (12) - Hairline above a three point rule 
  18527. If LineAround=0, LineStyle is ignored but must be set. 
  18528. HonorProtect is a flag indicating whether protection should be honored in the 
  18529. table and may be one of the following: 
  18530.     1 (On) if cells marked as protected should not be editable. 
  18531.     0 (Off) if protected cells can be edited. 
  18532. SpanPages is a flag indicating whether data in a cell should continue to the 
  18533. next page without moving the entire row to the next page. The AutoHeight 
  18534. parameter must also be set to 1 if SpanPages is set to 1. 
  18535.     1 (On) - If rows should span pages 
  18536.     0 (Off) - If rows should not span pages 
  18537. DisableMouse is a flag indicating whether the mouse can change the size of rows 
  18538. and columns. 
  18539.     1 (On) if the mouse should be disabled 
  18540.     0 (Off) if the mouse should be enabled 
  18541.  
  18542. To display the Table Layout dialog box and allow the user to set the table 
  18543. layout: TableLayout 
  18544.  
  18545. Return Value 
  18546. 1  (TRUE) if the table layout was changed. 
  18547. 0  (UserCancel) if the user canceled the function. 
  18548. -2  (GeneralFailure) if the layout could not be changed. 
  18549. -6  (NoMemory) if the function failed because of insufficient memory. 
  18550.  
  18551. Example 
  18552. FUNCTION Example() 
  18553. DEFSTR StartRow, StartCol, EndRow, EndCol; 
  18554. Tables(1, TRUE, 4, 10) 
  18555. TableLayout(2, Off, 1440, 0, 1440, 0, On, On, 9, Off, On, Off) 
  18556. WHILE StartRow != 2 
  18557. TYPE("[Right]") 
  18558. TableGetRange(&StartRow, &StartCol, &EndRow, &EndCol) 
  18559. WEND 
  18560. TYPE("[SHIFTRight][SHIFTRight]") 
  18561. ConnectCells() 
  18562. TableLines(AllSides, 0, 0, OnePoint, 0) 
  18563. END FUNCTION 
  18564.  
  18565. See also: 
  18566.  
  18567.     ProtectCells 
  18568.     TableLines 
  18569.     Tables 
  18570.  
  18571.  
  18572. ΓòÉΓòÉΓòÉ 417. TableLines ΓòÉΓòÉΓòÉ
  18573.  
  18574. This function sets the line and color options for a cell or group of cells. 
  18575. This function is equivalent to choosing Table Lines & Color. 
  18576.  
  18577.  
  18578. Syntax 
  18579. TableLines(LineOn, LineOff, NoChange, LineStyle, ShadeType) 
  18580. LineOn is a flag indicating which sides of the cell should have the new lines 
  18581. and colors and may be one or more of the following: 
  18582.     AllSides (1) - All sides of the cell 
  18583.     Outline (2) - The outline of the cell 
  18584.     LeftSide (4) - The left side of the cell 
  18585.     RightSide (8) - The right side of the cell 
  18586.     TopSide (16) - The top side of the cell 
  18587.     BottomSide (32) - The bottom side of the cell 
  18588.     CellShade (64) - The shading of the cell 
  18589. Multiple sides of the cell can be specified by adding the individual values 
  18590. together. 
  18591. LineOff is a flag indicating which sides of the cell should not have lines or 
  18592. colors and may be one or more of the following: 
  18593.     AllSides (1) - All sides of the cell 
  18594.     Outline (2) - The outline of the cell 
  18595.     LeftSide (4) - The left side of the cell 
  18596.     RightSide (8) - The right side of the cell 
  18597.     TopSide (16) - The top side of the cell 
  18598.     BottomSide (32) - The bottom side of the cell 
  18599.     CellShade (64) - The shading of the cell 
  18600. Multiple sides of the cell can be specified by adding the individual values 
  18601. together. 
  18602. NoChange is a flag indicating which sides of the cell should remain the same 
  18603. and may be one or more of the following: 
  18604.     None (0) - No sides of the cell 
  18605.     AllSides (1) - All sides of the cell 
  18606.     Outline (2) - The outline of the cell 
  18607.     LeftSide (4) - The left side of the cell 
  18608.     RightSide (8) - The right side of the cell 
  18609.     TopSide (16) - The top side of the cell 
  18610.     BottomSide (32) - The bottom side of the cell 
  18611.     CellShade (64) - The shading of the cell 
  18612. Multiple sides of the cell can be specified by adding the individual values 
  18613. together. 
  18614. The LineOn, LineOff, and NoChange parameters are equivalent to choosing check 
  18615. box states for each of the sides of the cell. Using the menu function, a 
  18616. checked box indicates that the new lines and colors should be applied to the 
  18617. element indicated by the box. An unchecked box indicates that no lines and 
  18618. colors should be applied to an element. A grayed box indicates that lines or 
  18619. colors are already applied to the element and that they should not be changed 
  18620. from what they already are. 
  18621. LineStyle is a number representing the desired line paragraph style and may be 
  18622. one of the following: 
  18623.     Hairline (1) - Hairline 
  18624.     OnePoint (2) - One point rule 
  18625.     TwoPoint (3) - Two point rule 
  18626.     ThreePoint (4) - Three point rule 
  18627.     FourPoint (5) - Four point rule 
  18628.     FivePoint (6) - Five point rule 
  18629.     SixPoint (7) - Six point rule 
  18630.     DoubleOnePoint (8) - Parallel one point rules 
  18631.     DoubleTwoPoint (9) - Parallel two point rules 
  18632.     ThreeLines (10) - Hairline above and below a two point rule 
  18633.     HairBelow (11) - Hairline below a three point rule 
  18634.     HairAbove (12) - Hairline above a three point rule 
  18635. ShadeType is a number representing the desired shading type and may be one of 
  18636. the following: 
  18637.     BlackShade (1) - Black background 
  18638.     SeventyFiveShade (2) - 75% black shading 
  18639.     FiftyShade (3) - 50% black shading 
  18640.     TwentyFiveShade (4) - 25% black shading 
  18641.     TenShade (5) - 10% black shading 
  18642.     BlueShade (6) - Blue background 
  18643.     RedShade (7) - Red background 
  18644.     MagentaShade (8) - Purple background 
  18645.     GreenShade (9) - Green background 
  18646.     YellowShade (10) - Yellow background 
  18647.     CyanShade (11) - Light blue background 
  18648.     WhiteShade (12) - White background 
  18649. If no shading should be applied to the cell(s), this parameter should be set 
  18650. but the value of the parameter is ignored. 
  18651.  
  18652. To display the Lines dialog box and allow the user to set the table line 
  18653. options: TableLines 
  18654.  
  18655. Return Value 
  18656. 1  (TRUE) if the cell lines and colors were changed. 
  18657. 0  (UserCancel) if the user canceled the function. 
  18658. -2  (GeneralFailure) if the lines could not be changed. 
  18659. -6  (NoMemory) if the function failed because of insufficient memory. 
  18660.  
  18661. Example 
  18662. FUNCTION Example() 
  18663. DEFSTR StartRow, StartCol, EndRow, EndCol; 
  18664. Tables(1, TRUE, 4, 10) 
  18665. TableLayout(2, Off, 1440, 0, 1440, 0, On, On, 9, Off, On, Off) 
  18666. WHILE StartRow != 2 
  18667. TYPE("[Right]") 
  18668. TableGetRange(&StartRow, &StartCol, &EndRow, &EndCol) 
  18669. WEND 
  18670. TYPE("[SHIFTRight][SHIFTRight]") 
  18671. ConnectCells() 
  18672. TableLines(AllSides, 0, 0, OnePoint, 0) 
  18673. END FUNCTION 
  18674.  
  18675. See also: 
  18676.  
  18677.     TableLayout 
  18678.     Tables 
  18679.  
  18680.  
  18681. ΓòÉΓòÉΓòÉ 418. Tables ΓòÉΓòÉΓòÉ
  18682.  
  18683. This function creates a table with the specified parameters. This function is 
  18684. equivalent to choosing Tools Tables. 
  18685.  
  18686.  
  18687. Syntax 
  18688. Tables(Which, AutoHeight[, ColWidth, 0, RowHeight, 0, Center, LineAround, 
  18689. LineStyle, HonorProtect, SpanPages], NumCols, NumRows) 
  18690. Which is a flag indicating what to do with this function and can be one of the 
  18691. following: 
  18692.     (1) - Creates only the table 
  18693.     (3) - Creates the table and includes the table layout information 
  18694. AutoHeight is set if the height of the rows in the new table should be auto 
  18695. height. This function can be a 1 (On), or a 0 (Off). 
  18696. ColWidth is the width of the columns to create, in twips. 
  18697. RowHeight is the height of the rows to create, in twips. 
  18698. This parameter is ignored if the AutoHeight parameter is set to 1. 
  18699. Center is set if you want the table to be centered between the margins and may 
  18700. be a 1 (On) or a 0 (Off). 
  18701. If this table is being placed in a frame, this parameter is ignored. 
  18702. LineAround is used if you want a line to be placed around the table and may be 
  18703. a 1 (On) or a 0 (Off). 
  18704. LineStyle is the style of the line to be placed around the table if the 
  18705. LineAround parameter is set to 1. 
  18706. HonorProtect is set if you want honor protection set inside the table. It can 
  18707. be a 1 (On) or a 0 (Off). 
  18708. SpanPages is set if you want rows to span pages (On) or if you want rows to be 
  18709. retained separately over page breaks (Off). 
  18710. NumCols is the number of columns to place in this table. 
  18711. NumRows is the number of rows to place in this table. 
  18712.  
  18713. Return Value 
  18714. 1  (TRUE) if the table was created. 
  18715. 0  (UserCancel) if the user canceled the function. 
  18716. -2  (GeneralFailure) if the table could not be created. 
  18717.  
  18718. Example 
  18719. FUNCTION Example() 
  18720. DEFSTR StartRow, StartCol, EndRow, EndCol; 
  18721. Tables(1, TRUE, 4, 10) 
  18722. TableLayout(2, Off, 1440, 0, 1440, 0, On, On, 9, Off, On, Off) 
  18723. WHILE StartRow != 2 
  18724. TYPE("[Right]") 
  18725. TableGetRange(&StartRow, &StartCol, &EndRow, &EndCol) 
  18726. WEND 
  18727. TYPE("[SHIFTRight][SHIFTRight]") 
  18728. ConnectCells() 
  18729. TableLines(AllSides, 0, 0, OnePoint, 0) 
  18730. END FUNCTION 
  18731.  
  18732. See also: 
  18733.  
  18734.     AddFrame 
  18735.     TableLayout 
  18736.     TableLines 
  18737.  
  18738.  
  18739.  
  18740.  
  18741. ΓòÉΓòÉΓòÉ 419. TabRulerInsert ΓòÉΓòÉΓòÉ
  18742.  
  18743. This function inserts a tab ruler. This function is equivalent to choosing Page 
  18744. Ruler Insert. 
  18745.  
  18746.  
  18747. Syntax 
  18748. TabRulerInsert() 
  18749.  
  18750. Return Value 
  18751. 1  (TRUE) if the tab ruler was inserted. 
  18752. If this function is called when Page/Ruler/Insert is grayed, the macro 
  18753. terminates and displays an error message. 
  18754.  
  18755. Example 
  18756. FUNCTION Example() 
  18757. TabRulerInsert() 
  18758. END FUNCTION 
  18759.  
  18760. See also: 
  18761.  
  18762.     ModifyLayout 
  18763.     TabRulerRemove 
  18764.  
  18765.  
  18766.  
  18767. ΓòÉΓòÉΓòÉ 420. TabRulerRemove ΓòÉΓòÉΓòÉ
  18768.  
  18769. This function removes a tab ruler. This function is equivalent to choosing Page 
  18770. Ruler Remove. 
  18771.  
  18772.  
  18773. Syntax 
  18774. TabRulerRemove() 
  18775.  
  18776. Return Value 
  18777. 1  (TRUE) if the tab ruler was removed. 
  18778. If this function is called when Page Ruler Remove is grayed, the macro 
  18779. terminates and displays an error message. 
  18780.  
  18781. Example 
  18782. FUNCTION Example() 
  18783. TabRulerRemove() 
  18784. END FUNCTION 
  18785.  
  18786. See also: 
  18787.  
  18788.     ModifyLayout 
  18789.     TabRulerInsert 
  18790.  
  18791.  
  18792. ΓòÉΓòÉΓòÉ 421. Thesaurus ΓòÉΓòÉΓòÉ
  18793.  
  18794. This function displays the Thesaurus dialog box and searches for the selected 
  18795. word in the Thesaurus. This function is equivalent to choosing Tools Thesaurus. 
  18796. This function does not automatically use the thesaurus functions. 
  18797.  
  18798.  
  18799. Syntax 
  18800. Thesaurus() 
  18801.  
  18802. Return Value 
  18803. This function returns 0. 
  18804.  
  18805. Example 
  18806. FUNCTION Example() 
  18807. Thesaurus() 
  18808. END FUNCTION 
  18809.  
  18810. See also: 
  18811.  
  18812.     SpellCheck 
  18813.  
  18814.  
  18815. ΓòÉΓòÉΓòÉ 422. TileWindow ΓòÉΓòÉΓòÉ
  18816.  
  18817. This function allows you to tile windows without overlapping them. This 
  18818. function is equivalent to choosing Window Tile. 
  18819.  
  18820.  
  18821. Syntax 
  18822. TileWindow() 
  18823.  
  18824. Return Value 
  18825. This function does not return a value. 
  18826.  
  18827. Example 
  18828. FUNCTION Example() 
  18829. Text = UCASE$(Left$(Query$("What action to take (Tile, Cascade, New, Select) on 
  18830. MDI Windows?"), 1)) 
  18831. SWITCH Text 
  18832. CASE "T" 
  18833. TileWindow() 
  18834. CASE "C" 
  18835. CascadeWindow() 
  18836. CASE "N" 
  18837. NewWindow() 
  18838. CASE "S" 
  18839. SelectWindow(Query$("Name of window to select (Name must match EXACTLY)?")) 
  18840. default 
  18841. Message("Only the proposed options are available.") 
  18842. ENDSWITCH 
  18843. END FUNCTION 
  18844.  
  18845. See also: 
  18846.  
  18847.     CascadeWindow 
  18848.     NewWindow 
  18849.     NextWindow 
  18850.     SelectWindow 
  18851.  
  18852.  
  18853.  
  18854. ΓòÉΓòÉΓòÉ 423. TOCOptions ΓòÉΓòÉΓòÉ
  18855.  
  18856. This function sets the options for a generated table of contents for the 
  18857. current document. This function is equivalent to choosing File Master Document 
  18858. and choosing TOC Options. It is also equivalent to choosing Tools Generate TOC 
  18859. and choosing TOC Options. 
  18860.  
  18861.  
  18862. Syntax 
  18863. TOCOptions(Style, Separator, Flag[, Style, Separator, Flag...]) 
  18864. Style is the name of the paragraph style. 
  18865. Separator is the character that separates the text from the page number. The 
  18866. separator that can be used is dependent on the Flag parameter and can be one of 
  18867. the following: 
  18868.     ("") - None 
  18869.     (".") - Dot 
  18870.     ("-") - Dash 
  18871.     ("_") - Underline 
  18872.     (",") - Comma 
  18873. Flag can be either page numbers, or right alignment and page numbers. 
  18874.     (1) - Use page numbers 
  18875.     (2) - Use right alignment (must combine with Use page numbers) 
  18876. The rules for the Flag parameter: 
  18877.     If both page numbers and right align are used, the separator can be none, 
  18878.     dot, dash or underline. 
  18879.     If only page numbers are used, the separator can be only none or comma. 
  18880.     If right align is used, it must be combined with the value for Use page 
  18881.     numbers. 
  18882.     If page numbers are not used, the separator must be none. 
  18883.  
  18884. Return Value 
  18885. This function returns 1. 
  18886.  
  18887. Example 
  18888. FUNCTION Example() 
  18889. TOCOptions("Title" "." 3 "Subhead" ", " 1 ) 
  18890. END FUNCTION 
  18891.  
  18892. See also: 
  18893.  
  18894.     Generate 
  18895.     SetTOCFile 
  18896.  
  18897.  
  18898. ΓòÉΓòÉΓòÉ 424. ToggleCleanScreen ΓòÉΓòÉΓòÉ
  18899.  
  18900. This functions turns on Clean Screen mode if it is not already on. If Clean 
  18901. Screen mode is on, then it turns off. This function is equivalent to choosing 
  18902. View Hide Clean Screen or View Show Clean Screen. 
  18903.  
  18904.  
  18905. Syntax 
  18906. ToggleCleanScreen() 
  18907.  
  18908. Return Value 
  18909. This function returns 1. 
  18910.  
  18911. Example 
  18912. FUNCTION Example() 
  18913. CleanScreenOptions(112)  ' Display the scroll bars and return icon 
  18914. ToggleCleanScreen() 
  18915. END FUNCTION 
  18916.  
  18917. See also: 
  18918.  
  18919.     CleanScreenOptions 
  18920.  
  18921.  
  18922. ΓòÉΓòÉΓòÉ 425. ToggleIconBar ΓòÉΓòÉΓòÉ
  18923.  
  18924. This function shows or hides the set of SmartIcons. If the SmartIcon set is 
  18925. displayed, it is hidden. If the SmartIcon set is hidden, it is displayed. This 
  18926. function is equivalent to choosing View Hide SmartIcons or View Show 
  18927. SmartIcons. 
  18928.  
  18929.  
  18930. Syntax 
  18931. ToggleIconBar() 
  18932.  
  18933. Return Value 
  18934. 1  (TRUE) if the icon bar toggled. 
  18935. 0  (NoAction) if no action was taken. 
  18936.  
  18937. Example 
  18938. FUNCTION Example() 
  18939. ToggleIconBar() 
  18940. END FUNCTION 
  18941.  
  18942. See also: 
  18943.  
  18944.     HideIconBar 
  18945.     IconBottom 
  18946.     IconCustomize 
  18947.     IconFloating 
  18948.     IconLeft 
  18949.     IconRight 
  18950.     IconTop 
  18951.     ShowIconBar 
  18952.     ShowIconBar 
  18953.     ToggleTabRuler 
  18954.     ViewPreferences 
  18955.  
  18956.  
  18957. ΓòÉΓòÉΓòÉ 426. ToggleTabRuler ΓòÉΓòÉΓòÉ
  18958.  
  18959. This function shows or hides the tab ruler. If the tab ruler is displayed, it 
  18960. is hidden. If the tab ruler is hidden, it is displayed. This function is 
  18961. equivalent to choosing View Hide Ruler or View Show Ruler. 
  18962.  
  18963.  
  18964. Syntax 
  18965. ToggleTabRuler() 
  18966.  
  18967. Return Value 
  18968. This function returns 1. 
  18969.  
  18970. Example 
  18971. FUNCTION Example() 
  18972. ToggleTabRuler() 
  18973. END FUNCTION 
  18974.  
  18975. See also: 
  18976.  
  18977.     HideTabRuler 
  18978.     ShowTabRuler 
  18979.     ToggleIconBar 
  18980.     ViewPreferences 
  18981.  
  18982.  
  18983. ΓòÉΓòÉΓòÉ 427. TopOfFile ΓòÉΓòÉΓòÉ
  18984.  
  18985. This function scrolls the document to the beginning of the file without moving 
  18986. the insertion point. This function is equivalent to dragging the slider box on 
  18987. the vertical scroll bar to the extreme top using the mouse. 
  18988.  
  18989.  
  18990. Syntax 
  18991. TopOfFile() 
  18992.  
  18993. Return Value 
  18994. This function returns 0. 
  18995.  
  18996. Example 
  18997. FUNCTION Example() 
  18998. Action = Query$("Move to (T)op of file, or (E)nd of file?") 
  18999. Action = UCASE$(Left$(Action, 1)) 
  19000. SWITCH Action 
  19001. CASE "T" 
  19002. Message(TopOfFile()) 
  19003. CASE "E" 
  19004. Message(EndOfFile()) 
  19005. default 
  19006. Message("""T"" or ""E"" will do just fine, please.") 
  19007. ENDSWITCH 
  19008. END FUNCTION 
  19009.  
  19010. See also: 
  19011.  
  19012.     CharLeft 
  19013.     CharRight 
  19014.     EndOfFile 
  19015.     LeftEdge 
  19016.     LineDown 
  19017.     LineUp 
  19018.     RightEdge 
  19019.     ScreenDown 
  19020.     ScreenLeft 
  19021.     ScreenRight 
  19022.     ScreenUp 
  19023.  
  19024.  
  19025. ΓòÉΓòÉΓòÉ 428. Truncate ΓòÉΓòÉΓòÉ
  19026.  
  19027. This function removes any fractional part of a number. 
  19028.  
  19029.  
  19030. Syntax 
  19031. Truncate(Value) 
  19032. Value is the number to be evaluated. 
  19033.  
  19034. Return Value 
  19035. The integer portion of the passed value. 
  19036.  
  19037. Example 
  19038. FUNCTION Example() 
  19039. Number = 123.4455682 
  19040. Message(Truncate(Number)) 
  19041. END FUNCTION 
  19042.  
  19043. See also: 
  19044.  
  19045.     IsNumeric 
  19046.     Mod 
  19047.     Round 
  19048.  
  19049.  
  19050. ΓòÉΓòÉΓòÉ 429. TYPE ΓòÉΓòÉΓòÉ
  19051.  
  19052. This function inserts information into the current Ami Pro document. You can 
  19053. also use it to move the insertion point or activate a function key. 
  19054.  
  19055.  
  19056. Ami Pro converts the Text into ANSI/UNICode characters when you compile the 
  19057. macro. When you playback the macro, Ami Pro converts the ANSI/UNICode 
  19058. characters to code pages. Ami Pro displays any invalid characters as asterisks. 
  19059.  
  19060. Syntax 
  19061. TYPE(Text) 
  19062. Text is the string to insert into the current Ami Pro document. 
  19063. Text can be any keyboard character. Any attributes or variables within the 
  19064. string are not typed into the document. To insert a left curly brace, type two 
  19065. curly braces ({{). To insert a left square brace, type two square braces ([[). 
  19066. To insert a double quote mark, type two double quote marks (""). Text can 
  19067. contain a variable name. If a variable name is used, enclose it in curly braces 
  19068. ({}) so that it can be recognized as a variable name. 
  19069. Text can also contain an insertion point movement or function key. To type a 
  19070. key, surround its name with square braces. An insertion point movement or 
  19071. function key can include the words CTRL, SHIFT or ALT to indicate a shifted 
  19072. state. The following key names can be used: 
  19073.     [Home] - Home Key 
  19074.     [End] - End Key 
  19075.     [PgUp] - Page Up Key 
  19076.     [PgDn] - Page Down Key 
  19077.     [Ins] - Insert Key 
  19078.     [Del] - Delete Key 
  19079.     [Backspace] - Backspace Key 
  19080.     [Enter] - Enter or Return Key 
  19081.     [Tab] - Tab Key 
  19082.     [ESC] - Escape Key 
  19083.     [Up] - Up Arrow Key 
  19084.     [Down] - Down Arrow Key 
  19085.     [Left] - Left Arrow Key 
  19086.     [Right] - Right Arrow Key 
  19087.     [F1] - [F12] - Function Keys F1 through F12 
  19088.  
  19089. Return Value 
  19090. This function does not return a value. 
  19091.  
  19092. Example 
  19093. FUNCTION Example() 
  19094. TYPE("NumberCharacter[Enter]") 
  19095. FOR I = 1 to 255 
  19096.     Char = CHR$(I) 
  19097.     TYPE("{I}={Char}[Enter]") 
  19098. NEXT 
  19099. END FUNCTION 
  19100.  
  19101. See also: 
  19102.  
  19103.     CurChar$ 
  19104.     CurShade$ 
  19105.     CurWord$ 
  19106.     FormatNum$ 
  19107.  
  19108.  
  19109.  
  19110.  
  19111. ΓòÉΓòÉΓòÉ 430. TypeOver ΓòÉΓòÉΓòÉ
  19112.  
  19113. This function turns Typeover mode on or off. It acts as a toggle, turning off 
  19114. the Typeover mode if it is currently on or turning on the Typeover mode if it 
  19115. is currently off. This function is equivalent to pressing the Insert key. 
  19116.  
  19117.  
  19118. Syntax 
  19119. TypeOver() 
  19120.  
  19121. Return Value 
  19122. 1  (TRUE) if the typeover status was changed. 
  19123. 0  (NoAction) if no action was taken. 
  19124.  
  19125. Example 
  19126. FUNCTION Example() 
  19127. TypeOver() 
  19128. END FUNCTION 
  19129.  
  19130. See also: 
  19131.  
  19132.     TYPE 
  19133.  
  19134.  
  19135. ΓòÉΓòÉΓòÉ 431. UCASE ΓòÉΓòÉΓòÉ
  19136.  
  19137. This function changes lowercase letters in the source string to upper case 
  19138. letters and returns the resulting string. It does not change punctuation or 
  19139. numbers. 
  19140.  
  19141.  
  19142. Syntax 
  19143. UCASE$(Text) 
  19144. Text is the string which changes to upper case. 
  19145.  
  19146. Return Value 
  19147. The string with all uppercase letters. 
  19148.  
  19149. Example 
  19150. FUNCTION Example() 
  19151. Name = UCASE$(Query$("What is your name?")) 
  19152. Message(Name) 
  19153. END FUNCTION 
  19154.  
  19155. See also: 
  19156.  
  19157.     ASC 
  19158.     CHR$ 
  19159.     FormatNum$ 
  19160.     LCASE$ 
  19161.     LEN 
  19162.     MID$ 
  19163.     strcat$ 
  19164.     strfield$ 
  19165.  
  19166.  
  19167. ΓòÉΓòÉΓòÉ 432. Underline ΓòÉΓòÉΓòÉ
  19168.  
  19169. This function sets the underline attribute for selected text or for all 
  19170. following text if no text is selected. It acts as a toggle, turning off the 
  19171. attribute if it is currently on or turning on the attribute if it is currently 
  19172. off. This function is equivalent to choosing Text Underline. 
  19173.  
  19174.  
  19175. Syntax 
  19176. Underline() 
  19177.  
  19178. Return Value 
  19179. 0 if the underline attribute is toggled on and there are no attributes assigned 
  19180. to the text. 
  19181. 4 if the underline attribute is toggled on and the bold attribute is already 
  19182. assigned. 
  19183. 8 if the underline attribute is toggled on and the italic attribute is already 
  19184. assigned. 
  19185. 16 if the underline attribute is toggled off. 
  19186. 32 if the underline attribute is toggled on and the word underline attribute is 
  19187. already assigned. 
  19188. The return values may be added together to identify the attributes that were 
  19189. previously assigned. 
  19190. -2  (GeneralFailure) if the attribute was not changed. 
  19191.  
  19192. Example 
  19193. FUNCTION Example() 
  19194. text = Query$("Enter some text:") 
  19195. New("_default.sty", 0, 0)      'open a new file 
  19196. TYPE("{text}") 
  19197. TYPE("[enter]") 
  19198. TYPE("[ctrlhome][ctrlshiftend]") 
  19199. Copy() 'copy text to clipboard 
  19200. FOR I = 1 to 10 
  19201.     Paste()   'paste text 10 times 
  19202. NEXT 
  19203. Message("The text will be shaded, bolded, italicized, underlined, and 
  19204. centered.") 
  19205. TYPE("[ctrlhome][ctrlshiftend]") 
  19206. Bold() 
  19207. Italic() 
  19208. Underline() 
  19209. Center() 
  19210. TYPE("[ctrlhome]") 
  19211. END FUNCTION 
  19212.  
  19213. See also: 
  19214.  
  19215.     Bold 
  19216.     Italic 
  19217.     NormalText 
  19218.     WordUnderline 
  19219.  
  19220.  
  19221. ΓòÉΓòÉΓòÉ 433. Undo ΓòÉΓòÉΓòÉ
  19222.  
  19223. This function undoes the previous editing function. This function is equivalent 
  19224. to choosing Edit Undo. 
  19225.  
  19226.  
  19227. Syntax 
  19228. Undo() 
  19229.  
  19230. Return Value 
  19231. 1  (TRUE) if the function was successfully undone. 
  19232. 0  (NoAction) if no action was taken. 
  19233.  
  19234. Example 
  19235. FUNCTION Example() 
  19236. Undo() 
  19237. END FUNCTION 
  19238.  
  19239. See also: 
  19240.  
  19241.     UserSetup 
  19242.  
  19243.  
  19244. ΓòÉΓòÉΓòÉ 434. UpperCase ΓòÉΓòÉΓòÉ
  19245.  
  19246. This function sets upper case for selected text or for all following text if no 
  19247. text is selected. It acts as a toggle, turning off upper case if it is 
  19248. currently on or turning on upper case if it is currently off. It is the 
  19249. equivalent to choosing Text Caps Upper Case. 
  19250.  
  19251.  
  19252. Syntax 
  19253. UpperCase() 
  19254.  
  19255. Return Value 
  19256. 1  (TRUE) if the attribute was changed. 
  19257. 0  (UserCancel) if the user canceled the function. 
  19258. -2  (GeneralFailure) if the attribute could not be changed. 
  19259. -6  (NoMemory) if the function failed because of insufficient memory. 
  19260.  
  19261. Example 
  19262. FUNCTION Example() 
  19263. UpperCase() 
  19264. END FUNCTION 
  19265.  
  19266. See also: 
  19267.  
  19268.     LowerCase 
  19269.     SmallCaps 
  19270.  
  19271.  
  19272. ΓòÉΓòÉΓòÉ 435. UserControl ΓòÉΓòÉΓòÉ
  19273.  
  19274. This function displays a modeless dialog box titled "Macro Pause" with the 
  19275. specified prompt string and Resume, Cancel, and Help push buttons. The user can 
  19276. click outside this dialog box to do any regular Ami Pro function. When the user 
  19277. is done, he can click the Resume button to resume the macro or the Cancel 
  19278. button to cancel the macro. 
  19279.  
  19280.  
  19281. Press ALT+F6 to toggle between Ami Pro and the dialog box. 
  19282.  
  19283. Syntax 
  19284. UserControl(Prompt) 
  19285. Prompt is a string passed as a prompt to the user. Ami Pro accepts a maximum of 
  19286. 80 characters. However, the number of characters that actually display depends 
  19287. on the font used for dialog boxes. 
  19288.  
  19289. Return Value 
  19290. This function does not return a value. If the user selects Cancel, control 
  19291. passes to the routine defined by the ONCANCEL statement. 
  19292.  
  19293. Example 
  19294. FUNCTION Example() 
  19295. UserControl("Click Resume to bring up System Setup...") 
  19296. ControlPanel 
  19297. UserControl("Click Resume to shut down System Setup...") 
  19298. AppClose("System Setup") 
  19299. END FUNCTION 
  19300.  
  19301. See also: 
  19302.  
  19303.     Decide 
  19304.     DialogBox 
  19305.     IgnoreKeyboard 
  19306.     KeyInterrupt 
  19307.     Message 
  19308.     Messages 
  19309.     Using the ONCANCEL Statement 
  19310.     Query$ 
  19311.     SingleStep 
  19312.  
  19313.  
  19314.  
  19315. ΓòÉΓòÉΓòÉ 436. UserSetup ΓòÉΓòÉΓòÉ
  19316.  
  19317. This function sets defaults for using Ami Pro. This function is equivalent to 
  19318. choosing Tools User Setup. 
  19319.  
  19320.  
  19321. Syntax 
  19322. UserSetup(UndoLevel, SaveTime, Options, Flag, UserName, UserInitials, Color, 
  19323. LoadMacro, ExitMacro, MacroOptions, RecentFiles) 
  19324. UndoLevel is the desired undo level (0-4). 
  19325. SaveTime is the time between saves, in minutes. If the autosave function is on. 
  19326. Options is the flag containing other default options. It is one of the 
  19327. following values: 
  19328.     NoUndo (0) - No level set is undone 
  19329.     Undo1 (2) - Single undo level 
  19330.     Undo2 (4) - Two levels undone 
  19331.     Undo3 (8) - Three levels undone 
  19332.     Undo4 (16) - Four levels undone 
  19333.     (32) - Disable one-line Help 
  19334.     (64) - Disable the Drag & Drop feature 
  19335.     BackupOn (128) - Automatic Backup turned on 
  19336.     TimedSaveOn (256) - Timed Save turned on 
  19337.     (2048) - Disable warning messages 
  19338. Flag is currently unused, and is set to 0. 
  19339. UserName is the name of the user for the document locking function. 
  19340. UserInitials is the initials of the user for note functions. 
  19341. Color is the color for notes. It is one of the following values: 
  19342.     White (16777215) 
  19343.     Cyan (16776960) 
  19344.     White (16777215) 
  19345.     Cyan (16776960) 
  19346.     Yellow (65535) 
  19347.     Magenta (16711935) 
  19348.     Green (65280) 
  19349.     Red (255) 
  19350.     Blue (16711680) 
  19351.     Black (0) 
  19352. LoadMacro is the name of the macro to run automatically when Ami Pro is loaded. 
  19353. ExitMacro is the name of the macro to run automatically when Ami Pro is exited. 
  19354. MacroOptions is the options for running the load and exit macros. It is one of 
  19355. the following values: 
  19356.     NoMacroRun (0) - Do not run the load macro or exit macro. 
  19357.     MacroLoad (2) - Set the flag to run the macro given for LoadMacro when Ami 
  19358.     Pro is loaded. 
  19359.     MacroExit (4) - Set the flag to run the macro given for ExitMacro when Ami 
  19360.     Pro is exited. 
  19361. RecentFiles is the number of recent files to list on the File menu. 
  19362.  
  19363. To display a dialog box to allow the user to select his defaults: UserSetup 
  19364.  
  19365. Return Value 
  19366. 1  (TRUE) if the setup defaults were set. 
  19367. 0  (UserCancel) if the user canceled the function. 
  19368.  
  19369. Example 
  19370. FUNCTION Example() 
  19371. UserSetup(4, 0, 0, 0, "Your Name", "YIN", 65535, "", "", 0, 0) 
  19372. END FUNCTION 
  19373.  
  19374. See also: 
  19375.  
  19376.     LoadOptions 
  19377.     SetBackPath 
  19378.     SetDefOptions 
  19379.     SetDocPath 
  19380.     SetIconPath 
  19381.     SetMacroPath 
  19382.     SetStylePath 
  19383.     UseWorkingDir 
  19384.     ViewPreferences 
  19385.  
  19386.  
  19387.  
  19388. ΓòÉΓòÉΓòÉ 437. UseWorkingDir ΓòÉΓòÉΓòÉ
  19389.  
  19390. This function determines whether to use the last directory you selected when a 
  19391. file was opened or saved. This function is equivalent to choosing Tools User 
  19392. Setup, choosing Paths, and selecting or deselecting Use working directory. 
  19393.  
  19394.  
  19395. Syntax 
  19396. UseWorkingDir(Flag) 
  19397. Flag is one of the following: 
  19398.     (1) - remembers the last directory used when opening or saving a file. 
  19399.     (0) - doesn't remember the last directory used when opening or saving a 
  19400.     file. 
  19401. The directory used to open or save the next file is based on the default 
  19402. document path defined in the Tools User Setup Paths Document text box when the 
  19403. flag is set to zero. If the SetDocPath function is used, the working directory 
  19404. path resets to the new path but the UseWorkingDir flag is still valid. 
  19405.  
  19406. Return Value 
  19407. This function returns 1. 
  19408.  
  19409. Example 
  19410. FUNCTION Example() 
  19411. UseWorkingDirectory(1) 
  19412. END FUNCTION 
  19413.  
  19414. See also: 
  19415.  
  19416.     SetDocPath 
  19417.     UserSetup 
  19418.  
  19419.  
  19420.  
  19421.  
  19422.  
  19423.  
  19424. ΓòÉΓòÉΓòÉ 438. UsingHelp ΓòÉΓòÉΓòÉ
  19425.  
  19426. This function displays the online Help for Ami Pro. This function is equivalent 
  19427. to choosing Help Using Help. This function does not select a Help topic 
  19428. automatically. Because Help displays in a separate window, further macro 
  19429. functions that cause a repaint of the Ami Pro window force Ami Pro to replace 
  19430. the Help window. 
  19431.  
  19432.  
  19433. If this function is used, it should be the last function used in the macro. 
  19434.  
  19435. Syntax 
  19436. UsingHelp() 
  19437. Return Value 
  19438. 1  (TRUE) if the Help window was displayed. 
  19439. -2  (GeneralFailure) if the Help window could not be displayed for some other 
  19440. reason. 
  19441. -6  (NoMemory) if the function failed because of insufficient memory. 
  19442.  
  19443. Example 
  19444. FUNCTION Example() 
  19445. UsingHelp() 
  19446. END FUNCTION 
  19447.  
  19448. See also: 
  19449.  
  19450.     About 
  19451.     Help 
  19452.     HowDoIHelp 
  19453.     MacroHelp 
  19454.  
  19455.  
  19456.  
  19457. ΓòÉΓòÉΓòÉ 439. ViewPreferences ΓòÉΓòÉΓòÉ
  19458.  
  19459. This function sets display preferences for using Ami Pro. This function is 
  19460. equivalent to choosing View View Preferences. 
  19461.  
  19462.  
  19463. Syntax 
  19464. ViewPreferences(Options, ViewLevel) 
  19465. Options are the display preferences to use, and can be one or more of the 
  19466. following: 
  19467.     ColumnGuides (1) - Displays column guides. 
  19468.     ColorMargin (2) - Displays margins in color. 
  19469.     ShowPictures (4) - Displays pictures in layout mode. 
  19470.     ShowTabs (8) - Displays tabs and returns. 
  19471.     ShowMarks (64) - Displays marks. 
  19472.     ShowGrid (128) - Displays gridlines in table mode. 
  19473.     ShowRowCol (256) - Displays Row/Column headings in table mode. 
  19474.     ShowVertRuler (512) - Displays vertical ruler in layout mode. 
  19475.     ShowHorzScroll (1024) - Displays the horizontal scroll bar. 
  19476.     ShowNotes (2048) - Displays note marks in layout mode. 
  19477.     ShowOutlineButtons (16384) - Displays outline buttons in outline mode. 
  19478.     To set multiple options, add the option values together before passing them 
  19479.     to the function. 
  19480. ViewLevel is the Custom View level to use for Custom View. The ViewLevel 
  19481. parameter should be set to the desired view level for the Custom View level, 
  19482. between 10% and 400%. 
  19483. To show the Display Preferences dialog box and allow the user to select his 
  19484. display preferences: ViewPreferences 
  19485.  
  19486. Return Value 
  19487. 1  (TRUE) if the display preferences were successfully set. 
  19488. 0  (UserCancel) if the user canceled the function. 
  19489. -2  (GeneralFailure) if the preferences could not be set. 
  19490.  
  19491. Example 
  19492. FUNCTION Example() 
  19493. ViewPreferences((1 + 2 + 4 + 8 + 64 + 128 + 256 + 512 + 2048 + 16384 + 4096), 
  19494. 91) 
  19495. END FUNCTION 
  19496.  
  19497. See also: 
  19498.  
  19499.     CleanScreenOptions 
  19500.     SetDefOptions 
  19501.  
  19502.  
  19503.  
  19504.  
  19505.  
  19506.  
  19507.  
  19508. ΓòÉΓòÉΓòÉ 440. WordUnderline ΓòÉΓòÉΓòÉ
  19509.  
  19510. This function sets word only underlining for selected text or for all following 
  19511. text if no text is selected. It acts as a toggle, turning off word underline if 
  19512. it is currently on and turning on word underline if it is currently off. This 
  19513. function is equivalent to choosing Text Word Underline. 
  19514.  
  19515.  
  19516. Syntax 
  19517. WordUnderline() 
  19518.  
  19519. Return Value 
  19520. (0)  if the word underline is toggled on and there are no attributes assigned 
  19521. to the text. 
  19522. (4)  if the word underline attribute is toggled on and the bold attribute is 
  19523. already assigned. 
  19524. (8)  if the word underline attribute is toggled on and the italic attribute is 
  19525. already assigned. 
  19526. (16)  if the word underline attribute is toggled on and the underline attribute 
  19527. is already assigned. 
  19528. (32)  if the word underline attribute is toggled off. 
  19529. (-2)  (GeneralFailure) if the attribute was not changed. 
  19530. The return values may be added together to identify the attributes that were 
  19531. previously assigned. 
  19532.  
  19533. Example 
  19534. FUNCTION Example() 
  19535. text = Query$("Enter some text:") 
  19536. New("_default.sty", 0, 0)      'open a new file 
  19537. TYPE("{text}") 
  19538. TYPE("[enter]") 
  19539. TYPE("[ctrlhome][ctrlshiftend]") 
  19540. Copy() 'copy text to clipboard 
  19541. FOR I = 1 to 10 
  19542.     Paste()   'paste text 10 times 
  19543. NEXT 
  19544. Message("The text will word underline only.") 
  19545. TYPE("[ctrlhome][ctrlshiftend]") 
  19546. WordUnderline() 
  19547. TYPE("[ctrlhome]") 
  19548. END FUNCTION 
  19549.  
  19550. See also: 
  19551.  
  19552.     Bold 
  19553.     Italic 
  19554.     NormalText 
  19555.     Underline 
  19556.  
  19557.  
  19558.  
  19559.  
  19560. ΓòÉΓòÉΓòÉ 441. WriteProfileString ΓòÉΓòÉΓòÉ
  19561.  
  19562. This function writes an entry into the amiuser3.ini file. 
  19563.  
  19564.  
  19565. Syntax 
  19566. WriteProfileString(App, Item, Value[, FileName) 
  19567. App is the name of the section in the .INI file. If the null string ("") is 
  19568. passed for this parameter, the [AmiPro] section is used. 
  19569. Item is the name of the entry to be added/changed. 
  19570. Value is the data to be added/changed in the .INI file. 
  19571. FileName is the filename to modify. If this parameter is not used or is passed 
  19572. the null string (""), the amiuser3.iniI file is used. If the full path is not 
  19573. used, the file is assumed to be in the Windows subdirectory. 
  19574. If the file does not exist, a new file is created and this entry is placed into 
  19575. it. 
  19576.  
  19577. Return Value 
  19578. This function does not return a value. 
  19579.  
  19580. Example 
  19581. FUNCTION Example() 
  19582. Name = GetProfileString$("AmiPro", "UserName", "amiuser3.ini") 
  19583. FillEdit(8000, Name) 
  19584. DIM Filters(10) 
  19585. FOR I = 1 to 10 
  19586. Filters(I) = strfield$(GetProfileString$("AmiPro", "application{I}", 
  19587. "amiuser3.ini"), 1, ",") 
  19588. FillList(Filters(I)) 
  19589. NEXT 
  19590. FOR I = 1 to 10 
  19591. FillEdit(9500, Filters(I)) 
  19592. NEXT 
  19593. FillEdit(50, TRUE) 
  19594. FillEdit(55, TRUE) 
  19595. Box = DialogBox(".", "ExampleBox") 
  19596. IF Box = -1 
  19597. Message("Could not open dialog box; Exiting macro.") 
  19598. EXIT FUNCTION 
  19599. ELSEIF Box = 0 
  19600. EXIT FUNCTION 
  19601. ENDIF 
  19602. Name2 = GetDialogField$(8000) 
  19603. IF Name != Name2 
  19604. IF Decide("Do you want to save your changes?") 
  19605. WriteProfileString("AmiPro", "UserName", Name2, "amiuser3.ini") 
  19606. ENDIF 
  19607. ENDIF 
  19608. END FUNCTION 
  19609.  
  19610. DIALOG ExampleBox 
  19611. -2134376448 14 104 36 198 90 "" "" "Sample Dialog Box" 
  19612. FONT 6 "Helv" 
  19613. 4 6 42 10 1000 1342308352 "static" "&User Name:" 0 
  19614. 52 4 92 12 8000 1350631552 "edit" "" 0 
  19615. 4 24 34 8 1001 1342308352 "static" "&Filters:" 0 
  19616. 4 34 66 52 9000 1352728579 "listbox" "" 0 
  19617. 74 24 52 8 1002 1342308352 "static" "&More Filters:" 0 
  19618. 74 34 70 40 9500 1344339971 "combobox" "" 0 
  19619. 74 46 60 40 24 1342308359 "button" "Group Box #1" 0 
  19620. 78 58 50 10 50 1342242825 "button" "Radio #1" 0 
  19621. 78 70 50 10 51 1342177289 "button" "Radio #2" 0 
  19622. 138 46 56 40 25 1342308359 "button" "Group Box #2" 0 
  19623. 142 56 48 12 55 1342242819 "button" "Check #1" 0 
  19624. 142 68 48 12 56 1342177283 "button" "Check #2" 0 
  19625. 154 4 40 14 1 1342373889 "button" "OK" 0 
  19626. 154 20 40 14 2 1342373888 "button" "Cancel" 0 
  19627. END DIALOG 
  19628.  
  19629. See also: 
  19630.  
  19631.     GetProfileString$ 
  19632.  
  19633.  
  19634. ΓòÉΓòÉΓòÉ 442. Ami Pro Macro Functions Grouped Alphabetically ΓòÉΓòÉΓòÉ
  19635.  
  19636. Macro Functions A 
  19637. Macro Functions B 
  19638. Macro Functions C 
  19639. Macro Functions D 
  19640. Macro Functions E 
  19641. Macro Functions F 
  19642. Macro Functions G 
  19643. Macro Functions H 
  19644. Macro Functions I 
  19645. Macro Functions J - K 
  19646. Macro Functions L 
  19647. Macro Functions M 
  19648. Macro Functions N - O 
  19649. Macro Functions P - Q 
  19650. Macro Functions R 
  19651. Macro Functions S 
  19652. Macro Functions T 
  19653. Macro Functions U - Z 
  19654.  
  19655.  
  19656. See also: 
  19657.  
  19658.     Ami Pro Macro Language Contents 
  19659.     Ami Pro Macro Functions Grouped by Category 
  19660.     Ami Pro Macro Functions Grouped by Menu 
  19661.  
  19662.  
  19663. ΓòÉΓòÉΓòÉ 443. Macro Functions A ΓòÉΓòÉΓòÉ
  19664.  
  19665. About 
  19666. ActivateApp 
  19667. AddCascadeMenu 
  19668. AddCascadeMenuItem 
  19669. AddFrame 
  19670. AddFrameDlg 
  19671. AddMenu 
  19672. AddMenuItem 
  19673. AllocGlobalVar 
  19674. AmiProIndirect 
  19675. AnswerMsgBox 
  19676. AppClose 
  19677. AppGetAppCount 
  19678. AppGetAppNames 
  19679. AppGetWindowPos 
  19680. AppHide 
  19681. AppIsRunning 
  19682. ApplyFormat 
  19683. AppMaximize 
  19684. AppMinimize 
  19685. AppMove 
  19686. AppRestore 
  19687. AppSendMessage 
  19688. AppSize 
  19689. ArrayDelete 
  19690. ArrayInsert 
  19691. ArrayInsertByKey 
  19692. ArraySearch 
  19693. ArraySize 
  19694. ArraySort 
  19695. ASC 
  19696. ASCIIOptions 
  19697. Assign 
  19698. AssignMacroToFile 
  19699. AtEOF 
  19700.  
  19701.  
  19702. See also: 
  19703.  
  19704.     Ami Pro Macro Language Contents 
  19705.     Ami Pro Macro Functions Grouped Alphabetically 
  19706.  
  19707.  
  19708. ΓòÉΓòÉΓòÉ 444. Macro Functions B ΓòÉΓòÉΓòÉ
  19709.  
  19710. Beep 
  19711. BinToBrackets 
  19712. Bold 
  19713. BracketsToBin 
  19714. BringFrameToFront 
  19715.  
  19716.  
  19717. See also: 
  19718.  
  19719.     Ami Pro Macro Language Contents 
  19720.     Ami Pro Macro Functions Grouped Alphabetically 
  19721.  
  19722.  
  19723.  
  19724. ΓòÉΓòÉΓòÉ 445. Macro Functions C ΓòÉΓòÉΓòÉ
  19725.  
  19726. CascadeWindow 
  19727. Center 
  19728. ChangeCascadeAction 
  19729. ChangeIcons 
  19730. ChangeLanguage 
  19731. ChangeMenuAction 
  19732. ChangeShortcutKey 
  19733. CharLeft 
  19734. CharRight 
  19735. CheckMenuItem 
  19736. CHR$ 
  19737. CleanScreenOptions 
  19738. ConnectCells 
  19739. Copy 
  19740. CreateDataFile 
  19741. CreateDescriptionFile 
  19742. CreateStyle 
  19743. CurChar$ 
  19744. CurShade$ 
  19745. CurWord$ 
  19746. CustomView 
  19747. Cut 
  19748.  
  19749.  
  19750. See also: 
  19751.  
  19752.     Ami Pro Macro Language Contents 
  19753.     Ami Pro Macro Functions Grouped Alphabetically 
  19754.  
  19755.  
  19756.  
  19757. ΓòÉΓòÉΓòÉ 446. Macro Functions D ΓòÉΓòÉΓòÉ
  19758.  
  19759. DateDiff 
  19760. DDEAdvise 
  19761. DDEExecute 
  19762. DDEInitiate 
  19763. DDELinks 
  19764. DDEPoke 
  19765. DDEReceive$ 
  19766. DDETerminate 
  19767. DDEUnAdvise 
  19768. Decide 
  19769. DefineStyle 
  19770. DeleteColumnRow 
  19771. DeleteEntireTable 
  19772. DeleteMenu 
  19773. DeleteMenuItem 
  19774. DialogBox 
  19775. DlgClearControl 
  19776. DlgClose 
  19777. DlgEnableControl 
  19778. DlgGetListBoxCount 
  19779. DlgGetListBoxLines 
  19780. DlgHideControl 
  19781. DlgKeyInterrupt 
  19782. DlgLimitText 
  19783. DlgSetCaption 
  19784. DLLCall 
  19785. DLLFreeLib 
  19786. DLLLoadLib 
  19787. DocInfo 
  19788. DocInfoFields 
  19789. DOSchdir 
  19790. DOSCopyFile 
  19791. DOSDelFile 
  19792. DOSGetEnv$ 
  19793. DOSGetFileAttr 
  19794. DOSmkdir 
  19795. DOSRename 
  19796. DOSrmdir 
  19797. DOSSetFileAttr 
  19798. DraftMode 
  19799.  
  19800.  
  19801. See also: 
  19802.  
  19803.     Ami Pro Macro Language Contents 
  19804.     Ami Pro Macro Functions Grouped Alphabetically 
  19805.  
  19806.  
  19807.  
  19808. ΓòÉΓòÉΓòÉ 447. Macro Functions E ΓòÉΓòÉΓòÉ
  19809.  
  19810. EditFormula 
  19811. ElevatorLeftRight 
  19812. ElevatorUpDown 
  19813. EndOfFile 
  19814. EnlargedView 
  19815. Equations 
  19816. EvalField 
  19817. Exec 
  19818.  
  19819.  
  19820. See also: 
  19821.  
  19822.     Ami Pro Macro Language Contents 
  19823.     Ami Pro Macro Functions Grouped Alphabetically 
  19824.  
  19825.  
  19826. ΓòÉΓòÉΓòÉ 448. Macro Functions F ΓòÉΓòÉΓòÉ
  19827.  
  19828. FacingView 
  19829. FastFormat 
  19830. fclose 
  19831. fgets$ 
  19832. FieldAdd 
  19833. FieldAuto 
  19834. FieldCommand 
  19835. FieldEvaluate 
  19836. FieldLock 
  19837. FieldNext/FieldPrev 
  19838. FieldRemove 
  19839. FieldToggleDisplay 
  19840. FieldUpdate 
  19841. FieldUpdateAll 
  19842. FileChanged 
  19843. FileClose 
  19844. FileManagement 
  19845. FileOpen 
  19846. FilePrint 
  19847. FillEdit 
  19848. FillList 
  19849. FindFirst$ 
  19850. FindNext$ 
  19851. FindReplace 
  19852. FontChange 
  19853. FontFaceChange 
  19854. FontPointSizeChange 
  19855. FontRevert 
  19856. Footnotes 
  19857. fopen 
  19858. FormatDate$ 
  19859. FormatNum$ 
  19860. FormatSeq$ 
  19861. FormatTime$ 
  19862. fputs 
  19863. FrameLayout 
  19864. FrameModBorders 
  19865. FrameModColumns 
  19866. FrameModFinish 
  19867. FrameModInit 
  19868. FrameModLines 
  19869. FrameModType 
  19870. fread 
  19871. FreeGlobalVar 
  19872. fseek 
  19873. ftell 
  19874. FullPageView 
  19875. fwrite 
  19876.  
  19877.  
  19878. See also: 
  19879.  
  19880.     Ami Pro Macro Language Contents 
  19881.     Ami Pro Macro Functions Grouped Alphabetically 
  19882.  
  19883.  
  19884. ΓòÉΓòÉΓòÉ 449. Macro Functions G ΓòÉΓòÉΓòÉ
  19885.  
  19886. Generate 
  19887. GetAmiDirectory$ 
  19888. GetBackPath$ 
  19889. GetBookMarkCount 
  19890. GetBookMarkNames 
  19891. GetBookMarkPage 
  19892. GetCurFontInfo 
  19893. GetCurFrameBorders 
  19894. GetCurFrameLines 
  19895. GetCurFrameType 
  19896. GetCurrentDir$ 
  19897. GetDialogField$ 
  19898. GetDlgItem 
  19899. GetDlgItemText 
  19900. GetDocInfo$ 
  19901. GetDocInfoKeywords$ 
  19902. GetDocPath$ 
  19903. GetDocVar 
  19904. GetFmtPageStr$ 
  19905. GetGlobalArray$ 
  19906. GetGlobalVar$ 
  19907. GetGlobalVarCount 
  19908. GetGlobalVarNames 
  19909. GetHomeDirectory$ 
  19910. GetIconPalette 
  19911. GetLayoutLeftLines 
  19912. GetLayoutPageSize 
  19913. GetLayoutParameters 
  19914. GetLayoutType 
  19915. GetMacPath$ 
  19916. GetMarkText$ 
  19917. GetMasterFiles 
  19918. GetMasterFilesCount 
  19919. GetMode 
  19920. GetOpenFileCount 
  19921. GetOpenFileName$ 
  19922. GetOpenFileNames 
  19923. GetPageNo 
  19924. GetPowerFieldCount 
  19925. GetPowerFieldPage 
  19926. GetPowerFields 
  19927. GetProfileString$ 
  19928. GetRunningMacroFile$ 
  19929. GetRunningMacroName$ 
  19930. GetSpecialEffects$ 
  19931. GetStyleCount 
  19932. GetStyleName$ 
  19933. GetStyleNames 
  19934. GetStylePath$ 
  19935. GetTextBeforeCursor$ 
  19936. GetTime 
  19937. GetViewLevel 
  19938. GetViewPrefLevel 
  19939. GetViewPrefOpts 
  19940. Glossary 
  19941. GlossaryAdd 
  19942. GlossaryClose 
  19943. GlossaryLookup 
  19944. GlossaryOpen 
  19945. GlossSet 
  19946. GoToAgain 
  19947. GoToCmd 
  19948. GoToPowerField 
  19949. GrayMenuItem 
  19950.  
  19951.  
  19952. See also: 
  19953.  
  19954.     Ami Pro Macro Language Contents 
  19955.     Ami Pro Macro Functions Grouped Alphabetically 
  19956.  
  19957.  
  19958. ΓòÉΓòÉΓòÉ 450. Macro Functions H ΓòÉΓòÉΓòÉ
  19959.  
  19960. HeaderFooter 
  19961. Help 
  19962. HideIconBar 
  19963. HideTabRuler 
  19964. HourGlass 
  19965. HowDoIHelp 
  19966.  
  19967.  
  19968. See also: 
  19969.  
  19970.     Ami Pro Macro Language Contents 
  19971.     Ami Pro Macro Functions Grouped Alphabetically 
  19972.  
  19973.  
  19974. ΓòÉΓòÉΓòÉ 451. Macro Functions I ΓòÉΓòÉΓòÉ
  19975.  
  19976. IconBottom 
  19977. IconCustomize 
  19978. IconFloating 
  19979. IconLeft 
  19980. IconRight 
  19981. IconTop 
  19982. IgnoreKeyboard 
  19983. ImageProcessing 
  19984. ImportExport 
  19985. ImportPicture 
  19986. Indent 
  19987. IndentAll 
  19988. IndentFirst 
  19989. IndentRest 
  19990. InsertBullet 
  19991. InsertCascadeMenu 
  19992. InsertCascadeMenuItem 
  19993. InsertColumnRow 
  19994. InsertDate 
  19995. InsertDocInfo 
  19996. InsertDocInfoField 
  19997. InsertLayout 
  19998. InsertMenu 
  19999. InsertMenuItem 
  20000. InsertMerge 
  20001. InsertMergeField 
  20002. InsertNote 
  20003. InsertVariable 
  20004. Instr 
  20005. IsFrameSelected 
  20006. IsNumeric 
  20007. Italic 
  20008.  
  20009.  
  20010. See also: 
  20011.  
  20012.     Ami Pro Macro Language Contents 
  20013.     Ami Pro Macro Functions Grouped Alphabetically 
  20014.  
  20015.  
  20016.  
  20017. ΓòÉΓòÉΓòÉ 452. Macro Functions J - K ΓòÉΓòÉΓòÉ
  20018.  
  20019. Justify 
  20020. KeyInterrupt 
  20021.  
  20022.  
  20023. See also: 
  20024.  
  20025.     Ami Pro Macro Language Contents 
  20026.     Ami Pro Macro Functions Grouped Alphabetically 
  20027.  
  20028.  
  20029.  
  20030. ΓòÉΓòÉΓòÉ 453. Macro Functions L ΓòÉΓòÉΓòÉ
  20031.  
  20032. LayoutMode 
  20033. LCASE$ 
  20034. LeaderDots 
  20035. LeaderHyphs 
  20036. LeaderLines 
  20037. LeaderNone 
  20038. Left$ 
  20039. LeftAlign 
  20040. LeftEdge 
  20041. LEN 
  20042. LineDown 
  20043. LineNumber 
  20044. LineUp 
  20045. LoadOptions 
  20046. LowerCase 
  20047.  
  20048.  
  20049. See also: 
  20050.  
  20051.     Ami Pro Macro Language Contents 
  20052.     Ami Pro Macro Functions Grouped Alphabetically 
  20053.  
  20054.  
  20055. ΓòÉΓòÉΓòÉ 454. Macro Functions M ΓòÉΓòÉΓòÉ
  20056.  
  20057. MacroEdit 
  20058. MacroHelp 
  20059. MacroOptions 
  20060. MacroPlay 
  20061. ManualFrame 
  20062. MarkBookMark 
  20063. MarkIndexWord 
  20064. MarkTOCEntry 
  20065. MasterDoc 
  20066. Maximize 
  20067. Merge 
  20068. MergeAction 
  20069. MergeMacro 
  20070. MergeToFile 
  20071. Message 
  20072. Messages 
  20073. MID$ 
  20074. Minimize 
  20075. Mod 
  20076. ModifyAlignment 
  20077. ModifyBreaks 
  20078. ModifyEffects 
  20079. ModifyFont 
  20080. ModifyLayout 
  20081. ModifyLines 
  20082. ModifyReflow 
  20083. ModifySelect 
  20084. ModifySpacing 
  20085. ModifyStyle 
  20086. ModifyTable 
  20087. ModLayoutFinish 
  20088. ModLayoutInit 
  20089. ModLayoutLeftFooter 
  20090. ModLayoutLeftHeader 
  20091. ModLayoutLeftLines 
  20092. ModLayoutLeftPage 
  20093. ModLayoutPageSize 
  20094. ModLayoutRightFooter 
  20095. ModLayoutRightHeader 
  20096. ModLayoutRightLines 
  20097. ModLayoutRightPage 
  20098. MouseInterrupt 
  20099.  
  20100.  
  20101. See also: 
  20102.  
  20103.     Ami Pro Macro Language Contents 
  20104.     Ami Pro Macro Functions Grouped Alphabetically 
  20105.  
  20106.  
  20107. ΓòÉΓòÉΓòÉ 455. Macro Functions N - O ΓòÉΓòÉΓòÉ
  20108.  
  20109. New 
  20110. NewWindow 
  20111. NextWindow 
  20112. NoHyphenation 
  20113. NormalText 
  20114. Notes 
  20115. Now 
  20116. OnKey 
  20117. OpenDataFile 
  20118. OpenMergeFile 
  20119. OpenPreviousFile 
  20120. OutlineLevels 
  20121. OutlineMode 
  20122. OutlineStyle 
  20123.  
  20124.  
  20125. See also: 
  20126.  
  20127.     Ami Pro Macro Language Contents 
  20128.     Ami Pro Macro Functions Grouped Alphabetically 
  20129.  
  20130.  
  20131.  
  20132. ΓòÉΓòÉΓòÉ 456. Macro Functions P - Q ΓòÉΓòÉΓòÉ
  20133.  
  20134. PageBreak 
  20135. PageDown 
  20136. PageNumber 
  20137. PageUp 
  20138. Paste 
  20139. Pause 
  20140. PhysicalToLogical 
  20141. PrintEnvelope 
  20142. PrintOptions 
  20143. PrintSetup 
  20144. ProtectCells 
  20145. Query$ 
  20146. QuickAddCol 
  20147. QuickAddRow 
  20148.  
  20149.  
  20150. See also: 
  20151.  
  20152.     Ami Pro Macro Language Contents 
  20153.     Ami Pro Macro Functions Grouped Alphabetically 
  20154.  
  20155.  
  20156. ΓòÉΓòÉΓòÉ 457. Macro Functions R ΓòÉΓòÉΓòÉ
  20157.  
  20158. ReadMail 
  20159. RecClose 
  20160. RecFieldCount 
  20161. RecFieldName$ 
  20162. RecGetField 
  20163. RecNextRec 
  20164. RecOpen 
  20165. RemoveLayout 
  20166. RenameDocInfoField 
  20167. RenameMenuItem 
  20168. Replace 
  20169. Restore 
  20170. Revert 
  20171. RevertLayout 
  20172. ReviewRevisions 
  20173. RevisionInsertion 
  20174. RevisionMarking 
  20175. RevisionMarkOpts 
  20176. Right$ 
  20177. RightAlign 
  20178. RightEdge 
  20179. Round 
  20180. RunLater 
  20181.  
  20182.  
  20183. See also: 
  20184.  
  20185.     Ami Pro Macro Language Contents 
  20186.     Ami Pro Macro Functions Grouped Alphabetically 
  20187.  
  20188.  
  20189. ΓòÉΓòÉΓòÉ 458. Macro Functions S ΓòÉΓòÉΓòÉ
  20190.  
  20191. Save 
  20192. SaveAs 
  20193. SaveAsNewStyle 
  20194. ScreenDown 
  20195. ScreenLeft 
  20196. ScreenRight 
  20197. ScreenUp 
  20198. SelectColumn 
  20199. SelectEntireTable 
  20200. SelectFrameByName 
  20201. SelectRow 
  20202. SelectStyle 
  20203. SelectWindow 
  20204. SendFrameToBack 
  20205. SendMail 
  20206. SetBackPath 
  20207. SetDataFile 
  20208. SetDefOptions 
  20209. SetDlgCallBack 
  20210. SetDlgItemText 
  20211. SetDocPath 
  20212. SetDocVar 
  20213. SetFormula 
  20214. SetFrameDefaults 
  20215. SetGlobalArray 
  20216. SetGlobalVar 
  20217. SetIconPath 
  20218. SetIconSize 
  20219. SetIndexFile 
  20220. SetMacroPath 
  20221. SetMasterFiles 
  20222. SetStyle 
  20223. SetStylePath 
  20224. SetTOCFile 
  20225. ShowIconBar 
  20226. ShowTabRuler 
  20227. SingleStep 
  20228. SizeColumnRow 
  20229. SmallCaps 
  20230. Spacing 
  20231. SpecialEffects 
  20232. SpellCheck 
  20233. StandardView 
  20234. StatusBarMsg 
  20235. strcat$ 
  20236. strchr 
  20237. strfield$ 
  20238. StyleManagement 
  20239.  
  20240.  
  20241. See also: 
  20242.  
  20243.     Ami Pro Macro Language Contents 
  20244.     Ami Pro Macro Functions Grouped Alphabetically 
  20245.  
  20246.  
  20247. ΓòÉΓòÉΓòÉ 459. Macro Functions T ΓòÉΓòÉΓòÉ
  20248.  
  20249. TableGetRange 
  20250. TableLayout 
  20251. TableLines 
  20252. Tables 
  20253. TabRulerInsert 
  20254. TabRulerRemove 
  20255. Thesaurus 
  20256. TileWindow 
  20257. TOCOptions 
  20258. ToggleCleanScreen 
  20259. ToggleIconBar 
  20260. ToggleTabRuler 
  20261. TopOfFile 
  20262. Truncate 
  20263. TYPE 
  20264. TypeOver 
  20265.  
  20266.  
  20267. See also: 
  20268.  
  20269.     Ami Pro Macro Language Contents 
  20270.     Ami Pro Macro Functions Grouped Alphabetically 
  20271.  
  20272.  
  20273. ΓòÉΓòÉΓòÉ 460. Macro Functions U - Z ΓòÉΓòÉΓòÉ
  20274.  
  20275. UCASE$ 
  20276. Underline 
  20277. Undo 
  20278. UpperCase 
  20279. UserControl 
  20280. UserSetup 
  20281. UseWorkingDir 
  20282. UsingHelp 
  20283. ViewPreferences 
  20284. WordUnderline 
  20285. WriteProfileString 
  20286.  
  20287.  
  20288.  
  20289.  
  20290. See also: 
  20291.  
  20292.     Ami Pro Macro Language Contents 
  20293.     Ami Pro Macro Functions Grouped Alphabetically 
  20294.  
  20295.  
  20296. ΓòÉΓòÉΓòÉ 461. Ami Pro Macro Functions Grouped by Category ΓòÉΓòÉΓòÉ
  20297.  
  20298. Ami Pro Menu Bar Macro Functions 
  20299. Array Macro Functions 
  20300. ASCII File Macro Functions 
  20301. Bookmark Macro Functions 
  20302. Date and Time Macro Functions 
  20303. Dialog Box Macro Functions 
  20304. DOS Macro Functions 
  20305. Doc Info Macro Functions 
  20306. Dynamic Data Exchange (DDE) Macro Functions 
  20307. Edit Macro Functions 
  20308. File Macro Functions 
  20309. Frame Macro Functions 
  20310. Header and Footer Macro Functions 
  20311. Help Macro Functions 
  20312. Macro Only Functions 
  20313. Master Document Macro Functions 
  20314. Merge Macro Functions 
  20315. Navigation Macro Functions 
  20316. OS/2 Macro Functions 
  20317. Page Layout Macro Functions 
  20318. Paragraph Style Macro Functions 
  20319. Path Macro Functions 
  20320. Power Field Macro Functions 
  20321. Printing Macro Functions 
  20322. Ruler Macro Functions 
  20323. SmartIcons Macro Functions 
  20324. String Macro Functions 
  20325. Table Macro Functions 
  20326. Text Formatting Macro Functions 
  20327. Tools Macro Functions 
  20328. User Setup Macro Functions 
  20329. Variable Macro Functions 
  20330. View Macro Functions 
  20331. Window Macro Functions 
  20332.  
  20333. See also: 
  20334.  
  20335.     Ami Pro Macro Language Contents 
  20336.     Ami Pro Macro Functions Grouped Alphabetically 
  20337.     Ami Pro Macro Functions Grouped By Menu 
  20338.  
  20339.  
  20340. ΓòÉΓòÉΓòÉ 462. Ami Pro Menus Bar Macro Functions ΓòÉΓòÉΓòÉ
  20341.  
  20342. These functions create and change the Ami Pro menu bars and add, remove, or 
  20343. change pulldown menus displayed from these menu bars. 
  20344.  
  20345. AddCascadeMenu 
  20346. AddCascadeMenuItem 
  20347. AddMenu 
  20348. AddMenuItem 
  20349. ChangeCascadeAction 
  20350. ChangeMenuAction 
  20351. CheckMenuItem 
  20352. DeleteMenu 
  20353. DeleteMenuItem 
  20354. GrayMenuItem 
  20355. InsertCascadeMenu 
  20356. InsertCascadeMenuItem 
  20357. InsertMenu 
  20358. InsertMenuItem 
  20359. RenameMenuItem 
  20360. StatusBarMsg 
  20361.  
  20362. See also: 
  20363.  
  20364.     Ami Pro Macro Language Contents 
  20365.     Ami Pro Macro Functions Grouped by Category 
  20366.  
  20367.  
  20368. ΓòÉΓòÉΓòÉ 463. Array Macro Functions ΓòÉΓòÉΓòÉ
  20369.  
  20370. These functions allow you to position insert, delete, and sort arrays. 
  20371.  
  20372. AllocGlobalVar 
  20373. AmiProIndirect 
  20374. AppGetAppCount 
  20375. AppGetAppNames 
  20376. ArrayDelete 
  20377. ArrayInsert 
  20378. ArrayInsertByKey 
  20379. ArraySearch 
  20380. ArraySize 
  20381. ArraySort 
  20382. GetBookMarkCount 
  20383. GetBookMarkNames 
  20384. GetGlobalArray$ 
  20385. GetMasterFiles 
  20386. GetMasterFilesCount 
  20387. GetOpenFileCount 
  20388. GetOpenFileNames 
  20389. GetPowerFields 
  20390. GetStyleNames 
  20391. SetGlobalArray 
  20392.  
  20393. See also: 
  20394.  
  20395.     Ami Pro Macro Language Contents 
  20396.     Ami Pro Macro Functions Grouped by Category 
  20397.     Overview of the Ami Pro Macro Language 
  20398.  
  20399.  
  20400. ΓòÉΓòÉΓòÉ 464. ASCII File Macro Functions ΓòÉΓòÉΓòÉ
  20401.  
  20402. These functions allow a macro to read and write ASCII text files. Reading and 
  20403. writing binary files is not supported. File operations on binary files may 
  20404. behave unpredictably. 
  20405.  
  20406. These are low-level functions that require you to open and close files properly 
  20407. when you use them. OS/2 may have difficulty if a macro does not close its 
  20408. files. 
  20409.  
  20410. BinToBrackets 
  20411. BracketsToBin 
  20412. fclose 
  20413. fgets$ 
  20414. fopen 
  20415. fputs 
  20416. fread 
  20417. fseek 
  20418. ftell 
  20419. fwrite 
  20420.  
  20421. See also: 
  20422.  
  20423.     Ami Pro Macro Language Contents 
  20424.     Ami Pro Macro Functions Grouped by Category 
  20425.  
  20426.  
  20427. ΓòÉΓòÉΓòÉ 465. Bookmark Macro Functions ΓòÉΓòÉΓòÉ
  20428.  
  20429. GetBookMarkCount 
  20430. GetBookMarkNames 
  20431. GetBookMarkPage 
  20432. GetFmtPageStr$ 
  20433. MarkBookMark 
  20434. SelectFrameByName 
  20435.  
  20436. See also: 
  20437.  
  20438.     Ami Pro Macro Language Contents 
  20439.     Ami Pro Macro Functions Grouped by Category 
  20440.  
  20441.  
  20442.  
  20443. ΓòÉΓòÉΓòÉ 466. Date and Time Macro Functions ΓòÉΓòÉΓòÉ
  20444.  
  20445. DateDiff 
  20446. FormatDate$ 
  20447. FormatTime$ 
  20448. GetTime 
  20449. InsertDate 
  20450. InsertVariable 
  20451. New 
  20452.  
  20453. See also: 
  20454.  
  20455.     Ami Pro Macro Language Contents 
  20456.     Ami Pro Macro Functions Grouped by Category 
  20457.  
  20458.  
  20459.  
  20460.  
  20461.  
  20462. ΓòÉΓòÉΓòÉ 467. Dialog Box Macro Functions ΓòÉΓòÉΓòÉ
  20463.  
  20464. You can store dialog boxes within a macro. You can define a function or 
  20465. functions to run while the box is displayed. These functions can change the 
  20466. components of the box while the box is displayed. Bitmaps can be included as 
  20467. part of a dialog box. These bitmaps can be static or defined as a button. You 
  20468. can reproduce the functions of the OS/2 interface using the Ami Pro dialog box. 
  20469.  
  20470. AnswerMsgBox 
  20471. Decide 
  20472. DialogBox 
  20473. DlgClearControl 
  20474. DlgClose 
  20475. DlgEnableControl 
  20476. DlgGetListBoxCount 
  20477. DlgGetListBoxLines 
  20478. DlgHideControl 
  20479. DlgKeyInterrupt 
  20480. DlgLimitText 
  20481. DlgSetCaption 
  20482. FillEdit 
  20483. FillList 
  20484. GetDialogField$ 
  20485. GetDlgItem 
  20486. GetDlgItemText 
  20487. Message 
  20488. Messages$ 
  20489. Query$ 
  20490. SetDlgCallBack 
  20491. SetDlgItemText 
  20492. UserControl 
  20493.  
  20494. See also: 
  20495.  
  20496.     Ami Pro Macro Language Contents 
  20497.     Ami Pro Macro Functions Grouped by Category 
  20498.     Using the Lotus Dialog Editor 
  20499.  
  20500.  
  20501. ΓòÉΓòÉΓòÉ 468. DOS Macro Functions ΓòÉΓòÉΓòÉ
  20502.  
  20503. These functions allow you to perform the most common DOS commands. 
  20504.  
  20505. Beep 
  20506. DOSchdir 
  20507. DOSCopyFile 
  20508. DOSDelFile 
  20509. DOSGetEnv$ 
  20510. DOSGetFileAttr 
  20511. DOSmkdir 
  20512. DOSRename 
  20513. DOSrmdir 
  20514. DOSSetFileAttr 
  20515.  
  20516. See also: 
  20517.  
  20518.     Ami Pro Macro Language Contents 
  20519.     Ami Pro Macro Functions Grouped by Category 
  20520.  
  20521.  
  20522. ΓòÉΓòÉΓòÉ 469. Doc Info Macro Functions ΓòÉΓòÉΓòÉ
  20523.  
  20524. DocInfo 
  20525. DocInfoFields 
  20526. GetDocInfo$ 
  20527. GetDocInfoKeywords$ 
  20528. GetDocVar 
  20529. InsertDocInfo 
  20530. InsertDocInfoField 
  20531. RenameDocInfoField 
  20532. SetDocVar 
  20533.  
  20534. See also: 
  20535.  
  20536.     Ami Pro Macro Language Contents 
  20537.     Ami Pro Macro Functions Grouped by Category 
  20538.  
  20539.  
  20540.  
  20541.  
  20542.  
  20543. ΓòÉΓòÉΓòÉ 470. Dynamic Data Exchange (DDE) Macro Functions ΓòÉΓòÉΓòÉ
  20544.  
  20545. DDEAdvise 
  20546. DDEExecute 
  20547. DDEInitiate 
  20548. DDELinks 
  20549. DDEPoke 
  20550. DDEReceive$ 
  20551. DDETerminate 
  20552. DDEUnadvise 
  20553.  
  20554. See also: 
  20555.  
  20556.     Ami Pro Macro Language Contents 
  20557.     Ami Pro Macro Functions Grouped by Category 
  20558.  
  20559.  
  20560.  
  20561.  
  20562. ΓòÉΓòÉΓòÉ 471. Edit Macro Functions ΓòÉΓòÉΓòÉ
  20563.  
  20564. Copy 
  20565. Cut 
  20566. FindReplace 
  20567. Glossary 
  20568. GlossaryAdd 
  20569. GlossaryClose 
  20570. GlossaryLookup 
  20571. GlossaryOpen 
  20572. GlossSet 
  20573. GoToAgain 
  20574. GoToCmd 
  20575. InsertBullet 
  20576. InsertNote 
  20577. NoHyphenation 
  20578. Notes 
  20579. Paste 
  20580. Replace 
  20581. Revert 
  20582. Type 
  20583. TypeOver 
  20584. Undo 
  20585.  
  20586. See also: 
  20587.  
  20588.     Ami Pro Macro Language Contents 
  20589.     Ami Pro Macro Functions Grouped by Category 
  20590.  
  20591.  
  20592.  
  20593.  
  20594.  
  20595.  
  20596. ΓòÉΓòÉΓòÉ 472. File Macro Functions ΓòÉΓòÉΓòÉ
  20597.  
  20598. ASCIIOptions 
  20599. AssignMacroToFile 
  20600. DOSCopyFile 
  20601. DOSDelFile 
  20602. DOSGetFileAttr 
  20603. DOSRename 
  20604. DOSSetFileAttr 
  20605. FileChanged 
  20606. FileClose 
  20607. FileManagement 
  20608. FileOpen 
  20609. FindFirst$ 
  20610. FindNext$ 
  20611. ImportExport 
  20612. New 
  20613. OpenPreviousFile 
  20614. ReadMail 
  20615. Revert 
  20616. Save 
  20617. SaveAs 
  20618. SendMail 
  20619.  
  20620. See also: 
  20621.  
  20622.     Ami Pro Macro Language Contents 
  20623.     Ami Pro Macro Functions Grouped by Category 
  20624.  
  20625.  
  20626.  
  20627.  
  20628.  
  20629. ΓòÉΓòÉΓòÉ 473. Frame Macro Functions ΓòÉΓòÉΓòÉ
  20630.  
  20631. These functions give you control over the frame position, frame type, lines 
  20632. around, background color, and drop shadow color. With the frame control 
  20633. functions, you can change the frame's position, appearance, and type. 
  20634.  
  20635. AddFrame 
  20636. AddFrameDlg 
  20637. BringFrameToFront 
  20638. FrameLayout 
  20639. FrameModBorders 
  20640. FrameModColumns 
  20641. FrameModFinish 
  20642. FrameModInit 
  20643. FrameModLines 
  20644. FrameModType 
  20645. GetCurFrameBorders 
  20646. GetCurFrameLines 
  20647. GetCurFrameType 
  20648. ImportPicture 
  20649. IsFrameSelected 
  20650. ManualFrame 
  20651. SelectFrameByName 
  20652. SendFrameToBack 
  20653. SetFrameDefaults 
  20654.  
  20655. See also: 
  20656.  
  20657.     Ami Pro Macro Language Contents 
  20658.     Ami Pro Macro Functions Grouped by Category 
  20659.  
  20660.  
  20661.  
  20662.  
  20663. ΓòÉΓòÉΓòÉ 474. Header and Footer Macro Functions ΓòÉΓòÉΓòÉ
  20664.  
  20665. HeaderFooter 
  20666. ModLayoutLeftFooter 
  20667. ModLayoutLeftHeader 
  20668. ModLayoutRightFooter 
  20669. ModLayoutRightHeader 
  20670.  
  20671. See also: 
  20672.  
  20673.     Ami Pro Macro Language Contents 
  20674.     Ami Pro Macro Functions Grouped by Category 
  20675.  
  20676.  
  20677.  
  20678.  
  20679.  
  20680. ΓòÉΓòÉΓòÉ 475. Help Macro Functions ΓòÉΓòÉΓòÉ
  20681.  
  20682. About 
  20683. Help 
  20684. HowDoIHelp 
  20685. MacroHelp 
  20686. UsingHelp 
  20687.  
  20688. See also: 
  20689.  
  20690.     Ami Pro Macro Language Contents 
  20691.     Ami Pro Macro Functions Grouped by Category 
  20692.  
  20693.  
  20694.  
  20695.  
  20696.  
  20697. ΓòÉΓòÉΓòÉ 476. Macro Only Functions ΓòÉΓòÉΓòÉ
  20698.  
  20699. AssignMacroToFile 
  20700. ChangeShortcutKey 
  20701. GetRunningMacroFile$ 
  20702. GetRunningMacroName 
  20703. HourGlass 
  20704. IgnoreKeyboard 
  20705. KeyInterrupt 
  20706. MacroEdit 
  20707. MacroHelp 
  20708. MacroOptions 
  20709. MacroPlay 
  20710. MouseInterrupt 
  20711. OnKey 
  20712. Pause 
  20713. RunLater 
  20714. SingleStep 
  20715.  
  20716. See also: 
  20717.  
  20718.     Ami Pro Macro Language Contents 
  20719.     Ami Pro Macro Functions Grouped by Category 
  20720.     Overview of the Ami Pro Macro Language 
  20721.  
  20722.  
  20723.  
  20724.  
  20725.  
  20726. ΓòÉΓòÉΓòÉ 477. Master Document Macro Funtions ΓòÉΓòÉΓòÉ
  20727.  
  20728. Generate 
  20729. GetMasterFiles 
  20730. GetMasterFilesCount 
  20731. MarkIndexWord 
  20732. MarkTOCEntry 
  20733. MasterDoc 
  20734. PhysicalToLogical 
  20735. SetIndexFile 
  20736. SetMasterFiles 
  20737. SetTOCFile 
  20738. TOCOptions 
  20739.  
  20740. See also: 
  20741.  
  20742.     Ami Pro Macro Language Contents 
  20743.     Ami Pro Macro Functions Grouped by Category 
  20744.  
  20745.  
  20746.  
  20747.  
  20748.  
  20749. ΓòÉΓòÉΓòÉ 478. Merge Macro Functions ΓòÉΓòÉΓòÉ
  20750.  
  20751. CreateDataFile 
  20752. CreateDescriptionFile 
  20753. InsertMerge 
  20754. InsertMergeField 
  20755. Merge 
  20756. MergeAction 
  20757. MergeMacro 
  20758. MergeToFile 
  20759. OpenDataFile 
  20760. OpenMergeFile 
  20761. RecClose 
  20762. RecFieldCount 
  20763. RecFieldName 
  20764. RecGetField 
  20765. RecNextRec 
  20766. RecOpen 
  20767. SetDataFile 
  20768.  
  20769. See also: 
  20770.  
  20771.     Ami Pro Macro Language Contents 
  20772.     Ami Pro Macro Functions Grouped by Category 
  20773.  
  20774.  
  20775.  
  20776.  
  20777. ΓòÉΓòÉΓòÉ 479. Navigation Macro Functions ΓòÉΓòÉΓòÉ
  20778.  
  20779. AtEOF 
  20780. CharLeft 
  20781. CharRight 
  20782. ElevatorLeftRight 
  20783. ElevatorUpDown 
  20784. EndOfFile 
  20785. GoToAgain 
  20786. GoToCmd 
  20787. GoToPowerField 
  20788. LeftEdge 
  20789. LineDown 
  20790. LineUp 
  20791. PageDown 
  20792. PageUp 
  20793. RightEdge 
  20794. ScreenDown 
  20795. ScreenLeft 
  20796. ScreenRight 
  20797. ScreenUp 
  20798. TopOfFile 
  20799. Type 
  20800.  
  20801. See also: 
  20802.  
  20803.     Ami Pro Macro Language Contents 
  20804.     Ami Pro Macro Functions Grouped by Category 
  20805.  
  20806.  
  20807.  
  20808.  
  20809.  
  20810. ΓòÉΓòÉΓòÉ 480. OS/2 Macro Functions ΓòÉΓòÉΓòÉ
  20811.  
  20812. These functions allow Ami Pro to use OS/2 Dynamic Data Exchange (DDE) to 
  20813. interact with other OS/2 programs and access Dynamic Link Libraries (DLL) and 
  20814. the routines built into these DLL libraries. A function is also included to 
  20815. execute another application. 
  20816.  
  20817. ActivateApp 
  20818. AppClose 
  20819. AppGetAppCount 
  20820. AppGetAppNames 
  20821. AppGetWindowPos 
  20822. AppHide 
  20823. AppIsRunning 
  20824. AppMaximize 
  20825. AppMinimize 
  20826. AppMove 
  20827. AppRestore 
  20828. AppSendMessage 
  20829. AppSize 
  20830. DDEAdvise 
  20831. DDEExecute 
  20832. DDEInitiate 
  20833. DDELinks 
  20834. DDEPoke 
  20835. DDEReceive$ 
  20836. DDETerminate 
  20837. DDEUnAdvise 
  20838. DLLCall 
  20839. DLLFreeLib 
  20840. DLLLoadLib 
  20841. Exec 
  20842. GetDlgItem 
  20843. GetProfileString$ 
  20844. WriteProfileString 
  20845.  
  20846. See also: 
  20847.  
  20848.     Ami Pro Macro Language Contents 
  20849.     Ami Pro Macro Functions Grouped by Category 
  20850.  
  20851.  
  20852.  
  20853. ΓòÉΓòÉΓòÉ 481. Page Layout  Macro Functions ΓòÉΓòÉΓòÉ
  20854.  
  20855. These functions give you control over creating or modifying the page layout. 
  20856.  
  20857. GetLayoutLeftLines 
  20858. GetLayoutPageSize 
  20859. GetLayoutParameters 
  20860. GetLayoutType 
  20861. InsertLayout 
  20862. ModifyLayout 
  20863. ModLayoutFinish 
  20864. ModLayoutInit 
  20865. ModLayoutLeftFooter 
  20866. ModLayoutLeftHeader 
  20867. ModLayoutLeftLines 
  20868. ModLayoutLeftPage 
  20869. ModLayoutPageSize 
  20870. ModLayoutRightFooter 
  20871. ModLayoutRightHeader 
  20872. ModLayoutRightLines 
  20873. ModLayoutRightPage 
  20874. PageBreak 
  20875. PageNumber 
  20876. RemoveLayout 
  20877. RevertLayout 
  20878. GetPageNo 
  20879. LineNumber 
  20880.  
  20881. See also: 
  20882.  
  20883.     Ami Pro Macro Language Contents 
  20884.     Ami Pro Macro Functions Grouped by Category 
  20885.  
  20886.  
  20887. ΓòÉΓòÉΓòÉ 482. Paragraph Style Macro Functions ΓòÉΓòÉΓòÉ
  20888.  
  20889. These functions give you control over paragraph styles. 
  20890.  
  20891. CreateStyle 
  20892. DefineStyle 
  20893. FormatSeq$ 
  20894. GetSpecialEffects$ 
  20895. GetStyleCount 
  20896. GetStyleName$ 
  20897. GetStyleNames 
  20898. ModifyAlignment 
  20899. ModifyBreaks 
  20900. ModifyEffects 
  20901. ModifyFont 
  20902. ModifyLines 
  20903. ModifyReflow 
  20904. ModifySelect 
  20905. ModifySpacing 
  20906. ModifyStyle 
  20907. ModifyTable 
  20908. OutlineLevels 
  20909. OutlineStyle 
  20910. SaveAsNewStyle 
  20911. SelectStyle 
  20912. SetStyle 
  20913. StyleManagement 
  20914.  
  20915. See also: 
  20916.  
  20917.     Ami Pro Macro Language Contents 
  20918.     Ami Pro Macro Functions Grouped by Category 
  20919.  
  20920.  
  20921.  
  20922.  
  20923.  
  20924. ΓòÉΓòÉΓòÉ 483. Path Macro Functions ΓòÉΓòÉΓòÉ
  20925.  
  20926. GetAmiDirectory$ 
  20927. GetBackPath$ 
  20928. GetCurrentDir$ 
  20929. GetDocPath$ 
  20930. GetHomeDirectory$ 
  20931. GetMacPath$ 
  20932. GetOpenFileName$ 
  20933. GetOpenFileNames$ 
  20934. GetStylePath$ 
  20935. SetBackPath$ 
  20936. SetDocPath$ 
  20937. SetIconPath$ 
  20938. SetMacroPath$ 
  20939. SetStylePath$ 
  20940. UseWorkingDir$ 
  20941.  
  20942. See also: 
  20943.  
  20944.     Ami Pro Macro Language Contents 
  20945.     Ami Pro Macro Functions Grouped by Category 
  20946.  
  20947.  
  20948. ΓòÉΓòÉΓòÉ 484. Power Field Macro Functions ΓòÉΓòÉΓòÉ
  20949.  
  20950. EvalField 
  20951. FieldAdd 
  20952. FieldAuto 
  20953. FieldCommand 
  20954. FieldEvaluate 
  20955. FieldLock 
  20956. FieldNext/FieldPrev 
  20957. FieldRemove 
  20958. FieldToggleDisplay 
  20959. FieldUpdate 
  20960. FieldUpdateAll 
  20961. GetPowerFieldCount 
  20962. GetPowerFieldPage 
  20963. GetPowerFields 
  20964. GoToPowerField 
  20965.  
  20966. See also: 
  20967.  
  20968.     Ami Pro Macro Language Contents 
  20969.     Ami Pro Macro Functions Grouped by Category 
  20970.  
  20971.  
  20972.  
  20973. ΓòÉΓòÉΓòÉ 485. Printing Macro Functions ΓòÉΓòÉΓòÉ
  20974.  
  20975. FilePrint 
  20976. Merge 
  20977. MergeAction 
  20978. MergeMacro 
  20979. PrintEnvelope 
  20980. PrintOptions 
  20981. PrintSetup 
  20982.  
  20983. See also: 
  20984.  
  20985.     Ami Pro Macro Language Contents 
  20986.     Ami Pro Macro Functions Grouped by Category 
  20987.  
  20988.  
  20989.  
  20990. ΓòÉΓòÉΓòÉ 486. Ruler Macro Functions ΓòÉΓòÉΓòÉ
  20991.  
  20992. HideTabRuler 
  20993. ShowTabRuler 
  20994. TabRulerInsert 
  20995. TabRulerRemove 
  20996. ToggleTabRuler 
  20997.  
  20998. See also: 
  20999.  
  21000.     Ami Pro Macro Language Contents 
  21001.     Ami Pro Macro Functions Grouped by Category 
  21002.  
  21003.  
  21004. ΓòÉΓòÉΓòÉ 487. SmartIcons Macro Functions ΓòÉΓòÉΓòÉ
  21005.  
  21006. ChangeIcons 
  21007. GetIconPalette 
  21008. HideIconBar 
  21009. IconBottom 
  21010. IconCustomize 
  21011. IconFloating 
  21012. IconLeft 
  21013. IconRight 
  21014. IconTop 
  21015. SetIconSize 
  21016. ShowIconBar 
  21017. ToggleIconBar 
  21018.  
  21019. See also: 
  21020.  
  21021.     Ami Pro Macro Language Contents 
  21022.     Ami Pro Macro Functions Grouped by Category 
  21023.  
  21024.  
  21025.  
  21026. ΓòÉΓòÉΓòÉ 488. String Macro Functions ΓòÉΓòÉΓòÉ
  21027.  
  21028. These functions manipulate strings of text. Many of these functions are similar 
  21029. to, and have the same syntax as, BASIC language string functions. 
  21030.  
  21031. ASC 
  21032. BinToBrackets 
  21033. BracketsToBin 
  21034. CHR$ 
  21035. CurChar$ 
  21036. CurShade$ 
  21037. CurWord$ 
  21038. DateDiff 
  21039. DOSGetEnv$ 
  21040. fgets$ 
  21041. FormatDate$ 
  21042. FormatNum$ 
  21043. FormatSeq$ 
  21044. FormatTime$ 
  21045. GetAmiDirectory$ 
  21046. GetBackPath$ 
  21047. GetCurrentDir$ 
  21048. GetDialogField$ 
  21049. GetDocInfo$ 
  21050. GetDocInfoKeywords$ 
  21051. GetDocPath$ 
  21052. GetFmtPageStr$ 
  21053. GetGlobalArray$ 
  21054. GetGlobalVar$ 
  21055. GetMacPath$ 
  21056. GetMarkText$ 
  21057. GetOpenFileName$ 
  21058. GetProfileString$ 
  21059. GetRunningMacroFile$ 
  21060. GetRunningMacroName$ 
  21061. GetSpecialEffects$ 
  21062. GetStylePath$ 
  21063. GetTextBeforeCursor$ 
  21064. Instr 
  21065. IsNumeric 
  21066. LCASE$ 
  21067. Left$ 
  21068. LEN 
  21069. MID$ 
  21070. Mod 
  21071. Right$ 
  21072. Round 
  21073. strcat$ 
  21074. strchr 
  21075. strfield$ 
  21076. Truncate 
  21077. TYPE 
  21078. UCASE$ 
  21079. WriteProfileString 
  21080.  
  21081. See also: 
  21082.  
  21083.     Ami Pro Macro Language Contents 
  21084.     Ami Pro Macro Functions Grouped by Category 
  21085.     Overview of the Ami Pro Macro Language 
  21086.  
  21087.  
  21088. ΓòÉΓòÉΓòÉ 489. Table Macro Functions ΓòÉΓòÉΓòÉ
  21089.  
  21090. ConnectCells 
  21091. DeleteColumnRow 
  21092. DeleteEntireTable 
  21093. EditFormula 
  21094. InsertColumnRow 
  21095. LeaderDots 
  21096. LeaderHyphs 
  21097. LeaderLines 
  21098. LeaderNone 
  21099. ProtectCells 
  21100. QuickAddCol 
  21101. QuickAddRow 
  21102. SelectColumn 
  21103. SelectEntireTable 
  21104. SelectRow 
  21105. SetFormula 
  21106. SizeColumnRow 
  21107. TableGetRange 
  21108. TableLayout 
  21109. TableLines 
  21110. Tables 
  21111. See also: 
  21112.     Ami Pro Macro Language Contents 
  21113.     Ami Pro Macro Functions Grouped by Category 
  21114.  
  21115.  
  21116.  
  21117. ΓòÉΓòÉΓòÉ 490. Text Formatting Macro Functions ΓòÉΓòÉΓòÉ
  21118.  
  21119. ApplyFormat 
  21120. Bold 
  21121. Center 
  21122. FastFormat 
  21123. FontChange 
  21124. FontFaceChange 
  21125. FontPointSizeChange 
  21126. FontRevert 
  21127. GetCurFontInfo 
  21128. Indent 
  21129. IndentAll 
  21130. IndentFirst 
  21131. IndentRest 
  21132. Italic 
  21133. Justify 
  21134. LeftAlign 
  21135. LowerCase 
  21136. NoHyphenation 
  21137. NormalText 
  21138. RightAlign 
  21139. SmallCaps 
  21140. Spacing 
  21141. SpecialEffects 
  21142. Underline 
  21143. UpperCase 
  21144. WordUnderline 
  21145. See also: 
  21146.     Ami Pro Macro Language Contents 
  21147.     Ami Pro Macro Functions Grouped by Category 
  21148.  
  21149.  
  21150.  
  21151. ΓòÉΓòÉΓòÉ 491. Tools Macro Functions ΓòÉΓòÉΓòÉ
  21152.  
  21153. ChangeLanguage 
  21154. Equations 
  21155. Footnotes 
  21156. ImageProcessing 
  21157. ReviewRevisions 
  21158. RevisionInsertion 
  21159. RevisionMarking 
  21160. RevisionMarkOpts 
  21161. SpellCheck 
  21162. Thesaurus 
  21163. See also: 
  21164.     Ami Pro Macro Language Contents 
  21165.     Ami Pro Macro Functions Grouped by Category 
  21166.  
  21167.  
  21168.  
  21169. ΓòÉΓòÉΓòÉ 492. User Setup Macro Functions ΓòÉΓòÉΓòÉ
  21170.  
  21171. LoadOptions 
  21172. SetBackPath 
  21173. SetDefOptions 
  21174. SetDocPath 
  21175. SetIconPath 
  21176. SetMacroPath 
  21177. SetStylePath 
  21178. UserSetup 
  21179. UseWorkingDir 
  21180. See also: 
  21181.     Ami Pro Macro Language Contents 
  21182.     Ami Pro Macro Functions Grouped by Category 
  21183.  
  21184.  
  21185.  
  21186. ΓòÉΓòÉΓòÉ 493. Variable Macro Functions ΓòÉΓòÉΓòÉ
  21187.  
  21188. Most variables are local and private to the macro in which they are declared. 
  21189. They are deleted when the macro completes. Ami Pro provides variables that are 
  21190. saved when a macro completes. 
  21191.  
  21192. AllocGlobalVar 
  21193. Assign 
  21194. DOSGetEnv$ 
  21195. FreeGlobalVar 
  21196. GetDocVar 
  21197. GetGlobalVar$ 
  21198. GetGlobalVarCount 
  21199. GetGlobalVarNames 
  21200. SetDocVar 
  21201. SetGlobalVar 
  21202.  
  21203. See also: 
  21204.  
  21205.     Ami Pro Macro Language Contents 
  21206.     Ami Pro Macro Functions Grouped by Category 
  21207.     Overview of the Ami Pro Macro Language 
  21208.     Using Variables 
  21209.  
  21210.  
  21211. ΓòÉΓòÉΓòÉ 494. View Macro Functions ΓòÉΓòÉΓòÉ
  21212.  
  21213. CleanScreenOptions 
  21214. CustomView 
  21215. DraftMode 
  21216. EnlargedView 
  21217. FacingView 
  21218. GetMode 
  21219. GetViewLevel 
  21220. GetViewPrefLevel 
  21221. GetViewPrefOpts 
  21222. LayoutMode 
  21223. OutlineMode 
  21224. StandardView 
  21225. ToggleCleanScreen 
  21226. ViewPreferences 
  21227.  
  21228. See also: 
  21229.     Ami Pro Macro Language Contents 
  21230.     Ami Pro Macro Functions Grouped by Category 
  21231.     Using Variables 
  21232.  
  21233.  
  21234. ΓòÉΓòÉΓòÉ 495. Window_Macro_Functions ΓòÉΓòÉΓòÉ
  21235.  
  21236. CascadeWindow 
  21237. FieldToggleDisplay 
  21238. FullPageView 
  21239. GetOpenFileCount 
  21240. Maximize 
  21241. Minimize 
  21242. NewWindow 
  21243. NextWindow 
  21244. Restore 
  21245. SelectWindow 
  21246. TileWindow 
  21247.  
  21248. See also: 
  21249.  
  21250.     Ami Pro Macro Language Contents 
  21251.     Ami Pro Macro Functions Grouped by Category 
  21252.     Using Variables 
  21253.  
  21254.  
  21255. ΓòÉΓòÉΓòÉ 496. Debugging Macros ΓòÉΓòÉΓòÉ
  21256.  
  21257. This section of the documentation describes error messages that can appear when 
  21258. compiling or running macros. It also discusses some of the techniques you can 
  21259. use to determine the cause of the errors, and how you can test your macros to 
  21260. make sure they do what you want them to. 
  21261.  
  21262.  
  21263. Error Messages When Macros Are Compiled 
  21264. When an error occurs during macro compilation, the insertion point stops at the 
  21265. location of the error, and a message displays. Error messages that only contain 
  21266. an error number are out of memory error messages. The macro is not saved. You 
  21267. can determine the cause of the error, make the change, and recompile the macro. 
  21268. Compilation stops at the first error found, so you may need to compile the 
  21269. macro several times in order to find all the errors. 
  21270.  
  21271. Error Messages While Macros Are Running 
  21272. Runtime error handling is dependent on whether the SingleStep function has been 
  21273. used in the compiled macro. If a SingleStep function has been used, a runtime 
  21274. error displays a message box with the error message as the title of the message 
  21275. box and the offending line inside the dialog box. When the user acknowledges 
  21276. the error, the macro is canceled. 
  21277.  
  21278. If no SingleStep statement has been used, the error message displays on the 
  21279. screen without the line information. When the user acknowledges the error, the 
  21280. macro is canceled. 
  21281.  
  21282. A run-time error, whether a macro error, or an Ami Pro or OS/2 error, stops 
  21283. macro execution unless an ONERROR statement has been included in the macro. If 
  21284. an ONERROR statement has been included, control transfers to the location 
  21285. specified by that statement. 
  21286.  
  21287. Determining the Cause of Runtime Errors 
  21288. Runtime errors can be difficult to trace and debug. If other people will be 
  21289. using your macros, you should test them and make sure they work correctly 
  21290. before distributing them. Ami Pro provides several macro functions you can use 
  21291. to determine the cause of run-time errors and trace the progress of your macro. 
  21292. These functions are: 
  21293.     IgnoreKeyboard 
  21294.     SingleStep 
  21295.     Message 
  21296.     Messages 
  21297. In addition, you can use Debug to identify run-time errors and to display 
  21298. variables and modify their values. To debug a macro file, open the macro file, 
  21299. choose Tools Macros, and chooseDebug. You can play the entire macro or you can 
  21300. check each step in the macro. 
  21301.  
  21302. See also: 
  21303.  
  21304.     Ami Pro Macro Language Contents 
  21305.     Macro Error Messages 
  21306.     SingleStep 
  21307.     Using Debug 
  21308.     Using the Message Function 
  21309.     Using the Messages Function 
  21310.     Using the ONERROR Statement 
  21311.     Using the SingleStep and IgnoreKeyboard Functions 
  21312.  
  21313.  
  21314.  
  21315.  
  21316. ΓòÉΓòÉΓòÉ 497. Using Debug ΓòÉΓòÉΓòÉ
  21317.  
  21318. You can use Debug to identify run-time errors in a macro. These errors occur 
  21319. when you play the macro, even though the macro saved properly. 
  21320.  
  21321.  
  21322. You can also display variables and modify their values. 
  21323.  
  21324. To debug a macro file 
  21325.  1.  Choose Tools Macros. 
  21326.  2.  Choose Edit. 
  21327.  3.  Select the macro file you want to debug and choose OK. 
  21328.     Ami Pro displays the macro file. 
  21329.  4.  Choose Tools Macros. 
  21330.  5.  Choose Debug. 
  21331.     The Debug dialog box displays and remains on the screen so you can continue 
  21332.     to check the macro. 
  21333.  
  21334. To play the macro 
  21335. Choose Run/Continue. 
  21336. If a run-time error is encountered, Ami Pro displays an error message and 
  21337. pauses the macro. 
  21338. Choose the desired command button to resume checking the macro. 
  21339.  
  21340. To check each step in the macro 
  21341. Choose Single Step to play the macro and pause at every step. 
  21342. Choose Step Through to play the macro but not pause at any steps that are part 
  21343. of another function. 
  21344. Choose the desired command button to resume checking the macro. 
  21345.  
  21346. To stop playing the macro 
  21347. Choose Abort or Interrupt. 
  21348. These buttons replace the Select Macro button while Ami Pro plays the macro. 
  21349. The macro file remains in the window so you can continue debugging it. 
  21350. To debug another macro 
  21351. Make the desired macro file the active window and choose Select Macro. 
  21352. Ami Pro changes the macro file name in the Debug dialog box. 
  21353. You can now specify whether you want to play the macro or check each step in 
  21354. the macro. 
  21355.  
  21356. To display variables and modify their values 
  21357. If the Debug dialog box is open, you can display a list of macro variables and 
  21358. their values. You can modify the values and then continue the macro with the 
  21359. new values. 
  21360.  1.  Choose Variables in the Debug dialog box. 
  21361.     The Variables dialog box displays and remains on the screen so you can 
  21362.     continue to display variables and modify their values. 
  21363.  2.  Select the desired variable. 
  21364.  3.  Type the New Value you want to use. 
  21365.  4.  Choose Update if you want to assign a new value to the variable. 
  21366.  5.  Choose the desired command button in the Debug dialog box to play the 
  21367. macro. 
  21368.  6.  Choose Close to close the Variables dialog box when you no longer need to 
  21369. display the variables. 
  21370.  
  21371. See also: 
  21372.  
  21373.     Ami Pro Macro Language Contents 
  21374.     Debugging Macros 
  21375.     Macro Error Messages 
  21376.     Using the Message Function 
  21377.     Using the Messages Function 
  21378.     Using the SingleStep and IgnoreKeyboard Functions 
  21379.  
  21380.  
  21381.  
  21382.  
  21383. ΓòÉΓòÉΓòÉ 498. Using the SingleStep and IgnoreKeyboard Functions ΓòÉΓòÉΓòÉ
  21384.  
  21385. The SingleStep function is auseful because it allows you to trace the progress 
  21386. of your macro. When you use control statements in your macro, it may do 
  21387. something you don't expect if the value tested by the control statement is 
  21388. something you hadn't planned on. In single step mode, each statement is 
  21389. displayed as it is executed so that you can tell what your macro is doing. You 
  21390. can verify that the tests placed in your control statements do what you 
  21391. planned. 
  21392.  
  21393.  
  21394. If you use the SingleStep function and an error occurs, you will see 
  21395. information about the line that caused the problem. If the SingleStep function 
  21396. is not used, all that is shown is the error message with no indication of where 
  21397. the problem is. 
  21398.  
  21399. Any variables defined before the SingleStep function will not be available for 
  21400. viewing or changing. Also, any variable not yet defined when the macro is 
  21401. interrupted will not be available. When you use the StepThrough feature of 
  21402. SingleStep and the next statement is a Call function, all statements in the 
  21403. macro and any macros called will be executed without interruption. Once the 
  21404. called macro ends, the macro will again be interrupted. If the next statement 
  21405. is not a macro call, then StepThrough acts just like SingleStep. If a 
  21406. SingleStep(0) is encountered while stepping through the macro, it will not have 
  21407. an effect on the macro. If a SingleStep(1) is encountered, the macro will be 
  21408. interrupted. 
  21409.  
  21410. Other tools that can help you debug your macros are the IgnoreKeyboard, 
  21411. Message, and Messages functions. The IgnoreKeyboard function determines if any 
  21412. key will interrupt a macro or if only the Escape key will interrupt the macro. 
  21413. The Message function displays a message on the screen and then waits for the 
  21414. user to acknowledge it. The Messages function determines if messages issued by 
  21415. Ami Pro will be shown to the user or if they will be accepted and the default 
  21416. action taken. 
  21417.  
  21418. If the SingleStep function has not been used in your macro, the macro user can 
  21419. press a key to interrupt macro play. When a key is pressed, a message appears 
  21420. asking the user if macro play should be continued or canceled. The 
  21421. IgnoreKeyboard function determines if pressing any key pauses the macro (the 
  21422. default) or if pressing only the Escape key pauses the macro. 
  21423.  
  21424. If you use the SingleStep function, pausing the macro by pressing a key will 
  21425. cause the macro to enter single step mode. You will be able to continue macro 
  21426. play normally, continue in single step mode, or cancel macro play completely. 
  21427. This allows you to see what is happening in your macro if it appears to be in 
  21428. an infinite loop. 
  21429.  
  21430. Example 
  21431. The following example illustrates using the SingleStep Function to determine 
  21432. the cause of an infinite loop: 
  21433. FUNCTION debug 
  21434. SingleStep (Off)  ' allow debugging 
  21435. var1 = 1  ' initialize var1 
  21436. var2 = 2  ' initialize var2 
  21437. while (var1 < 10)  ' set loop to continue until var1 = 10 
  21438.    IF (var2 > 0) 
  21439.       var1 = var1 - 1  ' decrement var1 if var2 > 0 
  21440.    ENDIF 
  21441.    var1 = var1 + 1 ' increment var2 
  21442. WEND 
  21443. END FUNCTION 
  21444.  
  21445. In this example, a while loop is used to execute program steps while var1 is 
  21446. less than 10. The last statement in the WHILE loop increments var1, so the 
  21447. macro should execute the loop 10 times and then end. The IF statement in line 6 
  21448. decrements var1 if var2 is greater than 0. Since var2 is equal to 2, this means 
  21449. that var1 will always be decremented. This means that var1 will never increase 
  21450. as it passes through the loop, since it will be decremented in line 7 and then 
  21451. incremented in line 9. This means the loop will never end. 
  21452.  
  21453. If this macro were run, Ami Pro would appear to freeze with the clock icon 
  21454. displayed. By using SingleStep mode, pressing a key while the macro was running 
  21455. would allow the programmer to view the progress of the loop and determine the 
  21456. problem. 
  21457.  
  21458.  
  21459. See also: 
  21460.  
  21461.     Ami Pro Macro Language Contents 
  21462.     IgnoreKeyboard 
  21463.     Macro Error Messages 
  21464.     Message 
  21465.     Messages 
  21466.     SingleStep 
  21467.     Using the Message Function 
  21468.     Using the Messages Function 
  21469.  
  21470.  
  21471.  
  21472. ΓòÉΓòÉΓòÉ 499. Using the Message Function ΓòÉΓòÉΓòÉ
  21473.  
  21474. The Message function can be used to display the value of a variable as your 
  21475. macro executes. This can assist you in determining if variable values stay 
  21476. within the range you expect. 
  21477.  
  21478.  
  21479. Example 
  21480. Consider the following example: 
  21481. FUNCTION testswitch 
  21482. choice = Query$ ("Type a number between 1 and 3") 
  21483. SWITCH choice 
  21484.    CASE ("1") 
  21485.       ' statements for case 1 
  21486.    CASE ("2") 
  21487.       ' statements for case 2 
  21488.    CASE ("3") 
  21489.       ' statements for case 3 
  21490.    DEFAULT 
  21491.       message ("Got back {choice} for user's choice") 
  21492. ENDSWITCH 
  21493. END FUNCTION 
  21494.  
  21495. This example uses a SWITCH statement to execute macro statements based on a 
  21496. value typed in by the user. The Message statement in line 11 displays a message 
  21497. indicating the value of the switch variable if it wasn't one of the values 
  21498. expected. While this example is simple, placing messages in your macros can be 
  21499. helpful when debugging. This can be particularly true if the value being tested 
  21500. in a SWITCH statement is determined by the macro or is the result of a 
  21501. function. 
  21502.  
  21503.  
  21504. See also: 
  21505.  
  21506.     Ami Pro Macro Language Contents 
  21507.     Message 
  21508.     Using the Messages Function 
  21509.     Using the SingleStep and IgnoreKeyboard Functions 
  21510.  
  21511.  
  21512.  
  21513.  
  21514. ΓòÉΓòÉΓòÉ 500. Using the Messages Function ΓòÉΓòÉΓòÉ
  21515.  
  21516. The Messages function determines the action taken by a macro in response to 
  21517. unexpected Ami Pro messages. For instance, when a new file is opened, Ami Pro 
  21518. asks if the current file's changes should be saved. By using the Messages 
  21519. function, the macro can automatically take the default action for these 
  21520. messages without interrupting the macro user. 
  21521.  
  21522.  
  21523. In the early stages of developing a complicated macro, you may want to leave 
  21524. message display on. This helps you determine that the functions in the macro do 
  21525. what you want them to. Once you are sure that the macro is working correctly, 
  21526. you can turn messages off. 
  21527.  
  21528.  
  21529. See also: 
  21530.  
  21531.     Ami Pro Macro Language Contents 
  21532.     Messages 
  21533.     Using the SingleStep and IgnoreKeyboard Functions 
  21534.     Using the Message Function 
  21535.  
  21536.  
  21537.  
  21538. ΓòÉΓòÉΓòÉ 501. Ami Pro Macro Functions Grouped By Menu ΓòÉΓòÉΓòÉ
  21539.  
  21540. Edit Menu 
  21541. File Menu 
  21542. Frame Menu 
  21543. Help Menu 
  21544. Page Menu 
  21545. Style Menu 
  21546. System Menu 
  21547. Table Menu 
  21548. Text Menu 
  21549. Tools Menu 
  21550. View Menu 
  21551. Window Menu 
  21552.  
  21553.  
  21554.  
  21555. See also: 
  21556.  
  21557.     Ami Pro Macro Language Contents 
  21558.     Ami Pro Macro Functions Grouped Alphabetically 
  21559.     Ami Pro Macro Functions Grouped by Category 
  21560.  
  21561.  
  21562. ΓòÉΓòÉΓòÉ 502. Edit Menu ΓòÉΓòÉΓòÉ
  21563.  
  21564. Menu Item                                       Equivalent Macro Function 
  21565. Bookmarks                                       MarkBookMark 
  21566. Copy                                            Copy 
  21567. Cut                                             Cut 
  21568. Find & Replace                                  FindReplace 
  21569.                                                 (Displays the dialog box) 
  21570. Find & Replace                                  Replace 
  21571.                                                 (Automatically find & replace) 
  21572. Go To                                           GoToCmd 
  21573. Insert Bullet                                   InsertBullet 
  21574. Insert Date Time                                InsertDate 
  21575.                                                 (Inserts the date, but does not 
  21576.  display the dialog box) 
  21577. Insert Date Time                                InsertVariable 
  21578.                                                 (Displays the dialog box) 
  21579. Insert Doc Info Field                           InsertDocInfo 
  21580.                                                 (Displays the dialog box) 
  21581. Insert Doc Info Field                           InsertDocInfoField 
  21582.                                                 (Inserts a doc info field, but 
  21583.  does not display the dialog box) 
  21584. Insert Glossary Record                          Glossary 
  21585. Insert Glossary Record Data File                GlossSet 
  21586. Insert Merge Field                              FieldAdd 
  21587.                                                 (Inserts a merge field, but 
  21588.  does not display the dialog box) 
  21589. Insert Merge Field                              InsertMerge 
  21590.                                                 (Displays the dialog box) 
  21591. Insert Note                                     InsertNote 
  21592. Link Options                                    DDELinks 
  21593. Mark Text Glossary                              GlossaryAdd 
  21594. Mark Text Index Entry                           MarkIndexWord 
  21595. Mark Text No Hyphenation                        NoHyphenation 
  21596. Mark Text TOC Entry                             MarkTOCEntry 
  21597. Mark Text Revision Insertion                    RevisionInsertion 
  21598. Paste                                           Paste 
  21599. Power Fields Insert                             FieldAdd 
  21600.                                                 (Inserts a power field, but 
  21601.  does not display the dialog box) 
  21602. Power Fields Insert                             FieldCommand 
  21603.                                                 (Displays the dialog box) 
  21604. Power Fields Next Field                         FieldNext/FieldPrev 
  21605. Power Fields Prev Field                         FieldNext/FieldPrev 
  21606. Power Fields Update                             FieldEvaluate 
  21607. Power Fields Update                             FieldUpdate 
  21608. Power Fields Update All                         FieldUpdateAll 
  21609. Undo                                            Undo 
  21610.  
  21611. See also: 
  21612.  
  21613.     Ami Pro Macro Language Contents 
  21614.     Ami Pro Macro Functions Grouped By Menu 
  21615.  
  21616.  
  21617.  
  21618. ΓòÉΓòÉΓòÉ 503. File Menu ΓòÉΓòÉΓòÉ
  21619.  
  21620. Menu Item                                       Equivalent Macro Function 
  21621. Close                                           FileClose 
  21622. Doc Info                                        DocInfo 
  21623. File Management                                 FileManagement 
  21624. Import Picture                                  ImportPicture 
  21625. Master Document                                 MasterDoc 
  21626. Merge                                           Merge 
  21627. New                                             New 
  21628. Open                                            FileOpen 
  21629. Open a Previous File                            OpenPreviousFile 
  21630. Print Envelope                                  PrintEnvelope 
  21631. Print                                           FilePrint 
  21632. Printer Setup                                   PrintSetup 
  21633. Revert to Saved                                 Revert 
  21634. Save                                            Save 
  21635. Save As                                         SaveAs 
  21636. Send Mail                                       SendMail 
  21637.  
  21638. See also: 
  21639.  
  21640.     Ami Pro Macro Language Contents 
  21641.     Ami Pro Macro Functions Grouped By Menu 
  21642.  
  21643.  
  21644. ΓòÉΓòÉΓòÉ 504. Frame Menu ΓòÉΓòÉΓòÉ
  21645.  
  21646. Menu Item                                       Equivalent Macro Function 
  21647. Bring to Front                                  BringFrameToFront 
  21648. Create Frame                                    AddFrame 
  21649.                                                  (Creates a frame but does not 
  21650.  display the dialog box) 
  21651. Create Frame                                    AddFrameDlg 
  21652.                                                 (Displays the dialog box) 
  21653. Create Frame Manually                           ManualFrame 
  21654. Modify Frame Layout                             FrameLayout 
  21655. Send to Back                                    SendFrameToBack 
  21656.  
  21657. See also: 
  21658.  
  21659.     Ami Pro Macro Language Contents 
  21660.     Ami Pro Macro Functions Grouped By Menu 
  21661.  
  21662.  
  21663. ΓòÉΓòÉΓòÉ 505. Help Menu ΓòÉΓòÉΓòÉ
  21664.  
  21665. Menu Item                                       Equivalent Macro Function 
  21666. About Ami Pro                                   About 
  21667. Contents                                        Help 
  21668. How Do I?                                       HowDoIHelp 
  21669. Macro Doc                                       MacroHelp 
  21670. Using Help                                      UsingHelp 
  21671.  
  21672. See also: 
  21673.  
  21674.     Ami Pro Macro Language Contents 
  21675.     Ami Pro Macro Functions Grouped By Menu 
  21676.  
  21677.  
  21678. ΓòÉΓòÉΓòÉ 506. Page Menu ΓòÉΓòÉΓòÉ
  21679.  
  21680. Menu Item                                       Equivalent Macro Function 
  21681. Breaks                                          PageBreak 
  21682. Header Footer                                   HeaderFooter 
  21683. Insert Page Layout Insert                       InsertLayout 
  21684. Insert Page Layout Remove                       RemoveLayout 
  21685. Insert Page Layout Revert                       RevertLayout 
  21686. Line Numbering                                  LineNumber 
  21687. Modify Page Layout                              ModifyLayout 
  21688. Page Numbering                                  PageNumber 
  21689. Ruler Remove                                    TabRulerRemove 
  21690. Ruler Insert                                    TabRulerInsert 
  21691.  
  21692. See also: 
  21693.  
  21694.     Ami Pro Macro Language Contents 
  21695.     Ami Pro Macro Functions Grouped By Menu 
  21696.  
  21697.  
  21698. ΓòÉΓòÉΓòÉ 507. Style Menu ΓòÉΓòÉΓòÉ
  21699.  
  21700. Menu Item                                       Equivalent Macro Function 
  21701. Create Style                                    CreateStyle 
  21702. Define Style                                    DefineStyle 
  21703. Modify Style                                    ModifyStyle 
  21704. Outline Styles                                  OutlineStyle 
  21705. Save as a Style Sheet                           SaveAsNewStyle 
  21706. Select a Style                                  SelectStyle 
  21707. Style Management                                StyleManagement 
  21708.                                                 (Displays the dialog box) 
  21709.  
  21710. See also: 
  21711.  
  21712.     Ami Pro Macro Language Contents 
  21713.     Ami Pro Macro Functions Grouped By Menu 
  21714.  
  21715.  
  21716. ΓòÉΓòÉΓòÉ 508. System Menu ΓòÉΓòÉΓòÉ
  21717.  
  21718. Menu Item                                       Equivalent Macro Function 
  21719. Close                                           AppClose 
  21720. Maximize                                        Maximize 
  21721. Minimize                                        Minimize 
  21722. Move                                            AppMove 
  21723. Restore                                         Restore 
  21724. Size                                            AppSize 
  21725. Window List                                     ActivateApp 
  21726.  
  21727. See also: 
  21728.  
  21729.     Ami Pro Macro Language Contents 
  21730.     Ami Pro Macro Functions Grouped By Menu 
  21731.  
  21732.  
  21733.  
  21734.  
  21735. ΓòÉΓòÉΓòÉ 509. Table Menu ΓòÉΓòÉΓòÉ
  21736.  
  21737. Menu Item                                       Equivalent Macro Function 
  21738. Column Row Size                                 SizeColumnRow 
  21739. Connect Cells                                   ConnectCells 
  21740. Delete Column Row                               DeleteColumnRow 
  21741. Delete Entire Table                             DeleteEntireTable 
  21742. Edit Formula                                    EditFormula 
  21743.                                                 (Displays the dialog box) 
  21744. Edit Formula                                    SetFormula 
  21745.                                                 (Inserts the formula but does 
  21746.  not display the dialog box) 
  21747. Insert Column Row                               InsertColumnRow 
  21748. Leaders None                                    LeaderNone 
  21749. Leaders---                                      LeaderHyphs 
  21750. Leaders...                                      LeaderDots 
  21751. Leaders___                                      LeaderLines 
  21752. Lines & Color                                   TableLines 
  21753. Modify Table Layout                             TableLayout 
  21754. Protect Cells                                   ProtectCells 
  21755. Quick Add Column                                QuickAddCol 
  21756. Quick Add Row                                   QuickAddRow 
  21757. Select Row                                      SelectRow 
  21758. Select Column                                   SelectColumn 
  21759. Select Entire Table                             SelectEntireTable 
  21760.  
  21761. See also: 
  21762.  
  21763.     Ami Pro Macro Language Contents 
  21764.     Ami Pro Macro Functions Grouped By Menu 
  21765.  
  21766.  
  21767. ΓòÉΓòÉΓòÉ 510. Text Menu ΓòÉΓòÉΓòÉ
  21768.  
  21769. Menu Item                                       Equivalent Macro Function 
  21770. Alignment Center                                Center 
  21771. Alignment Left                                  LeftAlign 
  21772. Alignment Right                                 RightAlign 
  21773. Alignment Justify                               Justify 
  21774. Bold                                            Bold 
  21775. Caps Upper Case                                 UpperCase 
  21776. Caps Lower  case                                LowerCase 
  21777. Caps Small Caps                                 SmallCaps 
  21778. Fast Format                                     FastFormat 
  21779. Font                                            FontChange 
  21780. Indention                                       Indent 
  21781. Italic                                          Italic 
  21782. Normal                                          NormalText 
  21783. Spacing                                         Spacing 
  21784. Special Effects                                 SpecialEffects 
  21785. Underline                                       Underline 
  21786. Word Underline                                  WordUnderline 
  21787.  
  21788. See also: 
  21789.  
  21790.     Ami Pro Macro Language Contents 
  21791.     Ami Pro Macro Functions Grouped By Menu 
  21792.  
  21793.  
  21794. ΓòÉΓòÉΓòÉ 511. Tools Menu ΓòÉΓòÉΓòÉ
  21795.  
  21796. Menu Item                                       Equivalent Macro Function 
  21797. Equations                                       Equations 
  21798. Footnotes                                       Footnotes 
  21799. Generate Index                                  Generate 
  21800. Generate TOC                                    Generate 
  21801. Image Processing                                ImageProcessing 
  21802. Macros Edit                                     MacroEdit 
  21803. Macros Playback                                 MacroPlay 
  21804. Revision Marking                                RevisionMarking 
  21805. SmartIcons                                      IconCustomize 
  21806. Spell Check                                     SpellCheck 
  21807. Tables                                          Tables 
  21808. Thesaurus                                       Thesaurus 
  21809. User Setup                                      UserSetup 
  21810.  
  21811. See also: 
  21812.  
  21813.     Ami Pro Macro Language Contents 
  21814.     Ami Pro Macro Functions Grouped By Menu 
  21815.     Table Menu 
  21816.  
  21817.  
  21818. ΓòÉΓòÉΓòÉ 512. View Menu ΓòÉΓòÉΓòÉ
  21819.  
  21820. Menu Item                                       Equivalent Macro Function 
  21821. Custom                                          CustomView 
  21822. Draft Mode                                      DraftMode 
  21823. Enlarged                                        EnlargedView 
  21824. Facing Pages                                    FacingView 
  21825. Full Page                                       FullPageView 
  21826. Hide Clean Screen                               ToggleCleanScreen 
  21827. Hide Power Fields                               FieldToggleDisplay 
  21828. Hide Ruler                                      HideTabRuler 
  21829.                                                 ToggleTabRuler 
  21830. Hide SmartIcons                                 HideIconBar 
  21831.                                                 ToggleIconBar 
  21832. Layout Mode                                     LayoutMode 
  21833. Outline Mode                                    OutlineMode 
  21834. Show Clean Screen                               ToggleCleanScreen 
  21835. Show Power Fields                               FieldToggleDisplay 
  21836. Show Ruler                                      ShowTabRuler 
  21837.                                                 ToggleTabRuler 
  21838. Show SmartIcons                                 ShowIconBar 
  21839.                                                 ToggleIconBar 
  21840. Standard                                        StandardView 
  21841. View Preferences                                ViewPreferences 
  21842.  
  21843. See also: 
  21844.  
  21845.     Ami Pro Macro Language Contents 
  21846.     Ami Pro Macro Functions Grouped By Menu 
  21847.  
  21848.  
  21849. ΓòÉΓòÉΓòÉ 513. Window Menu ΓòÉΓòÉΓòÉ
  21850.  
  21851. Menu Item                                       Equivalent Macro Function 
  21852. Cascade                                         CascadeWindow 
  21853. New Window                                      NewWindow 
  21854. Tile                                            TileWindow 
  21855.  
  21856. See also: 
  21857.  
  21858.     Ami Pro Macro Language Contents 
  21859.     Ami Pro Macro Functions Grouped By Menu 
  21860.  
  21861.  
  21862. ΓòÉΓòÉΓòÉ 514. Macro Error Messages ΓòÉΓòÉΓòÉ
  21863.  
  21864. This section of the macro documentation lists each of the error messages that 
  21865. could appear during macro compilation and execution, along with suggestions for 
  21866. determining the cause of the problem. It does not cover the regular Ami Pro or 
  21867. OS/2 error messages. 
  21868.  
  21869.  
  21870. Ami Pro replaces the variables %s, %c, and %1d with the actual string, number, 
  21871. filename, etc. causing the problem. 
  21872.  
  21873.     Do you want to cancel the macro? 
  21874.     Internal Runtime Error %1d 
  21875.     Macro Error Messages 1 - 40 
  21876.     Macro Error Messages 41 - 80 
  21877.     Macro Error Messages 81 - 120 
  21878.     Macro Error Messages 121 - End 
  21879.  
  21880.  
  21881. See also: 
  21882.  
  21883.     Ami Pro Macro Language Contents 
  21884.     Debugging Macros 
  21885.  
  21886.  
  21887.  
  21888. ΓòÉΓòÉΓòÉ 515. Macro Error Messages 1 - 40 ΓòÉΓòÉΓòÉ
  21889.  
  21890.     Error 1 : Incorrect format used for this function 
  21891.     Error 2 : Symbol %s not recognized 
  21892.     Error 3 : Memory not available 
  21893.     Error 4 : %s is already defined as an array 
  21894.     Error 5 : Array name must be followed by ) 
  21895.     Error 6 : Incorrect expression as array argument 
  21896.     Error 7 : Incorrect expression, expecting ) 
  21897.     Error 8 : Incorrect parameter count 
  21898.     Error 9 : Misplaced keyword %s 
  21899.     Error 10 : Token file is unreadable 
  21900.     Error 11 : FUNCTION argument (%s) is already defined 
  21901.     Error 12 : FUNCTION statement has incorrect format 
  21902.     Error 13 : DECLARE statement has incorrect format 
  21903.     Error 14 : DECLARE or CALL statement has incorrect format 
  21904.     Error 15 : Variable name %s is not appropriate here 
  21905.     Error 16 : Symbol %s is not recognized 
  21906.     Error 17 : END FUNCTION statement was not found. 
  21907.     Error 18 : Expecting ( instead of %s here 
  21908.     Error 19 : Expecting ENDIF instead of %s here 
  21909.     Error 20 : Expecting %s instead of ELSEIF here 
  21910.     Error 21 : Expecting %s instead of ELSE here 
  21911.     Error 22 : Expecting %s instead of ENDIF here 
  21912.     Error 23 : Expecting %s instead of NEXT here 
  21913.     Error 24 : WHILE statement has incorrect format 
  21914.     Error 25 : CASE statement must follow SWITCH statement 
  21915.     Error 26 : Variable name must follow SWITCH statement 
  21916.     Error 27 : Expecting %s instead of CASE here 
  21917.     Error 28 : Expecting %s instead of DEFAULT here 
  21918.     Error 29 : Expecting %s instead of ENDSWITCH here 
  21919.     Error 30 : BREAK statement is inappropriate here 
  21920.     Error 31 : Expecting %s instead of FUNCTION here 
  21921.     Error 32 : Expecting %s instead of END FUNCTION here 
  21922.     Error 33 : Incorrect format used for CALL statement 
  21923.     Error 34 : Label %s is not defined 
  21924.     Error 35 : %s is already defined 
  21925.     Error 36 : Incorrect number of parameters: function %s 
  21926.     Error 37 : Incorrect format used for DIM statement 
  21927.     Error 38 : Incorrect format used for DEFSTR statement 
  21928.     Error 39 : Incorrect array expression 
  21929.     Error 40 : Assignment expected after FOR statement 
  21930.  
  21931.  
  21932. See also: 
  21933.  
  21934.     Ami Pro Macro Language Contents 
  21935.     Macro Error Messages Contents 
  21936.     Macro Error Messages 41 - 80 
  21937.     Macro Error Messages 81 - 120 
  21938.     Macro Error Messages 121 - End 
  21939.  
  21940.  
  21941.  
  21942.  
  21943. ΓòÉΓòÉΓòÉ 516. Macro Error Messages 41 - 80 ΓòÉΓòÉΓòÉ
  21944.  
  21945.     Error 41 : TO expected in FOR statement 
  21946.     Error 42 : Improper label used in GOTO statement 
  21947.     Error 43 : Incorrect syntax used in DECLARE statement 
  21948.     Error 44 : No macros found in file 
  21949.     Error 45 : Incorrect character %c used here 
  21950.     Error 46 : Macro line can't end like this 
  21951.     Error 47 : Token file has become damaged 
  21952.     Error 48 : %s is an improper keyname 
  21953.     Error 49 : Too many characters in this string 
  21954.     Error 50 : Called macro must have a filename or be in the current macro 
  21955.     file 
  21956.     Error 51 : Macro %s not found 
  21957.     Error 52 : Insufficient memory to execute this macro 
  21958.     Error 53 : Insufficient memory to execute this macro 
  21959.     Error 54 : DDEReceive could not be executed 
  21960.     Error 55 : DDEReceive did not get data back from the other program 
  21961.     Error 56 : Incorrect parameters used for DDEReceive function 
  21962.     Error 58 : Incorrect parameters used for DDEExecute function 
  21963.     Error 59 : Incorrect Parameters used %s Line %1d 
  21964.     Error 60 : Can't read macro file 
  21965.     Error 61 : Internal error, start address %s 
  21966.     Error 62 : Internal error, opcode %s 
  21967.     Error 63 : Internal error, function %1d 
  21968.     Error 64 : Internal error, parm count %s Line %1d 
  21969.     Error 65 : Internal error, no function number %s Line %1d 
  21970.     Error 66 : Internal error, bad logop 
  21971.     Error 67 : Internal error, logop stack 
  21972.     Error 68 : Internal error, relop stack 
  21973.     Error 69 : Internal error, mathops stack 
  21974.     Error 70 : Internal error, bad mathop 
  21975.     Error 71 : Attempt to add non-numeric values %s Line %1d 
  21976.     Error 72 : Attempt to divide by zero, %s Line %1d 
  21977.     Error 73 : Attempted math function on non-numeric values, %s Line %1d 
  21978.     Error 74 : Internal error, bad mulop 
  21979.     Error 75 : Internal error, POPVAR stack 
  21980.     Error 76 : Internal error, JMPF stack 
  21981.     Error 77 : Internal error, JMPF stack 
  21982.     Error 78 : Internal error, POPRLT stack 
  21983.     Error 79 : Internal error, call address %s 
  21984.     Error 80 : Array index out of range 
  21985.  
  21986.  
  21987. See also: 
  21988.  
  21989.     Ami Pro Macro Language Contents 
  21990.     Macro Error Messages Contents 
  21991.     Macro Error Messages 1 - 40 
  21992.     Macro Error Messages 81 - 120 
  21993.     Macro Error Messages 121 - End 
  21994.  
  21995.  
  21996.  
  21997.  
  21998. ΓòÉΓòÉΓòÉ 517. Macro Error Messages 81 - 120 ΓòÉΓòÉΓòÉ
  21999.  
  22000.     Error 81 : Macro called Ami Pro Function that has been grayed 
  22001.     Error 82 : ONERROR or ONCANCEL can't be in a called macro 
  22002.     Error 83 : Macro referenced in CALL statement can't be found 
  22003.     Error 84 : Insufficient memory for AddMenu functions 
  22004.     Error 86 : Unable to complete CreateMenu function 
  22005.     Error 87 : Maximum menu count reached in AddMenu function 
  22006.     Error 89 : Unable to complete menu function, Lock failure 
  22007.     Error 90 : Unable to create new menu 
  22008.     Error 91 : Maximum count reached in AddMenuItem 
  22009.     Error 92 : Insufficient memory for menu functions. 
  22010.     Error 93 : Internal Error, shrinking menus 
  22011.     Error 94 : Internal Error, symbol number 
  22012.     Error 95 : Internal Error, symbol number 
  22013.     Error 96 : Internal Error, grow strings 
  22014.     Error 97 : Internal Error, strings 
  22015.     Error 98 : Internal Error, grow strings 
  22016.     Error 99 : Internal Error, lock strings 
  22017.     Error 100 : Internal Error, realloc array 
  22018.     Error 101 : Internal Error, string frame 
  22019.     Error 102 : Internal Error, no stack 
  22020.     Error 103 : Index out of bounds in global array 
  22021.     Error 104 : Insufficient memory to run this macro 
  22022.     Error 105 : Unknown global variable used 
  22023.     Error 106 : Incorrect parameter used for this function 
  22024.     Error 107 : Insufficient memory to run this macro 
  22025.     Error 108 : %s is not a macro file 
  22026.     Error 109 : Incorrect combination of keyword(s) 
  22027.     Error 110 : Incorrect offset for start of string 
  22028.     Error 111 : THEN statement is inappropriate here 
  22029.     Error 112 : Record function(s) couldn't be translated 
  22030.     Error 113 : Unknown token %s, is not a valid parameter. 
  22031.     Error 114 : Function %s has not been declared. 
  22032.     Error 115 : Failure to lock global memory. 
  22033.     Error 116 : Corrupt variable. 
  22034.     Error 117 : Invalid variable type (%1d). 
  22035.     Error 118 : Mismatch on assignment (%1d). 
  22036.     Error 119 : Memory allocation failure (%1d). 
  22037.     Error 120 : Wrong data type for operation (%1d). 
  22038.  
  22039.  
  22040. See also: 
  22041.  
  22042.     Ami Pro Macro Language Contents 
  22043.     Macro Error Messages Contents 
  22044.     Macro Error Messages 1 - 40 
  22045.     Macro Error Messages 41 - 80 
  22046.     Macro Error Messages 121 - End 
  22047.  
  22048.  
  22049. ΓòÉΓòÉΓòÉ 518. Macro Error Messages 120 - End ΓòÉΓòÉΓòÉ
  22050.  
  22051.     Error 121 : GlobalLock failure (%1d). 
  22052.     Error 122 : Variable confusion. 
  22053.     Error 124 : Field does not end properly. 
  22054.     Error 125 : Field number out of range. 
  22055.     Error 126 : Quoted string not properly terminated. 
  22056.     Error 127 : Call statement must reference a macroname. 
  22057.     Error 129 : Invalid number for FormatDate. 
  22058.     Error 130 : Failed to Exec %s. 
  22059.     Error 131 : Indirect variable required. (Use &variable) 
  22060.     Error 132 : Array variable required for this function. 
  22061.     Error 133 : Incorrect number of parameters. 
  22062.     Error 134 : Only one macro may be paused at a time. 
  22063.     Error 135 : Invalid DIALOG BOX format. 
  22064.     Error 136 : Misplaced Keyword DIALOG. DIALOG boxes must be defined outside 
  22065.     of functions. 
  22066.     Error 137 : Misplaced Keyword END DIALOG. 
  22067.     Error 138 : Illegal use of indirection. 
  22068.     Error 139 : Invalid argument to ALIAS. 
  22069.     Error 140 : Invalid argument. 
  22070.     Error 142 : DEFINE (%s) identifier must be undefined. 
  22071.     Error 143 : DEFINE closing parenthesis expected. 
  22072.     Error 144 : Invalid syntax for DEFINE. 
  22073.     Error 145 : Replacement to long for DEFINE. 
  22074.     Error 146 : Duplicate DEFINE/Variable name (%s). 
  22075.     Error 147 : Line too long. 
  22076.     Error 149 : Open parenthesis unexpected. 
  22077.     Error 150 : Invalid Dll ID. 
  22078.     Error 151 : Failed to load DLL. 
  22079.     Error 152 : Failed to open control file. 
  22080.     Error 153 : Indirect Variable Required 
  22081.     Error 163 : This function is not supported in this version. 
  22082.  
  22083.  
  22084. See also: 
  22085.  
  22086.     Ami Pro Macro Language Contents 
  22087.     Macro Error Messages Contents 
  22088.     Macro Error Messages 1 - 40 
  22089.     Macro Error Messages 41 - 80 
  22090.     Macro Error Messages 81 - 120 
  22091.  
  22092.  
  22093. ΓòÉΓòÉΓòÉ 519. Internal Runtime Error %1d ΓòÉΓòÉΓòÉ
  22094.  
  22095. This is an internal error. It signifies an unexpected runtime error. It should 
  22096. not appear. If this message does appear, note the number that is given and then 
  22097. call Ami Pro customer support for further assistance. 
  22098.  
  22099.  
  22100. ΓòÉΓòÉΓòÉ 520. Do you want to cancel the macro? ΓòÉΓòÉΓòÉ
  22101.  
  22102. This message appears when you did not use SingleStep mode and you pressed a key 
  22103. during macro execution. 
  22104.  
  22105. If you choose Yes and the label defined by the ONCANCEL statement was used, the 
  22106. control transfers to the label. If the label was not used, the macro ends. 
  22107.  
  22108. If you choose No, macro execution continues. 
  22109.  
  22110. See also: 
  22111.     SingleStep 
  22112.     Using the ONCANCEL Statement 
  22113.  
  22114.  
  22115.  
  22116. ΓòÉΓòÉΓòÉ 521. Error 1 ΓòÉΓòÉΓòÉ
  22117.  
  22118. The format used for this function is not the correct format. Check for missing 
  22119. parentheses after the function name or at the end of the function. Also check 
  22120. for improper characters within the parentheses. 
  22121.  
  22122.  
  22123. ΓòÉΓòÉΓòÉ 522. Error 2 ΓòÉΓòÉΓòÉ
  22124.  
  22125. The character at the insertion point is not recognized by the macro compiler. 
  22126. If it is a variable, check to make sure it has been defined first. If it is a 
  22127. function, check the spelling of the function name. 
  22128.  
  22129.  
  22130. ΓòÉΓòÉΓòÉ 523. Error 3 ΓòÉΓòÉΓòÉ
  22131.  
  22132. There is not enough memory available to compile the macro. Reduce memory usage 
  22133. by exiting other applications and then recompile the macro. 
  22134.  
  22135.  
  22136. ΓòÉΓòÉΓòÉ 524. Error 4 ΓòÉΓòÉΓòÉ
  22137.  
  22138. The array name used in this DIM statement is already defined as something else 
  22139. in this macro. Use another array name. 
  22140.  
  22141.  
  22142. See also: 
  22143.  
  22144.     Declaring Formal Variables Using the DIM Statement 
  22145.  
  22146.  
  22147. ΓòÉΓòÉΓòÉ 525. Error 5 ΓòÉΓòÉΓòÉ
  22148.  
  22149. When using an array name, the element number of the array must be surrounded by 
  22150. parentheses. Check the parentheses and then recompile the macro. 
  22151.  
  22152.  
  22153. ΓòÉΓòÉΓòÉ 526. Error 6 ΓòÉΓòÉΓòÉ
  22154.  
  22155. The element number of this array is not a number or the expression you used 
  22156. doesn't evaluate to an integer. Correct the expression and then recompile the 
  22157. macro. 
  22158.  
  22159.  
  22160. ΓòÉΓòÉΓòÉ 527. Error 7 ΓòÉΓòÉΓòÉ
  22161.  
  22162. The number of closing parentheses in this expression does not match the number 
  22163. of opening parentheses. Count the parentheses, correct errors, and then 
  22164. recompile the macro. 
  22165.  
  22166.  
  22167. ΓòÉΓòÉΓòÉ 528. Error 8 ΓòÉΓòÉΓòÉ
  22168.  
  22169. You did not provide the correct number of parameters for this function. Check 
  22170. the requirements of this function, correct errors, and then recompile the 
  22171. macro. 
  22172.  
  22173.  
  22174. ΓòÉΓòÉΓòÉ 529. Error 9 ΓòÉΓòÉΓòÉ
  22175.  
  22176. The keyword does not belong at this point in the macro. Check the syntax of 
  22177. what you were trying to do, correct errors, and then recompile the macro. 
  22178.  
  22179.  
  22180. ΓòÉΓòÉΓòÉ 530. Error 10 ΓòÉΓòÉΓòÉ
  22181.  
  22182. This indicates the file MACTOKEN.SAM in the AMIPRO directory is damaged or 
  22183. missing. You cannot compile the macro until it has been replaced. Call Ami Pro 
  22184. support for instructions on how to replace this file. 
  22185.  
  22186.  
  22187. ΓòÉΓòÉΓòÉ 531. Error 11 ΓòÉΓòÉΓòÉ
  22188.  
  22189. The arguments you used in the FUNCTION statement have already been defined and 
  22190. cannot be used at that point. You may have used a function name or a constant 
  22191. as the macro argument. Check the syntax, correct errors, and then recompile the 
  22192. macro. 
  22193.  
  22194.  
  22195. See also: 
  22196.  
  22197.     Using the FUNCTION Statement 
  22198.  
  22199.  
  22200. ΓòÉΓòÉΓòÉ 532. Error 12 ΓòÉΓòÉΓòÉ
  22201.  
  22202. The format of the FUNCTION statement is incorrect. The syntax of the FUNCTION 
  22203. statement is FUNCTION macroname([arguments]). Macroname cannot be a name of a 
  22204. statement or a function. Make sure that you have parentheses following the 
  22205. macro name and that the name is not a reserved word. Correct errors and then 
  22206. recompile the macro. 
  22207.  
  22208.  
  22209. See also: 
  22210.  
  22211.     Using the FUNCTION Statement 
  22212.  
  22213.  
  22214.  
  22215.  
  22216. ΓòÉΓòÉΓòÉ 533. Error 13 ΓòÉΓòÉΓòÉ
  22217.  
  22218. The format of the DECLARE statement is not correct. The syntax of the DECLARE 
  22219. statement is DECLARE macroname([arguments]). Make sure that you have 
  22220. parentheses following the macro name and that you have not used function names 
  22221. for the arguments. Correct errors and then recompile the macro. 
  22222.  
  22223.  
  22224. See also: 
  22225.  
  22226.     Using the DECLARE Statement 
  22227.  
  22228.  
  22229. ΓòÉΓòÉΓòÉ 534. Error 14 ΓòÉΓòÉΓòÉ
  22230.  
  22231. The format of the DECLARE or CALL statement is not correct. The syntax of the 
  22232. DECLARE statement is DECLARE macroname([arguments]). The format of the CALL 
  22233. statement is CALL macroname([arguments]). Make sure that you have parentheses 
  22234. following the macro name and that you have not used function names for the 
  22235. arguments. Correct errors and then recompile the macro. 
  22236.  
  22237.  
  22238. See also: 
  22239.  
  22240.     Using the CALL and CALLI Statements 
  22241.     Using the DECLARE Statement 
  22242.  
  22243.  
  22244. ΓòÉΓòÉΓòÉ 535. Error 15 ΓòÉΓòÉΓòÉ
  22245.  
  22246. A variable name does not belong at this point in the macro. The macro may be 
  22247. expecting an array name instead of a variable name. You may have incorrectly 
  22248. used a variable name instead of a function or statement name. Correct errors 
  22249. and then recompile the macro. 
  22250.  
  22251.  
  22252. ΓòÉΓòÉΓòÉ 536. Error 16 ΓòÉΓòÉΓòÉ
  22253.  
  22254. The character at the insertion point is not recognized by the macro compiler. 
  22255. If it is a variable, check to make sure it has been properly defined. If it is 
  22256. a function, check the spelling of the function name. Correct errors and then 
  22257. recompile the macro. 
  22258.  
  22259.  
  22260. ΓòÉΓòÉΓòÉ 537. Error 17 ΓòÉΓòÉΓòÉ
  22261.  
  22262. The macro does not have an END FUNCTION statement. Insert an END FUNCTION 
  22263. statement and then recompile the macro. 
  22264.  
  22265.  
  22266.  
  22267. See also: 
  22268.  
  22269.     Using the END Function Statement 
  22270.  
  22271.  
  22272. ΓòÉΓòÉΓòÉ 538. Error 18 ΓòÉΓòÉΓòÉ
  22273.  
  22274. The IF statement should be followed by an open parentheses and the condition to 
  22275. evaluate the IF statement against. Correct the IF statement and then recompile 
  22276. the macro. 
  22277.  
  22278.  
  22279. See also: 
  22280.  
  22281.     Using the IF/THEN Statements 
  22282.  
  22283.  
  22284. ΓòÉΓòÉΓòÉ 539. Error 19 ΓòÉΓòÉΓòÉ
  22285.  
  22286. You cannot use an ELSEIF or ELSE statement following an ELSE statement. 
  22287. Rearrange the order of your ELSE and ELSEIF statements and then recompile the 
  22288. macro. 
  22289.  
  22290.  
  22291. See also: 
  22292.  
  22293.     Using the IF/THEN Statements 
  22294.  
  22295.  
  22296. ΓòÉΓòÉΓòÉ 540. Error 20 ΓòÉΓòÉΓòÉ
  22297.  
  22298. The location of the ELSEIF statement is not correct or the macro is not being 
  22299. controlled by an IF statement at this point. The ELSEIF condition must be prior 
  22300. to the ELSE and ENDIF statements governed by the IF statement. Make sure the 
  22301. conditions are positioned correctly and then recompile the macro. 
  22302.  
  22303.  
  22304. See also: 
  22305.  
  22306.     Using the IF/THEN Statements 
  22307.  
  22308.  
  22309.  
  22310.  
  22311. ΓòÉΓòÉΓòÉ 541. Error 21 ΓòÉΓòÉΓòÉ
  22312.  
  22313. The location of the ELSE statement is not correct, or the macro is not being 
  22314. controlled by an IF statement at this time. The ELSE condition must be the last 
  22315. condition before the ENDIF statement. Make sure the conditions are positioned 
  22316. correctly and then recompile the macro. 
  22317.  
  22318.  
  22319.  
  22320. See also: 
  22321.  
  22322.     Using the IF/THEN Statements 
  22323.  
  22324.  
  22325.  
  22326.  
  22327. ΓòÉΓòÉΓòÉ 542. Error 22 ΓòÉΓòÉΓòÉ
  22328.  
  22329. The location of the ENDIF statement is not correct, or the macro is not being 
  22330. controlled by an IF statement at this time. The ENDIF statement should follow 
  22331. all ELSEIF statements. If the ELSE statement is used, the ENDIF statement 
  22332. should also follow it. Make sure the location of the ENDIF statement is 
  22333. appropriate and then recompile the macro. 
  22334.  
  22335.  
  22336.  
  22337. See also: 
  22338.  
  22339.     Using the IF/THEN Statements 
  22340.  
  22341.  
  22342.  
  22343.  
  22344. ΓòÉΓòÉΓòÉ 543. Error 23 ΓòÉΓòÉΓòÉ
  22345.  
  22346. The location of the NEXT statement is not correct, or the macro is not being 
  22347. controlled by an FOR statement at this time. Make sure the location of the NEXT 
  22348. statement is appropriate and then recompile the macro. 
  22349.  
  22350.  
  22351. See also: 
  22352.  
  22353.     Using the FOR Statement 
  22354.  
  22355.  
  22356. ΓòÉΓòÉΓòÉ 544. Error 24 ΓòÉΓòÉΓòÉ
  22357.  
  22358. The format of the WHILE is not correct. The syntax of the WHILE statement is 
  22359. WHILE (expression) statements WEND. Make sure that the WHILE statement is 
  22360. formatted correctly and then recompile the macro. 
  22361.  
  22362.  
  22363. See also: 
  22364.  
  22365.     Using the WHILE Statement 
  22366.  
  22367.  
  22368. ΓòÉΓòÉΓòÉ 545. Error 25 ΓòÉΓòÉΓòÉ
  22369.  
  22370. The location of the CASE statement is not correct. All CASE statements must 
  22371. appear between a SWITCH and an ENDSWITCH statement. They cannot appear 
  22372. following the DEFAULT statement. Make sure the SWITCH loop is formatted 
  22373. correctly and then recompile the macro. 
  22374.  
  22375.  
  22376. See also: 
  22377.  
  22378.     Using the SWITCH and CASE Statements 
  22379.  
  22380.  
  22381. ΓòÉΓòÉΓòÉ 546. Error 26 ΓòÉΓòÉΓòÉ
  22382.  
  22383. The SWITCH statement must have a variable name immediately following it that 
  22384. can be evaluated against the expressions used in the following CASE statements. 
  22385. Insert a variable name following the SWITCH statement and then recompile the 
  22386. macro. 
  22387.  
  22388.  
  22389. See also: 
  22390.  
  22391.     Using the SWITCH and CASE Statements 
  22392.  
  22393.  
  22394.  
  22395.  
  22396. ΓòÉΓòÉΓòÉ 547. Error 27 ΓòÉΓòÉΓòÉ
  22397.  
  22398. The location of the CASE statement is not correct. All CASE statements must 
  22399. appear between a SWITCH and an ENDSWITCH statement. They cannot appear 
  22400. following the DEFAULT statement. Make sure the SWITCH loop is formatted 
  22401. correctly and then recompile the macro. 
  22402.  
  22403.  
  22404. See also: 
  22405.  
  22406.     Using the SWITCH and CASE Statements 
  22407.  
  22408.  
  22409.  
  22410.  
  22411. ΓòÉΓòÉΓòÉ 548. Error 28 ΓòÉΓòÉΓòÉ
  22412.  
  22413. The location of the DEFAULT statement is not correct, or the macro is not 
  22414. evaluating a SWITCH/ENDSWITCH condition at the location of the DEFAULT 
  22415. statement. The DEFAULT statement must appear following all CASE statements and 
  22416. just before the ENDSWITCH statement. Check to make sure the SWITCH loop is 
  22417. formatted correctly and then recompile the macro. 
  22418.  
  22419.  
  22420. See also: 
  22421.  
  22422.     Using the SWITCH and CASE Statements 
  22423.  
  22424.  
  22425.  
  22426.  
  22427. ΓòÉΓòÉΓòÉ 549. Error 29 ΓòÉΓòÉΓòÉ
  22428.  
  22429. The location of the ENDSWITCH statement is not correct, or the macro is not 
  22430. evaluating a SWITCH/ENDSWITCH condition at the location of the ENDSWITCH 
  22431. statement. The ENDSWITCH statement must appear following all CASE statements 
  22432. and the DEFAULT statement. Make sure the SWITCH loop is formatted correctly and 
  22433. then recompile the macro. 
  22434.  
  22435.  
  22436. See also: 
  22437.  
  22438.     Using the SWITCH and CASE Statements 
  22439.  
  22440.  
  22441.  
  22442.  
  22443. ΓòÉΓòÉΓòÉ 550. Error 30 ΓòÉΓòÉΓòÉ
  22444.  
  22445. The location of the BREAK statement is not correct, or the macro is not 
  22446. evaluating a SWITCH/ENDSWITCH, FOR/NEXT or WHILE/WEND condition at the location 
  22447. of the BREAK statement. Make sure the BREAK statement is in a FOR/NEXT, 
  22448. SWITCH/ENDSWITCH or WHILE/WEND loop and then recompile the macro. 
  22449.  
  22450.  
  22451. See also: 
  22452.  
  22453.     Using the BREAK Statement 
  22454.     Using the FOR Statement 
  22455.     Using the SWITCH and CASE Statements 
  22456.     Using the WHILE Statement 
  22457.  
  22458.  
  22459.  
  22460.  
  22461. ΓòÉΓòÉΓòÉ 551. Error 31 ΓòÉΓòÉΓòÉ
  22462.  
  22463. The location of the FUNCTION statement is not correct. The FUNCTION statement 
  22464. must be the very first thing in a macro. If this is not the first macro in the 
  22465. file, make sure the previous macro is terminated with an END FUNCTION 
  22466. statement. Make corrections and then recompile the macro. 
  22467.  
  22468.  
  22469. See also: 
  22470.  
  22471.     Using the FUNCTION Statement 
  22472.  
  22473.  
  22474. ΓòÉΓòÉΓòÉ 552. Error 32 ΓòÉΓòÉΓòÉ
  22475.  
  22476. The location of the END FUNCTION statement is not correct. The END FUNCTION 
  22477. statement must be the last statement in a macro. Prior to the END FUNCTION 
  22478. statement, all IF/THEN, WHILE/WEND, SWITCH/ENDSWITCH and FOR/NEXT loops must be 
  22479. terminated. Correct errors and then recompile the macro. 
  22480.  
  22481.  
  22482. See also: 
  22483.  
  22484.     Using the END FUNCTION Statement 
  22485.     Using the FOR Statement 
  22486.     Using the IF/THEN Statements 
  22487.     Using the SWITCH and CASE Statements 
  22488.     Using the WHILE Statement 
  22489.  
  22490.  
  22491. ΓòÉΓòÉΓòÉ 553. Error 33 ΓòÉΓòÉΓòÉ
  22492.  
  22493. The syntax you used for the CALL statement is not correct. The correct syntax 
  22494. is: CALL macroname([parameters]). Make sure that the macroname is followed by 
  22495. parentheses and that the arguments to the called macro are correct. Correct 
  22496. errors and then recompile the macro. 
  22497.  
  22498.  
  22499. See also: 
  22500.  
  22501.     Using the CALL and CALLI Statements 
  22502.  
  22503.  
  22504. ΓòÉΓòÉΓòÉ 554. Error 34 ΓòÉΓòÉΓòÉ
  22505.  
  22506. The label you referenced in a GOTO statement was not found in the macro. Check 
  22507. the spelling of the label and make sure that the label is formatted correctly. 
  22508. Correct errors and then recompile the macro. 
  22509.  
  22510.  
  22511. See also: 
  22512.  
  22513.     Using Labels 
  22514.     Using the GOTO Statement 
  22515.  
  22516.  
  22517. ΓòÉΓòÉΓòÉ 555. Error 35 ΓòÉΓòÉΓòÉ
  22518.  
  22519. The label name you used is already used as a label, or it is used as a variable 
  22520. name or function name. Select a unique name for the label and then recompile 
  22521. the macro. 
  22522.  
  22523.  
  22524. See also: 
  22525.  
  22526.     Using Labels 
  22527.  
  22528.  
  22529.  
  22530.  
  22531. ΓòÉΓòÉΓòÉ 556. Error 36 ΓòÉΓòÉΓòÉ
  22532.  
  22533. There are too few or too many parameters used for this function. Check the 
  22534. required syntax, correct the parameters, and then recompile the macro. 
  22535.  
  22536.  
  22537. ΓòÉΓòÉΓòÉ 557. Error 37 ΓòÉΓòÉΓòÉ
  22538.  
  22539. The syntax you used in the DIM statement is not correct. The correct syntax is 
  22540. DIM arrayname(count), [arrayname(count)...]. Check the statement, correct 
  22541. errors, and then recompile the macro. 
  22542.  
  22543.  
  22544. See also: 
  22545.  
  22546.     Declaring Formal Variables using the DIM Statement 
  22547.  
  22548.  
  22549. ΓòÉΓòÉΓòÉ 558. Error 38 ΓòÉΓòÉΓòÉ
  22550.  
  22551. The syntax you used in the DEFSTR statement is not correct. The correct syntax 
  22552. is DEFSTR variablename [, variablename...]. Check the statement, correct the 
  22553. errors, and then recompile the macro. 
  22554.  
  22555.  
  22556. See also: 
  22557.  
  22558.     Declaring Formal Variables using the DEFSTR Statement 
  22559.  
  22560.  
  22561. ΓòÉΓòÉΓòÉ 559. Error 39 ΓòÉΓòÉΓòÉ
  22562.  
  22563. Something is wrong with the array reference you used. The array name must be 
  22564. followed by the element number in parentheses. The element number must be a 
  22565. number or the expression must evaluate to an integer. Correct the expression 
  22566. and then recompile the macro. 
  22567.  
  22568.  
  22569. ΓòÉΓòÉΓòÉ 560. Error 40 ΓòÉΓòÉΓòÉ
  22570.  
  22571. You formatted the FOR statement incorrectly. The correct syntax for the FOR 
  22572. statement is FOR assignment TO expression [STEP expression]. Make sure you 
  22573. initialize the counting variable in the FOR loop and then recompile the macro. 
  22574.  
  22575.  
  22576. See also: 
  22577.  
  22578.     Using the FOR Statement 
  22579.  
  22580.  
  22581. ΓòÉΓòÉΓòÉ 561. Error 41 ΓòÉΓòÉΓòÉ
  22582.  
  22583. You formatted the FOR statement incorrectly. The correct syntax for the FOR 
  22584. statement is FOR assignment TO expression [STEP expression]. Make sure you 
  22585. initialize the counting variable in the FOR loop and then recompile the macro. 
  22586.  
  22587.  
  22588. See also: 
  22589.  
  22590.     Using the FOR Statement 
  22591.  
  22592.  
  22593.  
  22594.  
  22595. ΓòÉΓòÉΓòÉ 562. Error 42 ΓòÉΓòÉΓòÉ
  22596.  
  22597. The label name you used in the GOTO statement is not a label. Labels cannot be 
  22598. variable names, function names, or expressions. Make sure that the label name 
  22599. is correct and then recompile the macro. 
  22600.  
  22601.  
  22602. See also: 
  22603.  
  22604.     Using the GOTO Statement 
  22605.     Using label 
  22606.  
  22607.  
  22608. ΓòÉΓòÉΓòÉ 563. Error 43 ΓòÉΓòÉΓòÉ
  22609.  
  22610. The DECLARE statement is formatted incorrectly. The correct syntax for the 
  22611. DECLARE statement is DECLARE macroname([arguments]). Make sure the macroname is 
  22612. followed by parentheses and any arguments. Correct errors and then recompile 
  22613. the macro. 
  22614.  
  22615.  
  22616. See also: 
  22617.  
  22618.      Using the DECLARE Statement 
  22619.  
  22620.  
  22621. ΓòÉΓòÉΓòÉ 564. Error 44 ΓòÉΓòÉΓòÉ
  22622.  
  22623. The macro file you saved does not have any macros in it. If the file is an Ami 
  22624. Pro document file, you should save it with a .SAM extension. If this file is a 
  22625. macro file, make sure that the FUNCTION statement is spelled and formatted 
  22626. correctly. Correct errors and then recompile the macro. 
  22627.  
  22628.  
  22629. See also: 
  22630.  
  22631.     Using the END FUNCTION Statement 
  22632.  
  22633.  
  22634. ΓòÉΓòÉΓòÉ 565. Error 45 ΓòÉΓòÉΓòÉ
  22635.  
  22636. The character you typed here does not belong at this point in the macro. Check 
  22637. the syntax for the function you were trying to perform. If the character should 
  22638. be part of a string, make sure that there are quotation marks around it. 
  22639. Correct the statement and then recompile the macro. 
  22640.  
  22641.  
  22642. ΓòÉΓòÉΓòÉ 566. Error 46 ΓòÉΓòÉΓòÉ
  22643.  
  22644. The line the insertion point is on cannot end the way it does. Perhaps there 
  22645. are too few closing parentheses on the line, or perhaps you forgot to end a 
  22646. string with quotation marks. Check the statement, make corrections, and then 
  22647. recompile the macro. 
  22648.  
  22649.  
  22650. ΓòÉΓòÉΓòÉ 567. Error 47 ΓòÉΓòÉΓòÉ
  22651.  
  22652. This indicates the file MACTOKEN.SAM in the AMIPRO directory has become damaged 
  22653. or is missing. You cannot compile the macro until it has been replaced. Call 
  22654. Ami Pro support for instructions on how to replace this file. 
  22655.  
  22656.  
  22657. ΓòÉΓòÉΓòÉ 568. Error 48 ΓòÉΓòÉΓòÉ
  22658.  
  22659. The keyname is not the name of a key. Either the keyname is misspelled or you 
  22660. used a square brace ([) in this string. Check the list of permissible keynames. 
  22661. If you wanted to type a square brace in the string, use two braces ([[) 
  22662. instead. Correct errors and then recompile the macro. 
  22663.  
  22664.  
  22665. ΓòÉΓòÉΓòÉ 569. Error 49 ΓòÉΓòÉΓòÉ
  22666.  
  22667. There is a limit of 80 characters that can be used in any single string. You 
  22668. have exceeded this limit. Shorten the string or break it into two strings and 
  22669. then recompile the macro. 
  22670.  
  22671.  
  22672. ΓòÉΓòÉΓòÉ 570. Error 50 ΓòÉΓòÉΓòÉ
  22673.  
  22674. One of the macros in this file calls another macro that is not in this file and 
  22675. does not have the name of another macro file associated with it. Any called 
  22676. macros must either be in the macro file you are executing or must have 
  22677. filenames supplied with the macro so they can be found. Make sure the macro 
  22678. name is spelled correctly and its location is identified correctly. Correct 
  22679. errors and then recompile the macro. 
  22680.  
  22681.  
  22682. ΓòÉΓòÉΓòÉ 571. Error 51 ΓòÉΓòÉΓòÉ
  22683.  
  22684. One of the macros in this file should be in another macro file, but is not. 
  22685. When a filename for an macro is specified, Ami Pro searches the macpath 
  22686. directory, the documents directory, and the Ami Pro program directory for the 
  22687. specified file. If a full path to the macro is specified, Ami Pro only checks 
  22688. that path. Check the filename and paths for the called macro, and ensure that 
  22689. they are correct. Make changes and recompile the macro. 
  22690.  
  22691.  
  22692.  
  22693. See also: 
  22694.  
  22695.     Determining the Location of a Macro When it is Run 
  22696.  
  22697.  
  22698.  
  22699. ΓòÉΓòÉΓòÉ 572. Error 52 ΓòÉΓòÉΓòÉ
  22700.  
  22701. There is not enough free memory available to run this macro. Close other open 
  22702. windows and try running the macro again. 
  22703.  
  22704.  
  22705. ΓòÉΓòÉΓòÉ 573. Error 53 ΓòÉΓòÉΓòÉ
  22706.  
  22707. There is not enough free memory available to run this macro. Close other open 
  22708. windows and try running the macro again. 
  22709.  
  22710.  
  22711. ΓòÉΓòÉΓòÉ 574. Error 54 ΓòÉΓòÉΓòÉ
  22712.  
  22713. This message indicates that the DDEReceive$ function was not able to execute. 
  22714. This could be because the DDEInitiate function was not used to set up 
  22715. communications, or because the DDEInitiate function failed to communicate with 
  22716. the other OS/2 application. Make sure that you correctly started the DDE 
  22717. conversation, and that the other application is responding before using the 
  22718. DDEReceive$ function. Correct errors and then recompile the macro. 
  22719.  
  22720.  
  22721. See also: 
  22722.  
  22723.     DDEInitiate 
  22724.     DDEReceive$ 
  22725.  
  22726.  
  22727. ΓòÉΓòÉΓòÉ 575. Error 55 ΓòÉΓòÉΓòÉ
  22728.  
  22729. This message indicates that the DDEReceive$ function was able to communicate 
  22730. with the other program, but that no data was received from the application by 
  22731. the DDEReceive$ function. This could be because the other application was not 
  22732. initialized correctly prior to using the DDEReceive$ function. Check the 
  22733. parameters required by the other program, and make sure that the DDE 
  22734. conversation was set up correctly. Correct errors and then recompile the macro. 
  22735.  
  22736.  
  22737. See also: 
  22738.  
  22739.     DDEReceive$ 
  22740.  
  22741.  
  22742.  
  22743.  
  22744. ΓòÉΓòÉΓòÉ 576. Error 56 ΓòÉΓòÉΓòÉ
  22745.  
  22746. This message indicates that the DDEReceive$ function was not formatted using 
  22747. the correct parameters. This could be because the ChannelID was not correct, or 
  22748. because the data requested from the other application was not presented in the 
  22749. format required by the other application. Check the ChannelID and the format 
  22750. required for DDE requests from the other application. Correct errors and then 
  22751. recompile the macro. 
  22752.  
  22753.  
  22754. See also: 
  22755.  
  22756.     DDEReceive$ 
  22757.  
  22758.  
  22759.  
  22760.  
  22761. ΓòÉΓòÉΓòÉ 577. Error 58 ΓòÉΓòÉΓòÉ
  22762.  
  22763. This message indicates that the DDEExecute function was not able to execute 
  22764. because the commands used in the DDEExecute function were not correct for the 
  22765. other application. Check the format required for giving commands to the other 
  22766. application. Correct and then recompile the macro. 
  22767.  
  22768.  
  22769. See also: 
  22770.  
  22771.     DDEExecute 
  22772.  
  22773.  
  22774. ΓòÉΓòÉΓòÉ 578. Error 59 ΓòÉΓòÉΓòÉ
  22775.  
  22776. One of the parameters you used for this function is not correct for the 
  22777. function. Perhaps the function requires a numeric parameter and you used a 
  22778. string instead. Check the required parameters, make corrections, and then 
  22779. recompile and rerun the macro. 
  22780.  
  22781.  
  22782. ΓòÉΓòÉΓòÉ 579. Error 60 ΓòÉΓòÉΓòÉ
  22783.  
  22784. This error message indicates that Ami Pro cannot read the coded instructions to 
  22785. execute the macro stored in the macro file. If this message should appear, you 
  22786. should display the macro file, and save it again to regenerate the internal 
  22787. instructions. If the file saves successfully, and the macro still will not run, 
  22788. call Ami Pro Customer support for further instructions. When calling support, 
  22789. make sure you have the error number displayed, and any other parameters 
  22790. displayed in the error message. 
  22791.  
  22792.  
  22793. ΓòÉΓòÉΓòÉ 580. Error 61 ΓòÉΓòÉΓòÉ
  22794.  
  22795. Internal errors should not appear. They indicate a problem with the way the 
  22796. macro was saved, or with the Ami Pro logic that controls macro execution. If an 
  22797. internal error should appear, you should first display the macro file. Save the 
  22798. file again to make sure that the file has not become damaged. If the file saves 
  22799. successfully and the macro still will not run, call Ami Pro Customer support 
  22800. for further instructions. When calling support, make sure you have the error 
  22801. number displayed and any other parameters displayed in the error message. 
  22802.  
  22803.  
  22804. ΓòÉΓòÉΓòÉ 581. Error 62 ΓòÉΓòÉΓòÉ
  22805.  
  22806. Internal errors should not appear. They indicate a problem with the way the 
  22807. macro was saved, or with the Ami Pro logic that controls macro execution. If an 
  22808. internal error should appear, you should first display the macro file. Save the 
  22809. file again to make sure that the file has not become damaged. If the file saves 
  22810. successfully and the macro still will not run, call Ami Pro Customer support 
  22811. for further instructions. When calling support, make sure you have the error 
  22812. number displayed and any other parameters displayed in the error message. 
  22813.  
  22814.  
  22815. ΓòÉΓòÉΓòÉ 582. Error 63 ΓòÉΓòÉΓòÉ
  22816.  
  22817. Internal errors should not appear. They indicate a problem with the way the 
  22818. macro was saved, or with the Ami Pro logic that controls macro execution. If an 
  22819. internal error should appear, you should first display the macro file. Save the 
  22820. file again to make sure that the file has not become damaged. If the file saves 
  22821. successfully and the macro still will not run, call Ami Pro Customer support 
  22822. for further instructions. When calling support, make sure you have the error 
  22823. number displayed and any other parameters displayed in the error message. 
  22824.  
  22825.  
  22826. ΓòÉΓòÉΓòÉ 583. Error 64 ΓòÉΓòÉΓòÉ
  22827.  
  22828. Internal errors should not appear. They indicate a problem with the way the 
  22829. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22830. an internal error should appear, you should first display the macro file. Save 
  22831. the file again to make sure that the file has not become damaged. If the file 
  22832. saves successfully, and the macro still will not run, call Ami Pro Customer 
  22833. support for further instructions. When calling support, make sure you have the 
  22834. error number displayed and any other parameters displayed in the error message. 
  22835.  
  22836.  
  22837. ΓòÉΓòÉΓòÉ 584. Error 65 ΓòÉΓòÉΓòÉ
  22838.  
  22839. Error 65: Internal error, no function number %s Line %1d 
  22840.  
  22841. Internal errors should not appear. They indicate a problem with the way the 
  22842. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22843. an internal error should appear, you should first display the macro file. Save 
  22844. the file again to make sure that the file has not become damaged. If the file 
  22845. saves successfully, and the macro still will not run, call Ami Pro Customer 
  22846. support for further instructions. When calling support, make sure you have the 
  22847. error number displayed and any other parameters displayed in the error message. 
  22848.  
  22849.  
  22850. ΓòÉΓòÉΓòÉ 585. Error 66 ΓòÉΓòÉΓòÉ
  22851.  
  22852. Internal errors should not appear. They indicate a problem with the way the 
  22853. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22854. an internal error should appear, you should first display the macro file. Save 
  22855. the file again to make sure that the file has not become damaged. If the file 
  22856. saves successfully, and the macro still will not run, call Ami Pro Customer 
  22857. support for further instructions. When calling support, make sure you have the 
  22858. error number displayed and any other parameters displayed in the error message. 
  22859.  
  22860.  
  22861. ΓòÉΓòÉΓòÉ 586. Error 67 ΓòÉΓòÉΓòÉ
  22862.  
  22863. Error 67: Internal error, logop stack 
  22864.  
  22865. Internal errors should not appear. They indicate a problem with the way the 
  22866. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22867. an internal error should appear, first display the macro file and then save it 
  22868. to make sure that the file has not become damaged. If the file saves 
  22869. successfully, and the macro still won't run, call Ami Pro Customer support for 
  22870. further instructions. When calling support, make sure you have the error number 
  22871. displayed and any other parameters displayed in the error message. 
  22872.  
  22873.  
  22874. ΓòÉΓòÉΓòÉ 587. Error 68 ΓòÉΓòÉΓòÉ
  22875.  
  22876. Internal errors should not appear. They indicate a problem with the way the 
  22877. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22878. an internal error should appear, first display the macro file and then save it 
  22879. to make sure that the file has not become damaged. If the file saves 
  22880. successfully, and the macro still won't run, call Ami Pro Customer support for 
  22881. further instructions. When calling support, make sure you have the error number 
  22882. displayed and any other parameters displayed in the error message. 
  22883.  
  22884.  
  22885. ΓòÉΓòÉΓòÉ 588. Error 69 ΓòÉΓòÉΓòÉ
  22886.  
  22887. Error 69: Internal error, mathops stack 
  22888.  
  22889. Internal errors should not appear. They indicate a problem with the way the 
  22890. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22891. an internal error should appear, first display the macro file and then save it 
  22892. to make sure that the file has not become damaged. If the file saves 
  22893. successfully, and the macro still won't run, call Ami Pro Customer support for 
  22894. further instructions. When calling support, make sure you have the error number 
  22895. displayed and any other parameters displayed in the error message. 
  22896.  
  22897.  
  22898. ΓòÉΓòÉΓòÉ 589. Error 70 ΓòÉΓòÉΓòÉ
  22899.  
  22900. Internal errors should not appear. They indicate a problem with the way the 
  22901. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22902. an internal error should appear, first display the macro file and then save it 
  22903. to make sure that the file has not become damaged. If the file saves 
  22904. successfully, and the macro still will not run, call Ami Pro Customer support 
  22905. for further instructions. When calling support, make sure you have the error 
  22906. number displayed and any other parameters displayed in the error message. 
  22907.  
  22908.  
  22909. ΓòÉΓòÉΓòÉ 590. Error 71 ΓòÉΓòÉΓòÉ
  22910.  
  22911. This message appears when a macro is running, and an assignment statement or 
  22912. evaluation of variables attempts to add variables that are not numbers. This 
  22913. most frequently occurs when a variable which has a string value is added to a 
  22914. number. Check to make sure that the variables in the statement evaluate to 
  22915. numbers rather than strings. Remember that an uninitialized variable is equal 
  22916. to the null string (""), rather than zero. You must specifically initialize 
  22917. variables in order to guarantee that they will be treated as numeric. 
  22918.  
  22919. Determine the value of the offending variable and correct its value to ensure 
  22920. it is numeric. Then recompile the macro and run it again. 
  22921.  
  22922.  
  22923. ΓòÉΓòÉΓòÉ 591. Error 72 ΓòÉΓòÉΓòÉ
  22924.  
  22925. This message appears when a macro is running and a division operation attempts 
  22926. to divide by zero. Macro execution stops when this message appears. Determine 
  22927. the variable that is zero at the time of the statement execution. Perhaps you 
  22928. can evaluate this variable before doing the division and allow the user to 
  22929. change it, or skip the division if it is zero. Make corrections, recompile, and 
  22930. then rerun the macro. 
  22931.  
  22932.  
  22933. ΓòÉΓòÉΓòÉ 592. Error 73 ΓòÉΓòÉΓòÉ
  22934.  
  22935. This message appears when a macro is running, and an assignment statement or 
  22936. evaluation of variables attempts to perform binary arithmetic or multiplication 
  22937. and division on variables that are not numbers. This most frequently occurs 
  22938. when a variable that has a string value is divided or multiplied by a number. 
  22939. This message could also appear if a non-integral number was used as an operand 
  22940. in a binary operation. 
  22941.  
  22942. Check to make sure that the variables in the statement evaluate to numbers 
  22943. rather than strings. Remember that an uninitialized variable is equal to the 
  22944. null string (""), rather than zero. You must specifically initialize variables 
  22945. in order to guarantee that they will be treated as numeric. Determine the value 
  22946. of the offending variable and correct its value to ensure it is numeric. Then 
  22947. recompile the macro and run it again. 
  22948.  
  22949.  
  22950. ΓòÉΓòÉΓòÉ 593. Error 74 ΓòÉΓòÉΓòÉ
  22951.  
  22952. Internal errors should not appear. They indicate a problem with the way the 
  22953. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22954. an internal error should appear, first display the macro file and then save it 
  22955. to make sure that the file has not become damaged. If the file saves 
  22956. successfully, and the macro still will not run, call Ami Pro Customer support 
  22957. for further instructions. When calling support, make sure you have the error 
  22958. number displayed and any other parameters displayed in the error message. 
  22959.  
  22960.  
  22961. ΓòÉΓòÉΓòÉ 594. Error 75 ΓòÉΓòÉΓòÉ
  22962.  
  22963. Internal errors should not appear. They indicate a problem with the way the 
  22964. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22965. an internal error should appear, first display the macro file and then save it 
  22966. to make sure that the file has not become damaged. If the file saves 
  22967. successfully, and the macro still will not run, call Ami Pro Customer support 
  22968. for further instructions. When calling support, make sure you have the error 
  22969. number displayed and any other parameters displayed in the error message. 
  22970.  
  22971.  
  22972. ΓòÉΓòÉΓòÉ 595. Error 76 ΓòÉΓòÉΓòÉ
  22973.  
  22974. Internal errors should not appear, and indicate a problem with the way the 
  22975. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22976. an internal error should appear, first display the macro file and then save it 
  22977. to make sure that the file has not become damaged. If the file saves 
  22978. successfully, and the macro still will not run, call Ami Pro Customer support 
  22979. for further instructions. When calling support, make sure you have the error 
  22980. number displayed and any other parameters displayed in the error message. 
  22981.  
  22982.  
  22983. ΓòÉΓòÉΓòÉ 596. Error 77 ΓòÉΓòÉΓòÉ
  22984.  
  22985. Internal errors should not appear, and indicate a problem with the way the 
  22986. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22987. an internal error should appear, first display the macro file and then save it 
  22988. to make sure that the file has not become damaged. If the file saves 
  22989. successfully, and the macro still will not run, call Ami Pro Customer support 
  22990. for further instructions. When calling support, make sure you have the error 
  22991. number displayed and any other parameters displayed in the error message. 
  22992.  
  22993.  
  22994. ΓòÉΓòÉΓòÉ 597. Error 78 ΓòÉΓòÉΓòÉ
  22995.  
  22996. Internal errors should not appear, and indicate a problem with the way the 
  22997. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  22998. an internal error should appear, first display the macro file and then save it 
  22999. to make sure that the file has not become damaged. If the file saves 
  23000. successfully, and the macro still will not run, call Ami Pro Customer support 
  23001. for further instructions. When calling support, make sure you have the error 
  23002. number displayed and any other parameters displayed in the error message. 
  23003.  
  23004.  
  23005. ΓòÉΓòÉΓòÉ 598. Error 79 ΓòÉΓòÉΓòÉ
  23006.  
  23007. Internal errors should not appear. They indicate a problem with the way the 
  23008. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  23009. an internal error should appear, first display the macro file and then save it 
  23010. to make sure that the file has not become damaged. If the file saves 
  23011. successfully, and the macro still will not run, call Ami Pro Customer support 
  23012. for further instructions. When calling support, make sure you have the error 
  23013. number displayed and any other parameters displayed in the error message. 
  23014.  
  23015.  
  23016. ΓòÉΓòÉΓòÉ 599. Error 80 ΓòÉΓòÉΓòÉ
  23017.  
  23018. The index value of an array is larger than the number of elements assigned to 
  23019. it using the DIM statement. This can occur when a FOR/NEXT loop or WHILE/WEND 
  23020. loop is used to increment the value of an array index and the element limit in 
  23021. the DIM statement is exceeded. Macro execution stops when this occurs. 
  23022. Determine the statement that is causing the index to grow too large, correct 
  23023. the problem or dimension the array with more elements, and then recompile and 
  23024. rerun the macro. 
  23025.  
  23026.  
  23027. See also: 
  23028.  
  23029.     Declaring Formal Variables Using the DIM Statement 
  23030.     Using the FOR Statement 
  23031.     Using the WHILE Statement 
  23032.  
  23033.  
  23034. ΓòÉΓòÉΓòÉ 600. Error 81 ΓòÉΓòÉΓòÉ
  23035.  
  23036. This error message will occur if an Ami Pro function is called at an 
  23037. inappropriate time. An example of this would be to display the tab ruler in 
  23038. draft mode, or to create a frame in draft mode. 
  23039.  
  23040. When this error appears, macro execution is canceled. Determine the Ami Pro 
  23041. function that could not be executed. Perhaps you can use other Ami Pro commands 
  23042. to guarantee that the program is in the correct operating mode to let the 
  23043. function run correctly, or you could jump over the function if the program is 
  23044. not in the correct mode. Correct the problem, recompile the macro, and then run 
  23045. it again. 
  23046.  
  23047.  
  23048. ΓòÉΓòÉΓòÉ 601. Error 82 ΓòÉΓòÉΓòÉ
  23049.  
  23050. This message appears when a macro is running, and an ONERROR or ONCANCEL 
  23051. statement is found in a macro that is called by another macro. This message is 
  23052. an internal error and should not occur. If this message displays, call Ami Pro 
  23053. customer support. 
  23054.  
  23055.  
  23056. See also: 
  23057.  
  23058.     Using the ONERROR Statement 
  23059.     Using the ONCANCEL Statement 
  23060.  
  23061.  
  23062. ΓòÉΓòÉΓòÉ 602. Error 83 ΓòÉΓòÉΓòÉ
  23063.  
  23064. The macro used a CALL statement to call another macro, but the called macro was 
  23065. not in the 'main' macro file or the file referenced in the CALL statement. Any 
  23066. called macros must either be in the macro file executed by the user, or must 
  23067. have filenames supplied with the macro so they can be found. Make sure the 
  23068. macro name is spelled correctly and that its location is identified. Correct 
  23069. errors and then recompile the macro. 
  23070.  
  23071.  
  23072. See also: 
  23073.  
  23074.     Using the CALL and CALLI Statements 
  23075.  
  23076.  
  23077. ΓòÉΓòÉΓòÉ 603. Error 84 ΓòÉΓòÉΓòÉ
  23078.  
  23079. There is not enough free memory available to run this macro. Close other open 
  23080. windows to reduce memory and try running the macro again. 
  23081.  
  23082.  
  23083. ΓòÉΓòÉΓòÉ 604. Error 86 ΓòÉΓòÉΓòÉ
  23084.  
  23085. The macro was unable to create the menu you requested. This could be because 
  23086. you used an invalid bar ID or because there was already a menu with the name 
  23087. you requested. Check the AddMenu statements in the macro. Correct errors and 
  23088. then recompile the macro. 
  23089.  
  23090.  
  23091. See also: 
  23092.  
  23093.     AddMenu 
  23094.  
  23095.  
  23096. ΓòÉΓòÉΓòÉ 605. Error 87 ΓòÉΓòÉΓòÉ
  23097.  
  23098. No more menus could be added because the maximum number of menus on the menu 
  23099. bar had been reached. You will need to rewrite the macro to include fewer 
  23100. menus, or use a different menu bar. Make corrections and then recompile the 
  23101. macro. 
  23102.  
  23103.  
  23104. ΓòÉΓòÉΓòÉ 606. Error 89 ΓòÉΓòÉΓòÉ
  23105.  
  23106. The menu function you wanted could not be completed because of an error 
  23107. communicating with OS/2. Try closing other applications you may have open. If 
  23108. you continue to have problems, call Ami Pro customer support. 
  23109.  
  23110.  
  23111. ΓòÉΓòÉΓòÉ 607. Error 90 ΓòÉΓòÉΓòÉ
  23112.  
  23113. The macro was unable to create the menu item you requested. This could be 
  23114. because you used an invalid bar ID or menu ID, or because there was already a 
  23115. menu item with the name you requested. Check the AddMenu and AddMenuItem 
  23116. statements in the macro. Correct errors and then recompile the macro. 
  23117.  
  23118.  
  23119. See also: 
  23120.  
  23121.     AddMenu 
  23122.     AddMenuItem 
  23123.  
  23124.  
  23125. ΓòÉΓòÉΓòÉ 608. Error 91 ΓòÉΓòÉΓòÉ
  23126.  
  23127. No more menu items could be added to the menu because the maximum had already 
  23128. been reached. You will need to rewrite the macro to include more menus or fewer 
  23129. items. Correct errors and then recompile the macro. 
  23130.  
  23131.  
  23132. ΓòÉΓòÉΓòÉ 609. Error 92 ΓòÉΓòÉΓòÉ
  23133.  
  23134. There is not enough free memory available to run this macro. Close other open 
  23135. windows to reduce memory, and try running the macro again. 
  23136.  
  23137.  
  23138. ΓòÉΓòÉΓòÉ 610. Error 93 ΓòÉΓòÉΓòÉ
  23139.  
  23140. Internal errors should not appear. They indicate a problem with the way the 
  23141. macro was saved, or with the Ami Pro logic that controls macro execution. If an 
  23142. internal error should appear, first display the macro file and then save it to 
  23143. make sure that the file has not become damaged. If the file saves successfully, 
  23144. and the macro still will not run, call Ami Pro Customer support for further 
  23145. instructions. When calling support, make sure you have the error number 
  23146. displayed and any other parameters displayed in the error message. 
  23147.  
  23148.  
  23149. ΓòÉΓòÉΓòÉ 611. Error 94 ΓòÉΓòÉΓòÉ
  23150.  
  23151. Error 94: Internal Error, symbol number 
  23152.  
  23153. Internal errors should not appear. They indicate a problem with the way the 
  23154. macro was saved, or with the Ami Pro logic that controls macro execution. If an 
  23155. internal error should appear, first display the macro file and then save it to 
  23156. make sure that the file has not become damaged. If the file saves successfully, 
  23157. and the macro still will not run, call Ami Pro Customer support for further 
  23158. instructions. When calling support, make sure you have the error number 
  23159. displayed and any other parameters displayed in the error message. 
  23160.  
  23161.  
  23162. ΓòÉΓòÉΓòÉ 612. Error 95 ΓòÉΓòÉΓòÉ
  23163.  
  23164. Internal errors should not appear. They indicate a problem with the way the 
  23165. macro was saved, or with the Ami Pro logic that controls macro execution. If an 
  23166. internal error should appear, first display the macro file and then save it to 
  23167. make sure that the file has not become damaged. If the file saves successfully, 
  23168. and the macro still will not run, call Ami Pro Customer support for further 
  23169. instructions. When calling support, make sure you have the error number 
  23170. displayed and any other parameters displayed in the error message. 
  23171.  
  23172.  
  23173. ΓòÉΓòÉΓòÉ 613. Error 96 ΓòÉΓòÉΓòÉ
  23174.  
  23175. Internal errors should not appear. They indicate a problem with the way the 
  23176. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  23177. an internal error should appear, first display the macro file and then save it 
  23178. to make sure that the file has not become damaged. If the file saves 
  23179. successfully, and the macro still will not run, call Ami Pro Customer support 
  23180. for further instructions. When calling support, make sure you have the error 
  23181. number displayed and any other parameters displayed in the error message. 
  23182.  
  23183.  
  23184. ΓòÉΓòÉΓòÉ 614. Error 97 ΓòÉΓòÉΓòÉ
  23185.  
  23186. Internal errors should not appear. They indicate a problem with the way the 
  23187. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  23188. an internal error should appear, first display the macro file and then save it 
  23189. to make sure that the file has not become damaged. If the file saves 
  23190. successfully, and the macro still will not run, call Ami Pro Customer support 
  23191. for further instructions. When calling support, make sure you have the error 
  23192. number displayed and any other parameters displayed in the error message. 
  23193.  
  23194.  
  23195. ΓòÉΓòÉΓòÉ 615. Error 98 ΓòÉΓòÉΓòÉ
  23196.  
  23197. Error 98: Internal Error, grow strings 
  23198.  
  23199. Internal errors should not appear. They indicate a problem with the way the 
  23200. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  23201. an internal error should appear, first display the macro file and then save it 
  23202. to make sure that the file has not become damaged. If the file saves 
  23203. successfully, and the macro still will not run, call Ami Pro Customer support 
  23204. for further instructions. When calling support, make sure you have the error 
  23205. number displayed and any other parameters displayed in the error message. 
  23206.  
  23207.  
  23208. ΓòÉΓòÉΓòÉ 616. Error 99 ΓòÉΓòÉΓòÉ
  23209.  
  23210. Internal errors should not appear. They indicate a problem with the way the 
  23211. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  23212. an internal error should appear, first display the macro file and then save it 
  23213. to make sure that the file has not become damaged. If the file saves 
  23214. successfully, and the macro still will not run, call Ami Pro Customer support 
  23215. for further instructions. When calling support, make sure you have the error 
  23216. number displayed and any other parameters displayed in the error message. 
  23217.  
  23218.  
  23219. ΓòÉΓòÉΓòÉ 617. Error 100 ΓòÉΓòÉΓòÉ
  23220.  
  23221. Internal errors should not appear. They indicate a problem with the way the 
  23222. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  23223. an internal error should appear, first display the macro file then save it to 
  23224. make sure that the file has not become damaged. If the file saves successfully, 
  23225. and the macro still will not run, call Ami Pro Customer support for further 
  23226. instructions. When calling support, make sure you have the error number 
  23227. displayed and any other parameters displayed in the error message. 
  23228.  
  23229.  
  23230. ΓòÉΓòÉΓòÉ 618. Error 101 ΓòÉΓòÉΓòÉ
  23231.  
  23232. Error 101: Internal Error, string frame 
  23233.  
  23234. Internal errors should not appear. They indicate a problem with the way the 
  23235. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  23236. an internal error should appear, first display the macro file then save it to 
  23237. make sure that the file has not become damaged. If the file saves successfully, 
  23238. and the macro still will not run, call Ami Pro Customer support for further 
  23239. instructions. When calling support, make sure you have the error number 
  23240. displayed and any other parameters displayed in the error message. 
  23241.  
  23242.  
  23243. ΓòÉΓòÉΓòÉ 619. Error 102 ΓòÉΓòÉΓòÉ
  23244.  
  23245. Internal errors should not appear. They indicate a problem with the way the 
  23246. macro was saved, or with the Ami Pro logic which controls macro execution. If 
  23247. an internal error should appear, first display the macro file then save it to 
  23248. make sure that the file has not become damaged. If the file saves successfully, 
  23249. and the macro still will not run, call Ami Pro Customer support for further 
  23250. instructions. When calling support, make sure you have the error number 
  23251. displayed and any other parameters displayed in the error message. 
  23252.  
  23253.  
  23254. ΓòÉΓòÉΓòÉ 620. Error 103 ΓòÉΓòÉΓòÉ
  23255.  
  23256. The index value of a global array is larger than the number of elements 
  23257. assigned to it using the AllocGlobalVar function. This can occur when a 
  23258. FOR/NEXT loop or WHILE/WEND loop is used to increment the value of an array 
  23259. index, and the limit set in the AllocGlobalVar function is exceeded. Macro 
  23260. execution stops when this occurs. Determine the statement thet is causing the 
  23261. index to grow too large or increase the size of the array in the AllocGlobalVar 
  23262. function. Correct errors and then recompile and rerun the macro. 
  23263.  
  23264.  
  23265. See also: 
  23266.  
  23267.     AllocGlobalVar 
  23268.     Using the FOR Statement 
  23269.     Using the WHILE Statement 
  23270.  
  23271.  
  23272. ΓòÉΓòÉΓòÉ 621. Error 104 ΓòÉΓòÉΓòÉ
  23273.  
  23274. There is not enough free memory available to run this macro. Close other open 
  23275. windows to reduce memory and try running the macro again. 
  23276.  
  23277.  
  23278. ΓòÉΓòÉΓòÉ 622. Error 105 ΓòÉΓòÉΓòÉ
  23279.  
  23280. The global variable ID you used has not been defined. Each global variable is 
  23281. assigned an ID when it is created, and this ID must be used when that variable 
  23282. is accessed. Check the ID to make sure it is valid. Correct errors and then 
  23283. recompile and rerun the macro. 
  23284.  
  23285.  
  23286. ΓòÉΓòÉΓòÉ 623. Error 106 ΓòÉΓòÉΓòÉ
  23287.  
  23288. One of the parameters you used for this function is not correct for the 
  23289. function. Perhaps the function requires a numeric parameter and you used a 
  23290. string instead. Check the required parameters. Correct errors and then 
  23291. recompile and rerun the macro. 
  23292.  
  23293.  
  23294. ΓòÉΓòÉΓòÉ 624. Error 107 ΓòÉΓòÉΓòÉ
  23295.  
  23296. There is not enough free memory available to run this macro. Close other open 
  23297. windows to reduce memory and try running the macro again. 
  23298.  
  23299.  
  23300. ΓòÉΓòÉΓòÉ 625. Error 108 ΓòÉΓòÉΓòÉ
  23301.  
  23302. The macro you want to edit or run is not an Ami Pro macro file. If it is a 
  23303. document file, it should have the extension .SAM. If it is a macro file, it 
  23304. should have the extension .SMM. Make sure the contents of the file are correct. 
  23305.  
  23306.  
  23307. ΓòÉΓòÉΓòÉ 626. Error 109 ΓòÉΓòÉΓòÉ
  23308.  
  23309. The line following an END FUNCTION statement does not have a FUNCTION 
  23310. statement, or you have used a FUNCTION statement without having ended the 
  23311. previous function with an END FUNCTION statement. Check the macro, make 
  23312. corrections, and then recompile. 
  23313.  
  23314.  
  23315. See also: 
  23316.  
  23317.     Using the END Function Statement 
  23318.     Using the FUNCTION Statement 
  23319.  
  23320.  
  23321. ΓòÉΓòÉΓòÉ 627. Error 110 ΓòÉΓòÉΓòÉ
  23322.  
  23323. The offset you provided for a MID$ or strchr function argument is 0. The 
  23324. minimum possible offset is 1, which will begin the search with the first 
  23325. character in the string. Change the argument and then recompile the macro. 
  23326.  
  23327.  
  23328. See also: 
  23329.  
  23330.     MID$ 
  23331.     strchr 
  23332.  
  23333.  
  23334. ΓòÉΓòÉΓòÉ 628. Error 111 ΓòÉΓòÉΓòÉ
  23335.  
  23336. The location of the THEN statement is not correct. The THEN statement must 
  23337. follow the condition specified in the IF statement. Check the function, make 
  23338. corrections, and then recompile the macro. 
  23339.  
  23340.  
  23341. See also: 
  23342.  
  23343.     Using the IF/THEN Statements 
  23344.  
  23345.  
  23346. ΓòÉΓòÉΓòÉ 629. Error 112 ΓòÉΓòÉΓòÉ
  23347.  
  23348. One of the functions you are translating from a Record/Play macro to an 
  23349. editable macro did not translate. Some Ami Pro functions can be recorded and 
  23350. played back, but cannot be edited. You can recognize these functions in the 
  23351. editable macro because they will appear as a series of numbers that are 
  23352. commented out of the macro. If you want to keep the original macro as it was, 
  23353. do not save the edited version. 
  23354.  
  23355.  
  23356. ΓòÉΓòÉΓòÉ 630. Error 113 ΓòÉΓòÉΓòÉ
  23357.  
  23358. You used the specified item as an argument to a macro function or to another 
  23359. macro. The item is not a valid variable name or definition substitution, and 
  23360. cannot be passed to a function. Check the spelling of the variable name or 
  23361. definition, recompile the macro, and try again. 
  23362.  
  23363.  
  23364. ΓòÉΓòÉΓòÉ 631. Error 114 ΓòÉΓòÉΓòÉ
  23365.  
  23366. You used a function name in your macro that is not a valid macro function or 
  23367. user defined function. Check the spelling of the built-in function, or make 
  23368. sure you have correctly declared your user-defined function. Recompile the 
  23369. macro and try again. 
  23370.  
  23371.  
  23372. ΓòÉΓòÉΓòÉ 632. Error 115 ΓòÉΓòÉΓòÉ
  23373.  
  23374. Ami Pro was unable to access memory needed for the macro. Try running the macro 
  23375. again; if it fails, then redisplay the macro, resave and run it again. If the 
  23376. problem continues call Ami Pro Customer Support. 
  23377.  
  23378.  
  23379. ΓòÉΓòÉΓòÉ 633. Error 116 ΓòÉΓòÉΓòÉ
  23380.  
  23381. A string variable for the macro has been corrupted. Check string manipulations 
  23382. for errors. 
  23383.  
  23384.  
  23385. ΓòÉΓòÉΓòÉ 634. Error 117 ΓòÉΓòÉΓòÉ
  23386.  
  23387. Unable to obtain value of the variable due to unknown type. Converting to code: 
  23388. 2 - Integer 
  23389. 3 - Floating point 
  23390. 4 - %s 
  23391.  
  23392.  
  23393. ΓòÉΓòÉΓòÉ 635. Error 118 ΓòÉΓòÉΓòÉ
  23394.  
  23395. Unable to assign value to a macro variable due to a type mismatch. Converting 
  23396. to code: 
  23397. 2 - Integer 
  23398. 3 - Floating point 
  23399. 4 - %s 
  23400.  
  23401.  
  23402. ΓòÉΓòÉΓòÉ 636. Error 119 ΓòÉΓòÉΓòÉ
  23403.  
  23404. Ami Pro was unable to obtain enough memory to store a macro variable. Trying 
  23405. closing one or more of the other OS/2 applications and running the application 
  23406. again. Also check AllocGlobalVar calls to be sure they are requesting 
  23407. reasonable amounts of memory. 
  23408.  
  23409.  
  23410. ΓòÉΓòÉΓòÉ 637. Error 120 ΓòÉΓòÉΓòÉ
  23411.  
  23412. The variable passed to a macro function could not be converted to the correct 
  23413. format for use. 
  23414.  
  23415.  
  23416. ΓòÉΓòÉΓòÉ 638. Error 121 ΓòÉΓòÉΓòÉ
  23417.  
  23418. Internal error: Ami Pro could not access previously stored data. Call Ami Pro 
  23419. Customer Support. 
  23420.  
  23421.  
  23422. ΓòÉΓòÉΓòÉ 639. Error 122 ΓòÉΓòÉΓòÉ
  23423.  
  23424. Unable to determine the type of variable being substituted. 
  23425.  
  23426.  
  23427. ΓòÉΓòÉΓòÉ 640. Error 124 ΓòÉΓòÉΓòÉ
  23428.  
  23429. Power field is missing correct termination. 
  23430.  
  23431.  
  23432. ΓòÉΓòÉΓòÉ 641. Error 125 ΓòÉΓòÉΓòÉ
  23433.  
  23434. Macro attempted to reference a non-existent field. 
  23435.  
  23436.  
  23437. ΓòÉΓòÉΓòÉ 642. Error 126 ΓòÉΓòÉΓòÉ
  23438.  
  23439. The string was not correctly ended. 
  23440.  
  23441.  
  23442. ΓòÉΓòÉΓòÉ 643. Error 127 ΓòÉΓòÉΓòÉ
  23443.  
  23444. Check to be sure the Call statement is not using a standard macro function 
  23445. name, and that the MacroName in the Call statement is an existing Ami Pro 
  23446. macro. See the Call statement documentation for information on syntax. 
  23447.  
  23448.  
  23449. See also: 
  23450.  
  23451.     Using the Call and CALLI Statements 
  23452.  
  23453.  
  23454. ΓòÉΓòÉΓòÉ 644. Error 129 ΓòÉΓòÉΓòÉ
  23455.  
  23456. The Style field of the FormatDate function call is invalid. Check to be sure 
  23457. that it is one of the values listed in the FormatDate  function documentation. 
  23458.  
  23459.  
  23460. See also: 
  23461.  
  23462.     FormatDate 
  23463.  
  23464.  
  23465. ΓòÉΓòÉΓòÉ 645. Error 130 ΓòÉΓòÉΓòÉ
  23466.  
  23467. Ami Pro was unable to execute the program. Be sure that the application exists 
  23468. on your path. 
  23469.  
  23470.  
  23471. ΓòÉΓòÉΓòÉ 646. Error 131 ΓòÉΓòÉΓòÉ
  23472.  
  23473. The variable used is a direct variable. Ami Pro needs an indirect variable that 
  23474. points to the intended variable. Trying placing an ampersand (&) in front of 
  23475. the variable and resaving the macro. 
  23476.  
  23477.  
  23478. ΓòÉΓòÉΓòÉ 647. Error 132 ΓòÉΓòÉΓòÉ
  23479.  
  23480. An array variable is needed to run this function. 
  23481.  
  23482.  
  23483. ΓòÉΓòÉΓòÉ 648. Error 133 ΓòÉΓòÉΓòÉ
  23484.  
  23485. Check the function documentation for the correct number of parameters required 
  23486. for the function. 
  23487.  
  23488.  
  23489. ΓòÉΓòÉΓòÉ 649. Error 134 ΓòÉΓòÉΓòÉ
  23490.  
  23491. Use the pause function for only one macro at a time. 
  23492.  
  23493.  
  23494. ΓòÉΓòÉΓòÉ 650. Error 135 ΓòÉΓòÉΓòÉ
  23495.  
  23496. The format of the dialog box is not correct. See the DialogBox Call information 
  23497. in the macro documentation for format information. 
  23498.  
  23499.  
  23500. See also: 
  23501.  
  23502.     DialogBox 
  23503.  
  23504.  
  23505. ΓòÉΓòÉΓòÉ 651. Error 136 ΓòÉΓòÉΓòÉ
  23506.  
  23507. DIALOG is reserved for use in an Ami Pro macro. Change the name of the variable 
  23508. to correct the problem. 
  23509.  
  23510. If you copied the dialog box into an Ami Pro macro, the formatting information 
  23511. for the dialog box must be contained between the DIALOG and END DIALOG 
  23512. statements. 
  23513.  
  23514.  
  23515. See also: 
  23516.  
  23517.     DialogBox 
  23518.  
  23519.  
  23520.  
  23521.  
  23522. ΓòÉΓòÉΓòÉ 652. Error 137 ΓòÉΓòÉΓòÉ
  23523.  
  23524. END DIALOG is reserved for use in an Ami Pro macro. Change the name of the 
  23525. variable to correct the problem. 
  23526.  
  23527. If you copied the dialog box into an Ami Pro macro, the formatting information 
  23528. for the dialog box must be contained between the DIALOG and END DIALOG 
  23529. statements. 
  23530.  
  23531.  
  23532. See also: 
  23533.  
  23534.     DialogBox 
  23535.  
  23536.  
  23537. ΓòÉΓòÉΓòÉ 653. Error 138 ΓòÉΓòÉΓòÉ
  23538.  
  23539. The ampersand character (&) is used illegally. Try deleting it and use the 
  23540. remaining variable name. See the Variables section for further information. 
  23541.  
  23542.  
  23543. See also: 
  23544.  
  23545.     Using Variables 
  23546.  
  23547.  
  23548. ΓòÉΓòÉΓòÉ 654. Error 139 ΓòÉΓòÉΓòÉ
  23549.  
  23550. The alias created in the DECLARE section for referencing another macro is not 
  23551. acceptable. See the DECLARE section for further information. 
  23552.  
  23553.  
  23554. See also: 
  23555.  
  23556.     Using the DECLARE Statement 
  23557.  
  23558.  
  23559. ΓòÉΓòÉΓòÉ 655. Error 140 ΓòÉΓòÉΓòÉ
  23560.  
  23561. Not Correct parameter or number of parameters in function call. 
  23562.  
  23563.  
  23564. ΓòÉΓòÉΓòÉ 656. Error 142 ΓòÉΓòÉΓòÉ
  23565.  
  23566. Name is a reserved word and can not be used in a DEFINE statement. Check the 
  23567. DEFINE statements and be sure they each have two parameters and contain no 
  23568. reserved words. 
  23569.  
  23570.  
  23571. See also: 
  23572.  
  23573.     Defining Constants 
  23574.  
  23575.  
  23576. ΓòÉΓòÉΓòÉ 657. Error 143 ΓòÉΓòÉΓòÉ
  23577.  
  23578. The DEFINE statement includes an open parenthesis and expects a matching 
  23579. closing parenthesis. 
  23580.  
  23581.  
  23582. See also: 
  23583.  
  23584.     Defining Constants 
  23585.  
  23586.  
  23587. ΓòÉΓòÉΓòÉ 658. Error 144 ΓòÉΓòÉΓòÉ
  23588.  
  23589. DEFINE statement syntax is not correct. Check the macro documentation for 
  23590. further information on Defining Constants. 
  23591.  
  23592.  
  23593. See also: 
  23594.  
  23595.     Defining Constants 
  23596.  
  23597.  
  23598. ΓòÉΓòÉΓòÉ 659. Error 145 ΓòÉΓòÉΓòÉ
  23599.  
  23600. The replacement string, including inserted parameters must be less than 500 
  23601. characters. 
  23602.  
  23603.  
  23604. See also: 
  23605.  
  23606.     Defining Constants 
  23607.  
  23608.  
  23609. ΓòÉΓòÉΓòÉ 660. Error 146 ΓòÉΓòÉΓòÉ
  23610.  
  23611. The variable name is defined more than once. 
  23612.  
  23613.  
  23614. See also: 
  23615.  
  23616.     Defining Constants 
  23617.     Using Variables 
  23618.  
  23619.  
  23620. ΓòÉΓòÉΓòÉ 661. Error 147 ΓòÉΓòÉΓòÉ
  23621.  
  23622. Macro lines must be less than 255 characters in length. 
  23623.  
  23624.  
  23625. ΓòÉΓòÉΓòÉ 662. Error 149 ΓòÉΓòÉΓòÉ
  23626.  
  23627. Expected closing parenthesis in DEFINE statement. 
  23628.  
  23629.  
  23630. See also: 
  23631.  
  23632.     Defining Constants 
  23633.  
  23634.  
  23635. ΓòÉΓòÉΓòÉ 663. Error 150 ΓòÉΓòÉΓòÉ
  23636.  
  23637. The DLL referenced in a DLLCall function was not previously loaded, or the load 
  23638. was unsuccessful. 
  23639.  
  23640.  
  23641. See also: 
  23642.  
  23643.      DLLCall 
  23644.  
  23645.  
  23646. ΓòÉΓòÉΓòÉ 664. Error 151 ΓòÉΓòÉΓòÉ
  23647.  
  23648. The macro was unable to load the DLL. Check to be sure that either the DLL is 
  23649. in the OS/2 directory or that a full path is used to reference it. 
  23650.  
  23651.  
  23652. ΓòÉΓòÉΓòÉ 665. Error 152 ΓòÉΓòÉΓòÉ
  23653.  
  23654. Ami Pro could not open the macro control file, MACTOKEN.SAM. Check to be sure 
  23655. that it exists and that it resides in the Ami Pro directory. 
  23656.  
  23657.  
  23658. ΓòÉΓòÉΓòÉ 666. Error 153 ΓòÉΓòÉΓòÉ
  23659.  
  23660. Some functions require indirect variables to return results. This error occurs 
  23661. when an indirect variable is not passed. 
  23662.  
  23663.  
  23664. See also: 
  23665.  
  23666.     Using Variables 
  23667.  
  23668.  
  23669. ΓòÉΓòÉΓòÉ 667. Error 163 ΓòÉΓòÉΓòÉ
  23670.  
  23671. You tried to run a macro written in another version of Ami Pro.  The macro 
  23672. contains a function that is not supported in this version of Ami Pro. Edit the 
  23673. macro to contain only functions supported in this version of Ami Pro. 
  23674.  
  23675.  
  23676. See also: 
  23677.  
  23678.     Ami Pro Macro Language Contents 
  23679.  
  23680.  
  23681.  
  23682. ΓòÉΓòÉΓòÉ 668. Ami Pro Macro Language Contents ΓòÉΓòÉΓòÉ
  23683.  
  23684. Overview of the Ami Pro Macro Language 
  23685. Ami Pro Macro Functions Grouped Alphabetically 
  23686. Ami Pro Macro Functions Grouped by Category 
  23687. Ami Pro Macro Functions Grouped by Menu 
  23688. Debugging Macros 
  23689. Macro Error Messages 
  23690.  
  23691.  
  23692.  
  23693.  
  23694.  
  23695. ΓòÉΓòÉΓòÉ 669. Overview of the Ami Pro Macro Language ΓòÉΓòÉΓòÉ
  23696.  
  23697. Introducing the Ami Pro Macro Language 
  23698. This section describes how to use the macro language. It also describes the 
  23699. macro documentation conventions. 
  23700.  
  23701. Creating, Saving, and Formatting an Ami Pro Macro 
  23702. This section describes how to create, save, and edit a macro. It also describes 
  23703. how to format a macro for ease of reading. 
  23704.  
  23705. Using Macro Programming Statements 
  23706. This section describes the difference between macro programming statements and 
  23707. macro functions. It also describes the syntax for each statement. Each macro 
  23708. must contain at least two programming statements, FUNCTION and END FUNCTION, 
  23709. and one macro function. 
  23710.  
  23711. Using Variables 
  23712. This section describes variables, strings, and the DEFSTR and DIM statements. 
  23713. It also describes the global variables and the lifetime and visibility of a 
  23714. variable. 
  23715.  
  23716. Using Numbers, Strings, and Operators 
  23717. This section describes the precedence of operators and how to use the various 
  23718. operator types. 
  23719.  
  23720. Using Constants 
  23721. This section describes defined and predefined constants. 
  23722.  
  23723. Calling Built-In Functions and Other Macros 
  23724. This section describes calling built-in functions and Ami Pro functions. It 
  23725. also describes how to determine the location of a macro and using the return 
  23726. value from called macros. 
  23727.  
  23728. Integrating REXX Commands 
  23729. This section describes REXX command files and how to integrate REXX commands 
  23730. with Ami Pro. 
  23731.  
  23732. Transferring Program Control 
  23733. This section describes how to transfer control of a macro to another function 
  23734. or statement. 
  23735.  
  23736. Using Results of Evaluations to Control a Macro 
  23737. This section describes how to use the results of an evaluation to control a 
  23738. macro. 
  23739.  
  23740. Using the Lotus Dialog Editor 
  23741. This section describes the Lotus Dialog Editor. 
  23742.  
  23743. Using Macro Functions 
  23744. This section lists each macro function. Each macro contains at least one 
  23745. function. A macro function must begin with a FUNCTION statement and end with an 
  23746. END FUNCTION statement. You can have several macro functions within one macro 
  23747. file. 
  23748.     Ami Pro Macro Functions Grouped Alphabetically 
  23749.     Ami Pro Macro Functions Grouped by Category 
  23750.     Ami Pro Macro Functions Grouped by Menu 
  23751.  
  23752. Debugging Macros 
  23753. This section describes error messages that can appear when compiling or running 
  23754. macros. It also discusses some of the techniques you can use to determine the 
  23755. cause of the errors, and how you can test your macros to make sure they do what 
  23756. you want them to. 
  23757.  
  23758. Macro Error Messages 
  23759. This section lists each of the error messages that could appear during macro 
  23760. compilation and execution, along with suggestions for determining the cause of 
  23761. the problem and how to fix the problem. It does not cover the regular Ami Pro 
  23762. or OS/2 error messages. 
  23763.  
  23764. See also: 
  23765.  
  23766.     Ami Pro Macro Language Contents 
  23767.  
  23768.  
  23769. ΓòÉΓòÉΓòÉ 670. Introducing the Ami Pro Macro Language ΓòÉΓòÉΓòÉ
  23770.  
  23771. This online Help file documents the Ami Pro Macro Language. You can use this 
  23772. documentation to create your own macros and to customize Record and Play 
  23773. macros. 
  23774.  
  23775.  
  23776. You do not need this documentation to use the macro Record and Play functions. 
  23777. Record and Play functions use the same macro functions described here, but 
  23778. automatically access these functions. 
  23779.  
  23780. The Ami Pro Macro Language is similar to BASIC. If you are not a computer 
  23781. programmer and have not written many macros, you may have difficulty with some 
  23782. of the information presented in this documentation. You should start with 
  23783. simple macros, skipping sections that you do not understand. If you are an 
  23784. experienced computer programmer and have written macros for other programs, use 
  23785. this documentation to become proficient quickly in the Ami Pro macro language. 
  23786.  
  23787. Along with the macro functions you automatically access when using power 
  23788. fields, you can use many other macro functions in power fields. These power 
  23789. fields macro functions use the same parameters listed in this documentation. 
  23790.  
  23791. See also: 
  23792.  
  23793.     Ami Pro Macro Language Contents 
  23794.     Overview of the Ami Pro Macro Language 
  23795.     Understanding Macro Documentation Conventions 
  23796.  
  23797.  
  23798. ΓòÉΓòÉΓòÉ 671. Understanding Macro Documentation Conventions ΓòÉΓòÉΓòÉ
  23799.  
  23800. This documentation presents macro statements and functions syntax in a 
  23801. consistent manner. This should help you understand how to use each statement or 
  23802. function. The statements and functions use the following format: 
  23803.  
  23804.  
  23805. Syntax 
  23806. Function(parm1[ parm2[ parm3...]], 0) 
  23807. Parm1 is a required parameter. 
  23808. Parm2 is an optional parameter. 
  23809. Parm3 is an optional parameter. 
  23810. 0 parameters are required to maintain compatibility with other versions of Ami 
  23811. Pro. 
  23812.  
  23813. In this sample function, the function name is first, followed by parameters, if 
  23814. any, for the function. When you use the function in a macro, you replace the 
  23815. parameter names with values you provide. 
  23816.  
  23817. Parameters that are surrounded by square braces ([ ]) are optional unless 
  23818. otherwise stated. If you use an optional parameter or group of parameters, you 
  23819. must include all the information shown in the square braces (do not type the 
  23820. square braces). In this example, Parm2 and Parm3 are both optional. 
  23821.  
  23822. Parm3 is optional when using Parm2. Parm2 encloses Parm3 within its own set of 
  23823. square braces. You cannot use Parm3 unless you use Parm2. You do not have to 
  23824. use Parm3 if you use Parm2. 
  23825.  
  23826. The three dots following Parm3 show that you can repeat it if needed. If you 
  23827. can repeat a parameter or portion of a function, the documentation follows the 
  23828. parameter with three dots. If you repeat a parameter, you must repeat all of 
  23829. the function that is within the square braces. 
  23830.  
  23831. Most functions and statements use examples to illustrate how to use the 
  23832. function in a macro. This documentation shows example macros in the following 
  23833. style: 
  23834.  
  23835. Example 
  23836. FUNCTION test() 
  23837. TYPE ("This is a test.[ENTER]") 
  23838. END FUNCTION 
  23839.  
  23840. Look at the examples for some macro ideas. Most of the example macros 
  23841. illustrate more than one function or programming concept. Many of the examples 
  23842. are functional and may perform functions that you can use. If you want to use 
  23843. an example macro, copy the example to the Clipboard, paste it in an untitled 
  23844. Ami Pro document, and save it as a macro. Note that this works best if you 
  23845. maximize the Help window before you copy the example. 
  23846.  
  23847. See also: 
  23848.  
  23849.     Ami Pro Macro Language Contents 
  23850.     Overview of the Ami Pro Macro Language 
  23851.     Creating, Saving, and Formatting an Ami Pro Macro 
  23852.  
  23853.  
  23854. ΓòÉΓòÉΓòÉ 672. Creating, Saving, and Formatting an Ami Pro Macro ΓòÉΓòÉΓòÉ
  23855.  
  23856. This section shows you how to create and save Ami Pro macros. While writing 
  23857. macros, you can format them so they contain a consistent look and feel. This 
  23858. section also contains information about editing macros and understanding error 
  23859. messages. 
  23860.  
  23861.  
  23862. Macros compiled under other versions of Ami Pro may run under OS/2. The first 
  23863. time you run a macro from another version, Ami Pro for OS/2 recompiles the 
  23864. macro. Macros compiled using Ami Pro for OS/2 are not compatible with other 
  23865. versions of Ami Pro. If you want to run macros compiled under other versions of 
  23866. Ami Pro, you should copy them before using them in Ami Pro for OS/2. 
  23867.  
  23868. An error message may display if the macro uses functions that are not 
  23869. supported. You can edit the macro, correct any errors, and recompile it. 
  23870.  
  23871.  
  23872. See also: 
  23873.  
  23874.     Ami Pro Macro Language Contents 
  23875.     Overview of the Ami Pro Macro Language 
  23876.     Creating and Saving a Macro 
  23877.     Running Macros Automatically 
  23878.     Formatting Macros 
  23879.     Using Comments in a Macro 
  23880.     Using Multiple Macros in a Single File 
  23881.     Calling Functions With and Without Parameters 
  23882.  
  23883.  
  23884. ΓòÉΓòÉΓòÉ 673. Creating and Saving a Macro ΓòÉΓòÉΓòÉ
  23885.  
  23886. Type your macro as an Ami Pro document. To save the file as an Ami Pro macro, 
  23887. choose File Save As and then select Ami Pro Macro as the file type. This saves 
  23888. the file with .SMM as the extension. If you save the file with the .SAM 
  23889. extension, Ami Pro does not recognize your file as a macro, and does not 
  23890. compile it. 
  23891.  
  23892.  
  23893. When you save a file as a macro, the path changes to the default macro path 
  23894. that you entered by choosing Tools User Setup Paths. Although you can save 
  23895. macros to any directory, saving them to the default directory makes them easier 
  23896. to locate. 
  23897.  
  23898. When you save a macro file, Ami Pro compiles it into a special format that 
  23899. allows the macro to run faster. During compilation, Ami Pro checks the macro 
  23900. for errors. If Ami Pro finds an error, the compilation stops and an error 
  23901. message displays. The insertion point is at the location of the error so that 
  23902. you can correct the error. In some cases, the insertion point is on the line 
  23903. following the error. For example, if you were missing a right parenthesis at 
  23904. the end of a line, the insertion point is on the next line. 
  23905.  
  23906. You can create and edit your macro file using the File New, File Open, and File 
  23907. Save As functions. You can choose Tools Macros Edit from the menu to edit an 
  23908. existing macro file. 
  23909.  
  23910. You can edit a macro created with the Tools Macros Record menu function. When 
  23911. you edit a record and play macro, you may see an error message. This indicates 
  23912. that one or more of the functions in the record and play macro did not 
  23913. translate into editable form. A macro created in another version of Ami Pro can 
  23914. contain functions that are no longer available or are available by using a 
  23915. different function name. If you want to correct the error, use the new function 
  23916. name with the correct number of parameters. 
  23917.  
  23918. You can easily identify untranslated functions. They appear as commented 
  23919. numbers in the macro file. If you save the macro file, you will lose the 
  23920. untranslated functions. If you want to keep the original functionality of the 
  23921. macro, do not save the edited macro. 
  23922.  
  23923. If you want to reference your macro from other macros, do not place an 
  23924. exclamation point (!) in the file name when you save your macro. Ami Pro uses 
  23925. the exclamation point in the syntax of some macro functions. 
  23926.  
  23927. Ami Pro finds some types of macro errors when the macro runs. These are logic 
  23928. errors that are not detectable when the macro compiles. For example, your macro 
  23929. can try to create a frame in draft mode. Ami Pro does not allow this and the 
  23930. macro results in an error. 
  23931.  
  23932. See also: 
  23933.  
  23934.     Ami Pro Macro Language Contents 
  23935.     Overview of the Ami Pro Macro Language 
  23936.     Creating, Saving, and Formatting an Ami Pro Macro 
  23937.     Running Macros Automatically 
  23938.     Formatting Macros 
  23939.     Using Comments in a Macro 
  23940.     Using Multiple Macros in a Single File 
  23941.     Calling Functions With and Without Parameters 
  23942.     Debugging Macros 
  23943.     Macro Error Messages 
  23944.  
  23945.  
  23946. ΓòÉΓòÉΓòÉ 674. Running Macros Automatically ΓòÉΓòÉΓòÉ
  23947.  
  23948. One of the most useful ways to run a macro is to have it triggered by some 
  23949. event. Ami Pro provides several ways to automatically run a macro. 
  23950.  
  23951.  
  23952. Running a macro when you start Ami Pro 
  23953. There are two ways you can run a macro when Ami Pro starts. Ami Pro runs any 
  23954. macro file named AUTOEXEC.SMM as it starts. Ami Pro searches for AUTOEXEC.SMM 
  23955. in the following order: 
  23956.  
  23957.     Ami Pro program directory 
  23958.     Any directory specified in the path 
  23959.     Ami Pro default Macros directory 
  23960.     Ami Pro Docs directory 
  23961.  
  23962. You can also specify a series of macros to run by using the _AUTORUN.SMM macro 
  23963. shipped with Ami Pro. You can specify one macro by choosing Tools User Setup, 
  23964. choosing Macros, and specifying the macro to run. You can specify several 
  23965. macros by choosing Tools Macros Playback, selecting AUTORUN.SMM, and specifying 
  23966. the macros to run. 
  23967.  
  23968. Running a macro when you exit Ami Pro 
  23969. There are two ways you can run a macro when exiting Ami Pro. Ami Pro runs any 
  23970. macro file named AUTOEXIT.SMM as it shuts down. Ami Pro searches for 
  23971. AUTOEXIT.SMM in the following order: 
  23972.  
  23973.     Ami Pro program directory 
  23974.     Any directory specified in the path 
  23975.     Ami Pro default Macros directory 
  23976.     Ami Pro Docs directory 
  23977.  
  23978. You can also specify a macro by choosing Tools User Setup, choosing Macros, and 
  23979. specifying the macro to run. 
  23980.  
  23981. Running a macro when you open or close a file 
  23982. You can run a macro any time you open or close a document. Ami Pro runs any 
  23983. macro file named AUTOOPEN.SMM when you open a document. Ami Pro runs any macro 
  23984. file named AUTOCLOS.SMM when you close a document. 
  23985.  
  23986. Ami Pro searches for AUTOOPEN.SMM and AUTOCLOS.SMM in the following order: 
  23987.     Ami Pro default Macros directory 
  23988.     Ami Pro program directory 
  23989.     Any directory specified in the path 
  23990.     Ami Pro Docs directory 
  23991.  
  23992. Running a macro when you create a new document 
  23993. You can run a macro any time you create a new document using File New. Ami Pro 
  23994. runs any macro file named AUTONEW.SMM when you create a new document. Ami Pro 
  23995. searches for AUTONEW.SMM in the following order: 
  23996.     Ami Pro default Macros directory 
  23997.     Ami Pro program directory 
  23998.     Any directory specified in the path 
  23999.     Ami Pro Docs directory 
  24000.  
  24001. Running a macro when you open or close a specific document 
  24002. You can run a macro any time you open or close a specific document. Open the 
  24003. document you want to attach a macro to, choose Tools Macros Edit, and choose 
  24004. Assign. Specify the macros to execute whenever this document is opened or 
  24005. closed and check the box. Next time you open or close this document, Ami Pro 
  24006. runs the macros you specify. 
  24007.  
  24008. Running a macro when you choose a specific style sheet 
  24009.  
  24010. You can run a macro any time you create a new document using a specific style 
  24011. sheet. Choose Style Save as a Style Sheet, specify a macro to execute whenever 
  24012. this style sheet is used, and check the box. Next time you choose File New and 
  24013. select this style sheet, Ami Pro runs the macro you specify. 
  24014.  
  24015. Running a macro when you select a frame 
  24016. You can assign a macro to any frame. The frame then becomes a button and runs 
  24017. the macro assigned to it whenever it's selected. Select the frame, choose Frame 
  24018. Modify Frame Layout, specify a macro, and check the box. You must also choose 
  24019. File Doc Info and check the box beside Run frame macros. 
  24020.  
  24021. Running a macro when you update power fields 
  24022. You can run a macro whenever you update power fields. Choose Edit Power Fields 
  24023. Insert, choose CALL, and specify a macro. Next time you update power fields, 
  24024. Ami Pro runs the the macro you specify. 
  24025.  
  24026. Using multiple autorun macros 
  24027. When you set multiple autorun macros they execute in the following order: 
  24028.     Macros assigned to the style sheet that loads when Ami Pro is started run 
  24029.     first. 
  24030.     AUTOEXEC.SMM, including any other macros it may call. 
  24031.     Any macros listed in _AUTORUN.SMM run in the order in which they are 
  24032.     listed. 
  24033.  
  24034. In addition, the following macros run at the specified times: 
  24035.     AUTONEW.SMM runs before a macro attached to the particular style sheet. 
  24036.     AUTOOPEN.SMM runs before a macro assigned to that document. 
  24037.     AUTOEXIT.SMM runs after any macro specified for Program Exit under User 
  24038.     Setup. 
  24039.  
  24040. See also: 
  24041.  
  24042.     Ami Pro Macro Language Contents 
  24043.     Overview of the Ami Pro Macro Language 
  24044.     Creating, Saving, and Formatting an Ami Pro Macro 
  24045.  
  24046.  
  24047.  
  24048. ΓòÉΓòÉΓòÉ 675. Formatting Macros ΓòÉΓòÉΓòÉ
  24049.  
  24050. You can type your macro with any combination of fonts, paragraph styles, and 
  24051. text attributes to make the macro more readable. Ami Pro saves attribute and 
  24052. paragraph style information with the document containing your macro, but none 
  24053. of the attributes or paragraph styles affect how your macro plays. 
  24054.  
  24055.  
  24056. When you use numbers in a macro, you can use the hexadecimal equivalent by 
  24057. preceding the number with "0x" or "0X". 
  24058.  
  24059. In many of the macro functions, length and size are in twips. There are 1440 
  24060. twips in an inch (1 inch=1440 twips). Multiply the desired inches by 1440 to 
  24061. determine the size in twips. 
  24062.  
  24063. Type each macro statement on a single line to improve readability. Use tabs or 
  24064. indented paragraph styles to indent portions of a macro that are parts of a 
  24065. FOR/NEXT loop or an IF/THEN statement. 
  24066.  
  24067. You can use a double quotation mark (") at the beginning and end of text to 
  24068. represent a string or two double quotation marks ("") to include a single 
  24069. double quotation (") as part of the string. 
  24070.  
  24071. See also: 
  24072.  
  24073.     Ami Pro Macro Language Contents 
  24074.     Overview of the Ami Pro Macro Language 
  24075.     Creating, Saving, and Formatting an Ami Pro Macro 
  24076.     Creating and Saving a Macro 
  24077.     Running Macros Automatically 
  24078.     Using Comments in a Macro 
  24079.     Using Multiple Macros in a Single File 
  24080.     Calling Functions With and Without Parameters 
  24081.  
  24082.  
  24083.  
  24084.  
  24085.  
  24086.  
  24087. ΓòÉΓòÉΓòÉ 676. Using Comments in a Macro ΓòÉΓòÉΓòÉ
  24088.  
  24089. A comment is non-executable text you can insert in a macro. You can use 
  24090. comments to document what a macro does. 
  24091.  
  24092.  
  24093. Any text that follows a single quotation mark (') and any text outside a 
  24094. FUNCTION/END FUNCTION pair is treated as a comment. The single quotation mark 
  24095. can be at the beginning of a paragraph, causing Ami Pro to skip the entire 
  24096. paragraph. It can also follow a statement in a paragraph, causing Ami Pro to 
  24097. skip the rest of the paragraph. 
  24098.  
  24099. Example 
  24100. The following macro illustrates the use of comments: 
  24101. FUNCTION showcomment() 
  24102. 'This macro illustrates the use of comments in a macro 
  24103. var = "Print Me"     ' this line assigns a value to a variable 
  24104. var1 = "Print Me, Too" 
  24105. ' this line also assigns a value to a variable, and this comment is longer than 
  24106. a single line of text. 
  24107. TYPE ("{var}") ' TYPE ("{var1}") var 1 is a comment and not printed. 
  24108. END FUNCTION 
  24109.  
  24110. The output of the macro is as follows. 
  24111. "Print Me" 
  24112.  
  24113. Note that the second TYPE function is not acted on because it is part of a 
  24114. comment. 
  24115.  
  24116. See also: 
  24117.  
  24118.     Ami Pro Macro Language Contents 
  24119.     Overview of the Ami Pro Macro Language 
  24120.     Creating, Saving, and Formatting an Ami Pro Macro 
  24121.     Creating and Saving a Macro 
  24122.     Running Macros Automatically 
  24123.     Formatting Macros 
  24124.     Using Multiple Macros in a Single File 
  24125.     Calling Functions With and Without Parameters 
  24126.  
  24127.  
  24128.  
  24129.  
  24130.  
  24131.  
  24132. ΓòÉΓòÉΓòÉ 677. Using Multiple Macros in a Single File ΓòÉΓòÉΓòÉ
  24133.  
  24134. You can have more than one macro in a macro file. Keeping related macros in the 
  24135. same file improves the speed of macro playback. To have more than one macro in 
  24136. a macro file, use several FUNCTION and END FUNCTION pairs within a single file. 
  24137. The macro function that executes when you run the macro is the first macro in 
  24138. the macro file. 
  24139.  
  24140.  
  24141. Text that appears outside the FUNCTION/END FUNCTION pair is comments and 
  24142. therefore ignored; however, Ami Pro recognizes the DECLARE and DEFINE 
  24143. statements. Use the comment format to describe the functionality of the macro. 
  24144.  
  24145. Example 
  24146. The following macro functions ask the user to provide two numbers. The function 
  24147. average uses the numbers to obtain an average, and the function main displays 
  24148. the results. 
  24149. FUNCTION main() 
  24150. num1 = Query$ ("Type the first number:") 
  24151. num2 = Query$ ("Type the second number:") 
  24152. result = CALL average (num1, num2) 
  24153. message ("The average of the two numbers is {result}") 
  24154. END FUNCTION 
  24155.  
  24156. This subroutine calculates the average of two passed numbers. 
  24157. FUNCTION average (p1, p2) 
  24158. average = ((p1 + p2) / 2) 
  24159. END FUNCTION 
  24160.  
  24161. The function main asks for the two numbers to average using the Query$ 
  24162. function. It then calls the function average to determine the average and 
  24163. displays the result using the Message function. The function average returns 
  24164. the result to the main function by assigning the average to the variable 
  24165. average within the called macro. If the return value is different from the name 
  24166. of the function, use the RETURN statement. 
  24167.  
  24168. See also: 
  24169.  
  24170.     Ami Pro Macro Language Contents 
  24171.     Overview of the Ami Pro Macro Language 
  24172.     Creating, Saving, and Formatting an Ami Pro Macro 
  24173.     Creating and Saving a Macro 
  24174.     Running Macros Automatically 
  24175.     Formatting Macros 
  24176.     Using Comments in a Macro 
  24177.     Calling Functions With and Without Parameters 
  24178.  
  24179.  
  24180.  
  24181.  
  24182. ΓòÉΓòÉΓòÉ 678. Calling Functions With and Without Parameters ΓòÉΓòÉΓòÉ
  24183.  
  24184. You can call most functions with or without parameters. If you do not pass 
  24185. parameters, Ami Pro displays the dialog box as if the user accessed the 
  24186. function through the menu system. 
  24187.  
  24188.  
  24189. You can access some functions that are several levels deep in the menu system. 
  24190. For example, there is a command to insert a glossary record. Executing this 
  24191. function brings up the Insert Glossary Record dialog box. 
  24192.  
  24193. This language includes macro menu commands so you can develop replacement menu 
  24194. bars for Ami Pro. You can use the menu only commands in these macros. 
  24195.  
  24196. Several functions  generate child processes of Ami Pro. These include the File 
  24197. Management, Help, and System Setup functions. When you use these functions, the 
  24198. appropriate window opens and the program runs--therefore, you should end the 
  24199. macro immediately after the function call or use a pausing function. If your 
  24200. macro executes statements after one of these windows opens, the Ami Pro window 
  24201. may display on top of the function's window. 
  24202.  
  24203. Example 
  24204. FileOpen("DOC.SAM", 1, "") ' opens and displays the file DOC.SAM 
  24205. FileOpen ' brings up the File Open dialog box 
  24206.  
  24207. See also: 
  24208.  
  24209.     Ami Pro Macro Language Contents 
  24210.     Overview of the Ami Pro Macro Language 
  24211.     Creating, Saving, and Formatting an Ami Pro Macro 
  24212.     Creating and Saving a Macro 
  24213.     Running Macros Automatically 
  24214.     Formatting Macros 
  24215.     Using Comments in a Macro 
  24216.     Using Multiple Macros in a Single File 
  24217.  
  24218.  
  24219. ΓòÉΓòÉΓòÉ 679. Using Macro Programming Statements ΓòÉΓòÉΓòÉ
  24220.  
  24221. The macro language consists of a rich variety of programming statements that 
  24222. control the action of the macro. By combining the programming statements with 
  24223. the built-in macro functions and the Ami Pro functions, you can create powerful 
  24224. tools for use with Ami Pro. 
  24225.  
  24226.  
  24227. There are three components of the macro language: programming statements, macro 
  24228. functions, and Ami Pro macro functions. 
  24229.  
  24230. Programming Statements 
  24231. This section documents programming statements that you can use to control your 
  24232. macro: 
  24233.     ALIAS 
  24234.     BREAK 
  24235.     CALLI 
  24236.     CALL 
  24237.     CASE 
  24238.     DECLARE 
  24239.     DEFAULT 
  24240.     DEFINE 
  24241.     ELSEIF 
  24242.     ELSE 
  24243.     END FUNCTION 
  24244.     ENDIF 
  24245.     ENDSWITCH 
  24246.     EXIT FUNCTION 
  24247.     FOR 
  24248.     FUNCTION 
  24249.     GOTO 
  24250.     IF 
  24251.     NEXT 
  24252.     ONCANCEL 
  24253.     ONERROR 
  24254.     STEP 
  24255.     SWITCH 
  24256.     THEN 
  24257.     TO 
  24258.     Using LABELS 
  24259.     WEND 
  24260.     WHILE 
  24261.  
  24262. Macro Functions 
  24263. These functions allow you to interact with the macro user, interact with other 
  24264. applications, and get and send information from and to Ami Pro. These functions 
  24265. are generally not available in Ami Pro menus. 
  24266.  
  24267. Variables: 
  24268.     DEFSTR 
  24269.     DIM 
  24270.  
  24271. Numbers, Strings, and Operators: 
  24272.     Bitwise AND 
  24273.     Bitwise OR 
  24274.     Logical AND 
  24275.     Logical OR 
  24276.     Logical NOT 
  24277.  
  24278. Program Control: 
  24279.     RETURN 
  24280.  
  24281.  
  24282. Ami Pro Macro Functions 
  24283. These functions are those that you can execute in Ami Pro by using the menu bar 
  24284. and dialog boxes. 
  24285.  
  24286. See also: 
  24287.  
  24288.     Ami Pro Macro Language Contents 
  24289.     Overview of the Ami Pro Macro Language 
  24290.     Ami Pro Macro Functions Grouped Alphabetically 
  24291.     Ami Pro Macro Functions Grouped by Category 
  24292.     Ami Pro Macro Functions Grouped by Menu 
  24293.     Using Variables 
  24294.  
  24295.  
  24296.  
  24297. ΓòÉΓòÉΓòÉ 680. Using the BREAK statement ΓòÉΓòÉΓòÉ
  24298.  
  24299. Looping allows repetitive tasks to be coded once and executed repeatedly until 
  24300. a  certain condition becomes true or until an event occurs. The BREAK statement 
  24301. allows control to pass out of the loop, and ends the action of the FOR/NEXT, 
  24302. SWITCH/CASE, and WHILE/WEND statements. 
  24303.  
  24304.  
  24305. When in a FOR/NEXT loop, there are times when the loop should be ended before 
  24306. the total number of repetitions specified in the FOR statement. In a 
  24307. SWITCH/CASE loop, there are times when only certain statements should be 
  24308. processed for a matching case, based on some other variable. Similarly, there 
  24309. are times when the macro needs to break out of a WHILE/WEND loop. 
  24310.  
  24311. Syntax 
  24312. BREAK 
  24313.  
  24314. Example 
  24315. This example bolds every occurrence of the word "and". 
  24316. FUNCTION BoldWord() 
  24317. TYPE("[CTRLHome]") ' go to the beginning of the document 
  24318. WHILE(TRUE) ' create a loop 
  24319. findit = Replace("", "", "", "and", "") ' search for "and" 
  24320. IF findit <> 1 ' if we can't find the word, break out of the loop 
  24321. BREAK 
  24322. ENDIF 
  24323. Bold() 
  24324. TYPE("[ESC]") ' deselect the word 
  24325. WEND 
  24326. END FUNCTION 
  24327.  
  24328. Line 2 returns the cursor to the beginning of the document. Line 3 begins the 
  24329. WHILE loop that always executes because the value is TRUE. Line 4 finds the 
  24330. next occurrence of "and". Line 5 evaluates the variable findit with TRUE. If 
  24331. findit is TRUE, Line 8 bolds the word "and". Line 9 deselects the word. Line 10 
  24332. ends the loop and returns control to Line 3 and the loop continues. If the 
  24333. variable findit is FALSE, the IF statement will evaluate Line 6 and the macro 
  24334. stops the loop. The macro runs the next line, in this case Line 11 is an END 
  24335. FUNCTION. 
  24336.  
  24337. See also: 
  24338.  
  24339.     Ami Pro Macro Language Contents 
  24340.     Using Macro Programming Statements 
  24341.     Using the FOR Statement 
  24342.     Using the SWITCH and CASE Statements 
  24343.     Using the WHILE Statement 
  24344.  
  24345.  
  24346.  
  24347. ΓòÉΓòÉΓòÉ 681. Using the CALL and CALLI statements ΓòÉΓòÉΓòÉ
  24348.  
  24349. The CALL and CALLI statements execute a macro function from another macro file. 
  24350. You can use the CALL statement when you know the name of the macro to execute 
  24351. when the macro compiles. You can use the CALLI statement when you do not know 
  24352. the name of the macro until you run the macro. 
  24353.  
  24354.  
  24355. Syntax 
  24356. CALL [[Drive:Path\]MacroFile!]Function([Parm1][[,] Parm2...]) 
  24357. drive, path, and MacroFile are the drive letter, full path, and macro file name 
  24358. that contain the called macro. 
  24359. MacroName is the name of the macro to execute. 
  24360. Parm1 and parm2 are the parameters to pass to the macro. 
  24361. You must supply the parentheses even if you are not passing any parameters to 
  24362. the called function. For example, CALL mymacro.smm!myfunction() 
  24363.  
  24364. Syntax 
  24365. CALLI Variable ([Parm1][[,] Parm2...]) 
  24366. variable is a string variable that evaluates to the name of a macro. The name 
  24367. of the macro may contain the drive, path, and file name as outlined above for 
  24368. the CALL statement. 
  24369. Parm1 and Parm2 are the parameters to pass to the macro. 
  24370.  
  24371. You must supply the parentheses even if you are not passing any parameters to 
  24372. the called function. For example, CALLI mytestfunction(). The parameters given 
  24373. can be any expression. 
  24374.  
  24375. You must follow the drive, path, and macro file name, if given, by an 
  24376. exclamation point and the name of the macro. You do not need the drive, path, 
  24377. and macro file name if the called macro is in the same file as the calling 
  24378. macro. If given, Ami Pro looks for the macro in the location of the macro path. 
  24379. If no path is given, Ami Pro searches the macro directory, the document 
  24380. directory, and the Ami Pro directory for the called macro. 
  24381.  
  24382. If the disk location of the called macro is not on one of the locations in the 
  24383. macro search path, and must be determined at runtime, the CALLI statement 
  24384. should be used instead. The only difference between the CALL and the CALLI 
  24385. statements is that the macro name and path can be specified in a variable when 
  24386. the CALLI statement is used, while they must be specified explicitly when using 
  24387. the CALL statement. 
  24388.  
  24389. Example 
  24390. The following example illustrates the use of the DECLARE, CALL and CALLI 
  24391. statements. This macro determines either the number count of the letters in a 
  24392. word, or the number of digits in a number. 
  24393.  
  24394. DECLARE getopt() 
  24395. ' declare this function so we can use it later 
  24396.  
  24397. FUNCTION main() 
  24398. string = Query$ ("Type a word or a number:") 
  24399. flag = getopt() 
  24400. ' since declared, do not have to use CALL statement 
  24401.  IF (flag = 6) 
  24402.    result=CALL sub1 (string)       ' since macro is here, just use CALL 
  24403.  statement 
  24404.    message ("There are {result} letters in {string}.") 
  24405.  ELSE 
  24406.    thismacro=GetRunningMacroFile$() 
  24407.    macname = strcat$(thismacro, "!SUB2")   ' put into var 
  24408.    result=CALLI macname (string)     ' use variable cause do not know filename 
  24409.    message ("There are {result} digits in {string}.") 
  24410.  ENDIF 
  24411.  END FUNCTION 
  24412.  
  24413.  FUNCTION sub1 (string)     ' this is in original file 
  24414.  sub1 = LEN(string) 
  24415.  END FUNCTION 
  24416.  
  24417.  FUNCTION getopt()   ' this is in original file 
  24418.  getopt = MultiDecide ("Choose Yes for letters; No for numbers", 35) 
  24419.  END FUNCTION 
  24420.  
  24421.  FUNCTION sub2 (string)     ' this is called by the CALLI funciton in Main 
  24422.  numcount = 0 
  24423.  FOR count = 1 to LEN(string) 
  24424.    c = MID$(string, count, 1) 
  24425.    IF (isnumeric(c)) 
  24426.     numcount = numcount +1 
  24427.    ENDIF 
  24428.  NEXT 
  24429.  sub2 = numcount 
  24430.  END FUNCTION 
  24431.  
  24432. This macro examines a word or number and returns the total number of characters 
  24433. or digits.  In the main function, line 3 retrieves a string.  The getopt 
  24434. function, declared on Line 1, is used on Line 4 just as if it were an Ami Pro 
  24435. function. This function presents a MULTIDecide box to determine if the string 
  24436. is a word or a number.  If the MULTIDecide box returns a "yes," Line 6 calls 
  24437. the sub1 function, which returns the number of characters in the string.  In 
  24438. Line 7, the returned value is displayed.  Otherwise, in line 10 the macro calls 
  24439. the variable function (which in this case evaluates to the current macro 
  24440. filename followed with "!sub2").  Sub2 computes and returns the number of 
  24441. digits in the string. In Line 12, the returned value is displayed. 
  24442.  
  24443. See also: 
  24444.  
  24445.     Ami Pro Macro Language Contents 
  24446.     Using Macro Programming Statements 
  24447.  
  24448.  
  24449.  
  24450. ΓòÉΓòÉΓòÉ 682. Using the DECLARE statement ΓòÉΓòÉΓòÉ
  24451.  
  24452. You can use DECLARE to identify callable macro functions before you call the 
  24453. macro. 
  24454.  
  24455.  
  24456. DECLARE pre-defines a function for the macro compiler. DECLARE allows you to 
  24457. call a non-defined macro function without using a CALL statement. 
  24458.  
  24459. Syntax 
  24460. DECLARE [FileName!]MacroName([parm1[, parm2...]])[, ALIAS ShortName] 
  24461. FileName is the optional file name of the function to be pre-defined. If not 
  24462. specified, the macro is assumed to be in the current file. 
  24463. MacroName is the name of the macro to be predefined. 
  24464. Parm1 and parm2 are prototypes of the parameters that pass to the macro when 
  24465. called. They must be variable names, but you do not need to declare them. 
  24466. ALIAS is a reserved word that takes the parameter ShortName if used. This 
  24467. optional specification allows you to assign the macro function that has been 
  24468. pre-defined on this line to a shorter name. 
  24469. Any parameters must be specified so the compiler knows how many to expect. 
  24470.  
  24471. Using the DECLARE statement does not cause the macro referenced to execute; it 
  24472. simply identifies a macro that you can use within the calling macro. Once 
  24473. declared, a macro can execute from another macro by typing its name and 
  24474. parameters. 
  24475.  
  24476. Example 
  24477. The following example illustrates the use of the DECLARE, CALL and CALLI 
  24478. statements. This macro determines either the number count of the letters in a 
  24479. word, or the number of digits in a number. 
  24480.  
  24481.  DECLARE getopt()    ' declare this function so we can use it later 
  24482.  
  24483.  FUNCTION main() 
  24484.  string = Query$ ("Type a word or a number:") 
  24485.  flag = getopt() 
  24486.  ' since declared, do not have to use CALL statement 
  24487.  IF (flag = 6) 
  24488.    result=CALL sub1 (string)       ' since macro is here, just use CALL 
  24489.  statement 
  24490.    message ("There are {result} letters in {string}.") 
  24491.  ELSE 
  24492.    thismacro=GetRunningMacroFile$() 
  24493.    macname = strcat$(thismacro, "!SUB2")   ' put into var 
  24494.    result=CALLI macname (string)     ' use variable cause do not know filename 
  24495.    message ("There are {result} digits in {string}.") 
  24496.  ENDIF 
  24497.  END FUNCTION 
  24498.  
  24499.  FUNCTION sub1 (string)     ' this is in original file 
  24500.  sub1 = LEN(string) 
  24501.  END FUNCTION 
  24502.  
  24503.  FUNCTION getopt()   ' this is in original file 
  24504.  getopt = MultiDecide ("Choose Yes for letters; No for numbers", 35) 
  24505.  END FUNCTION 
  24506.  
  24507.  FUNCTION sub2 (string)     ' this is called by the CALLI funciton in Main 
  24508.  numcount = 0 
  24509.  FOR count = 1 to LEN(string) 
  24510.    c = MID$(string, count, 1) 
  24511.    IF (isnumeric(c)) 
  24512.     numcount = numcount +1 
  24513.    ENDIF 
  24514.  NEXT 
  24515.  sub2 = numcount 
  24516.  END FUNCTION 
  24517.  
  24518. This macro examines a word or number and returns the total number of characters 
  24519. or digits.  In the main function, line 3 retrieves a string.  The getopt 
  24520. function, declared on Line 1, is used on Line 4 just as if it were an Ami Pro 
  24521. function. This function presents a MULTIDecide box to determine if the string 
  24522. is a word or a number.  If the MULTIDecide box returns a "yes," Line 6 calls 
  24523. the sub1 function, which returns the number of characters in the string.  In 
  24524. Line 7, the returned value is displayed.  Otherwise, in line 10 the macro calls 
  24525. the variable function (which in this case evaluates to the current macro 
  24526. filename followed with "!sub2").  Sub2 computes and returns the number of 
  24527. digits in the string. In Line 12, the returned value is displayed. 
  24528.  
  24529. See also: 
  24530.  
  24531.     Ami Pro Macro Language Contents 
  24532.     Using Macro Programming Statements 
  24533.  
  24534.  
  24535.  
  24536. ΓòÉΓòÉΓòÉ 683. Using the DEFINE statement ΓòÉΓòÉΓòÉ
  24537.  
  24538. You can use the DEFINE statement to do a simple token replacement ("this" item 
  24539. for "that" item). A more powerful use of the DEFINE statement is to replace 
  24540. parameters. 
  24541.  
  24542.  
  24543. Syntax 
  24544. DEFINE identifier([optional descriptive parameters]) replacement([parameters]) 
  24545.  
  24546. Example 
  24547. This example allows you to replace a descriptive name with a number. 
  24548. DEFINE ALL 1 
  24549. DEFINE JUSTONE 2 
  24550. MyFunction(ALL) 
  24551.     .......... 
  24552. FUNCTION MyFunction(type) 
  24553.     .......... 
  24554. if (type=ALL) 
  24555. elseif(type=JUSTONE) 
  24556.  
  24557. When the macro runs, it replaces ALL and JUSTONE by 1 and 2. 
  24558.  
  24559. This example allows you to replace a descriptive name with parameters. 
  24560.  
  24561. DEFINE Findit() Replace(0,0,4,%1,0) 
  24562. Then you enter the text to replace. 
  24563. Findit("text") 
  24564.  
  24565. When the macro is compiled, Findit("text") is replaced with Replace 
  24566. (0,0,4,"text",0). The replacement uses the DOS batch file notation for 
  24567. parameters. If you have more than one parameter they would be %2, %3, etc. You 
  24568. can use these more than once and in any order. For more information about 
  24569. parameters, see your DOS manual. 
  24570.  
  24571. When Ami Pro encounters the DEFINE, it remembers the complete replacement. When 
  24572. the next occurrence happens, parentheses surround the parameters and separate 
  24573. the parameters by white characters or commas. Parameters can be either quoted 
  24574. strings, a string surrounded by parentheses, or any non-white sequence of 
  24575. characters. Once Ami Pro identifies the parameters, it scans the replacement 
  24576. for %1, %2, etc., and replaces the parameters. The whole string is then 
  24577. re-parsed. The total replacement, after parameter substitution, must be less 
  24578. than 500 characters. 
  24579.  
  24580. An example of calling DLL functions would be: 
  24581. DllCall(Dllid,p1,p2) 
  24582.  
  24583. or use DEFINE: 
  24584. DEFINE LookUp() DLLCall(Dllid,%1,%2) 
  24585.  
  24586. It could be: 
  24587. LookUp(p1,p2) 
  24588.  
  24589. See also: 
  24590.  
  24591.     Ami Pro Macro Language Contents 
  24592.     Using Macro Programming Statements 
  24593.  
  24594.  
  24595.  
  24596. ΓòÉΓòÉΓòÉ 684. Using the END FUNCTION Statement ΓòÉΓòÉΓòÉ
  24597.  
  24598. All Ami Pro macro language routines are contained within functions. When you 
  24599. run a macro, you are actually telling Ami Pro to run the first function in the 
  24600. macro file. 
  24601.  
  24602.  
  24603. A macro function must start with a FUNCTION statement and stop with an END 
  24604. FUNCTION statement. Each macro file must contain at least one function, but you 
  24605. can have several macro functions within one macro file. 
  24606.  
  24607. The END FUNCTION statement defines the end of a macro function. It causes a 
  24608. return to the calling macro or the end of a macro play. 
  24609.  
  24610. Syntax 
  24611. END FUNCTION 
  24612.  
  24613. Every macro must have an END FUNCTION statement as the last line of the macro. 
  24614. If the macro has more than one exit point, use the EXIT FUNCTION statement at 
  24615. the other exit points in the macro. 
  24616.  
  24617. Example 
  24618. The following example calculates the average of two numbers and returns the 
  24619. result to the calling macro: 
  24620.  FUNCTION average (p1, p2) 
  24621.  average = ((p1 + p2) / 2) 
  24622.  END FUNCTION 
  24623.  
  24624. Line 1 assigns the name average to this macro. The calling macro passes the 
  24625. arguments p1 and p2 to this macro. The second line of the macro calculates the 
  24626. average and the last line ends the function. 
  24627.  
  24628. See also: 
  24629.  
  24630.     Ami Pro Macro Language Contents 
  24631.     Using Macro Programming Statements 
  24632.     Using the EXIT FUNCTION Statement 
  24633.     Using the FUNCTION Statement 
  24634.  
  24635.  
  24636. ΓòÉΓòÉΓòÉ 685. Using the EXIT FUNCTION statement ΓòÉΓòÉΓòÉ
  24637.  
  24638. The EXIT FUNCTION statement allows a macro to stop before reaching the end of 
  24639. the macro. A macro usually ends with an END FUNCTION statement. You can use the 
  24640. EXIT FUNCTION statement when there are several different exit points to the 
  24641. same macro. While there can be only one END FUNCTION statement in a macro 
  24642. function, there can be multiple EXIT FUNCTION statements. 
  24643.  
  24644.  
  24645. Syntax 
  24646. EXIT FUNCTION 
  24647.  
  24648. Example 
  24649. The following example uses the EXIT FUNCTION statement to exit the macro before 
  24650. the macro ends: 
  24651.  FUNCTION saveit() 
  24652.  ' This macro saves a file only if the file has changed. Otherwise, it cancels 
  24653. the save 
  24654.  stat = FileChanged (0, 0)  ' get file changed status 
  24655.  IF stat = false     ' file hasn't changed 
  24656.     EXIT FUNCTION           ' quit; no need to save 
  24657.  ENDIF 
  24658.  save()       ' save file 
  24659.  END FUNCTION        ' end it 
  24660.  
  24661. In this example, the EXIT FUNCTION statement in line 5 exits the macro if the 
  24662. file does require saving. The END FUNCTION statement in line 8 exits the macro 
  24663. following the saving of the file. 
  24664.  
  24665. See also: 
  24666.  
  24667.     Ami Pro Macro Language Contents 
  24668.     Using Macro Programming Statements 
  24669.     Using the END FUNCTION Statement 
  24670.     Using the FUNCTION Statement 
  24671.  
  24672.  
  24673. ΓòÉΓòÉΓòÉ 686. Using the FOR statement ΓòÉΓòÉΓòÉ
  24674.  
  24675. Looping allows repetitive tasks to be coded once and executed repeatedly until 
  24676. a  certain condition becomes true or until an event occurs.  You can use 
  24677. FOR/NEXT statements to specify how many times the code inside the loop 
  24678. executes. The FOR statement executes a series of steps one or more times or 
  24679. skip the program steps. When the loop is finished, code execution continues 
  24680. with the line after NEXT. 
  24681.  
  24682.  
  24683. When Ami Pro encounters a FOR statement, the variable specified in the 
  24684. assignment initializes to the value of the assignment. Ami Pro compares this 
  24685. variable to expression1. If the variable is less than or equal to expression1, 
  24686. Ami Pro executes the program steps between the FOR statement and the NEXT 
  24687. statement. If the result of the comparison is false, the program continues with 
  24688. the first statement following the NEXT statement. 
  24689.  
  24690. When the macro executes the NEXT statement, control returns to the FOR 
  24691. statement. The variable increments by the amount specified in expression2. If 
  24692. there is not an expression2, the variable increments by 1. Ami Pro compares the 
  24693. new value of the variable to expression1. If the two values are not equal, 
  24694. program steps execute again. This process continues until the value of the 
  24695. variable is greater than expression1 and program control passes to the first 
  24696. statement following the NEXT statement. 
  24697.  
  24698. Syntax 
  24699. FOR Assignment TO Expression1 
  24700. [STEP Expression2] 
  24701.    Program statements 
  24702. NEXT 
  24703. Assignment is an assignment of value to a single element variable. 
  24704. Expression1 is an expression to which the value of the single element variable 
  24705. is compared. 
  24706. Expression2 is an expression that is added to the single element variable once 
  24707. for each loop iteration. 
  24708. Program statements are the macro statements executed if the value of the single 
  24709. element variable is less than expression1 at the beginning of each loop. 
  24710.  
  24711. Example 
  24712. The following example illustrates the use of the FOR and NEXT statements: 
  24713.  FUNCTION typename() 
  24714.  FOR loop1 = 1 to 5 
  24715.    TYPE("Ami Pro ") 
  24716.  NEXT 
  24717.  END FUNCTION 
  24718.  
  24719. Line 2 initializes the variable loop1 to 1. Line 3 types "Ami Pro " to the 
  24720. screen, excluding the quotation marks. Line 4 transfers the control back to 
  24721. Line 2. Line 2 checks to see if loop1 is equal to 5. If loop1 is less than 5, 
  24722. the macro increments loop1 by 1 and continues to Line 3. The loop continues for 
  24723. a total of 5 iterations. When loop1 is equal to 5, the macro ends. 
  24724.  
  24725. See also: 
  24726.  
  24727.     Ami Pro Macro Language Contents 
  24728.     Using Macro Programming Statements 
  24729.  
  24730.  
  24731. ΓòÉΓòÉΓòÉ 687. Using the FUNCTION Statement ΓòÉΓòÉΓòÉ
  24732.  
  24733. All Ami Pro macro language routines are contained within functions. When you 
  24734. run a macro, you are actually telling Ami Pro to run the first function in the 
  24735. macro file. 
  24736.  
  24737.  
  24738. A macro function must start with a FUNCTION statement and stop with an END 
  24739. FUNCTION statement. Each macro file must contain at least one function, but you 
  24740. can have several macro functions within one macro file. 
  24741.  
  24742. The FUNCTION statement defines the beginning of a macro, names the macro, and 
  24743. defines any arguments passed to the macro. 
  24744.  
  24745. You can pass as many arguments as needed to a macro or none at all. You cannot 
  24746. pass arguments to a macro started through the Macro Play function or through a 
  24747. shortcut key. You can only pass arguments to macros you call as functions of 
  24748. other macros. Argument names must be character strings, numbers, or defined 
  24749. variable names. 
  24750.  
  24751. Syntax 
  24752. FUNCTION Name ([Argument1][[,] Argument2...]) 
  24753. Name is the name of the macro. It must begin with a letter, but can contain 
  24754. both numbers and letters. 
  24755. Argument1 and Argument2 are variables that are passed to the macro when the 
  24756. macro runs. 
  24757.  
  24758. Example 
  24759. The following example calculates the average of two numbers and returns the 
  24760. result to the calling macro: 
  24761.  FUNCTION average (p1, p2) 
  24762.  average = ((p1 + p2) / 2) 
  24763.  END FUNCTION 
  24764.  
  24765. Line 1 assigns the name average to this macro. The calling macro passes the 
  24766. arguments p1 and p2 to this macro. The second line of the macro calculates the 
  24767. average and the last line ends the function. 
  24768.  
  24769. See also: 
  24770.  
  24771.     Ami Pro Macro Language Contents 
  24772.     Using Macro Programming Statements 
  24773.     String Macro Functions 
  24774.     Using the END FUNCTION Statement 
  24775.     Using the EXIT FUNCTION Statement 
  24776.     Using Variables 
  24777.  
  24778.  
  24779. ΓòÉΓòÉΓòÉ 688. Using the GOTO statement ΓòÉΓòÉΓòÉ
  24780.  
  24781. In a macro function, the lines of code are usually executed in the order they 
  24782. appear. You can divert the flow of execution through unconditional branching. 
  24783. You can use a GOTO statement to unconditionally transfer control from one 
  24784. location to another in a macro file. The location that the GOTO statement 
  24785. transfers control to must be in the same macro as the GOTO statement and 
  24786. defined by a Label. 
  24787.  
  24788.  
  24789. Using GOTO statements to control program flow makes a macro more difficult to 
  24790. read, and increases the risk of causing an error if you edit the macro. You can 
  24791. usually eliminate the need for GOTO by using other macro programming statements 
  24792. and subroutines. 
  24793.  
  24794. Syntax 
  24795. GOTO Label 
  24796. Label is a label name defined elsewhere in the macro program. When you use it 
  24797. in the GOTO statement, do not type a colon following the label name. 
  24798.  
  24799. Example 
  24800. The following example shows the use of the GOTO and Label statements: 
  24801.  FUNCTION main() 
  24802.  string = Query$ ("Type a word or a number:") 
  24803.  flag = (MultiDecide ("Choose Yes for letters; No for numbers", 35)) 
  24804.  IF (flag = 6) GOTO letters 
  24805.  ELSEIF (flag = 7) GOTO numbers 
  24806.  ENDIF 
  24807.  letters: 
  24808.  result = LEN(string) 
  24809.  message ("There are {result} letters in {string}.") 
  24810.  GOTO endit 
  24811.  numbers: 
  24812.  numcount = 0 
  24813.  FOR count = 1 to LEN(string) 
  24814.     c = MID$ (string, count, 1) 
  24815.     IF (isnumeric(c)) 
  24816.        numcount = numcount +1 
  24817.     ENDIF 
  24818.  NEXT 
  24819.  message ("There are {numcount} digits in {string}.") 
  24820.  endit: 
  24821.  END FUNCTION 
  24822.  
  24823. This macro is a variation of the example used to illustrate the CALL and 
  24824. DECLARE statements. Instead of using subroutines to get the user's choice of 
  24825. counting letters and numbers and to do the count, this macro first determines 
  24826. the user's choice by using the Query$ function in line 2. If the user chooses 
  24827. letters, the GOTO statement in line 4 transfers control to the letters label in 
  24828. line 7. If the user chooses numbers, the program uses the GOTO statement in 
  24829. line 5 to jump to the numbers label in line 11. 
  24830.  
  24831. The macro requires a GOTO statement in line 10 to jump to the end of the macro 
  24832. so that the letters option does not also execute the numbers option. 
  24833.  
  24834. See also: 
  24835.  
  24836.     Ami Pro Macro Language Contents 
  24837.     Using Macro Programming Statements 
  24838.  
  24839.  
  24840. ΓòÉΓòÉΓòÉ 689. Using the IF/THEN statements ΓòÉΓòÉΓòÉ
  24841.  
  24842. In a macro function, the lines of code are usually executed in the order they 
  24843. appear. You can divert the flow of execution through unconditional branching. 
  24844. The IF statement evalutes an expression and causes lines of code to execute 
  24845. based on the result of the evaluation. 
  24846.  
  24847.  
  24848. When a macro encounters an IF statement, the macro evaluates the condition 
  24849. specified in condition1. If the condition evaluates to TRUE, Program step 1 
  24850. executes and control passes to the first program line beyond the ENDIF. If the 
  24851. condition is FALSE, the macro evaluates to condition2. 
  24852.  
  24853. If this condition is TRUE, then Program step 2 executes and control passes to 
  24854. the first program line beyond the ENDIF. The macro evaluates subsequent 
  24855. ELSEIF's (if present) until one of the ELSEIF conditions is TRUE and its 
  24856. statements execute or the ELSE statement, if present, executes. 
  24857.  
  24858. Syntax 
  24859. IF Condition1 [THEN] 
  24860. Program step 1 
  24861. [ELSEIF Condition2 [THEN] 
  24862. Program step 2]... 
  24863. [ELSE 
  24864. Program step 3] 
  24865. ENDIF 
  24866. Condition 1 is an expression that causes program step 1 to execute if it 
  24867. evaluates to TRUE. 
  24868. Program step 1 is a series of macro statements that execute if condition1 
  24869. evaluates to TRUE. 
  24870. Condition 2 is an expression, that causes program step 2 to execute if it 
  24871. evaluates to TRUE. 
  24872. Program step 2 is a series of macro statements that execute if condition2 
  24873. evaluates to TRUE and previous conditions are FALSE. 
  24874. Program step 3 is a series of macro statements that execute if none of the 
  24875. previous conditions were TRUE. 
  24876.  
  24877. Example 
  24878. The following example deletes two carriage returns in a row in a document. This 
  24879. allows removal of the blank line between paragraphs. It uses the IF statement 
  24880. to find two carriage returns in a row. 
  24881.  FUNCTION delcrs() 
  24882.  TYPE ("[ctrlhome]") ' go to top of file 
  24883.  loop: 
  24884.  TYPE ("[ctrldown]") ' to next RETURN symbol 
  24885.  c = CurChar$() 
  24886.  TYPE ("[RIGHT]") 
  24887.  IF (AtEOF()) ' at end of file? 
  24888.     EXIT FUNCTION 'end macro execution 
  24889.  ELSEIF (c = CurChar$()) ' look for two in a row 
  24890.     TYPE ("[DEL]") 
  24891.  ENDIF 
  24892.     GOTO loop 
  24893.  END FUNCTION 
  24894.  
  24895. The macro starts by going to the beginning of the file in line 2. It then moves 
  24896. to the end of the first paragraph in line 4. In line 5, the macro stores in the 
  24897. variable c the value of the character under the insertion point. The insertion 
  24898. point then advances one position in line 6. The IF statement in line 7 
  24899. determines if the macro reached the end of the file. If so, the macro exits in 
  24900. line 8. If not, the ELSEIF statement in line 9 compares the value of the 
  24901. character at the insertion point position with the value of the previously 
  24902. stored character c. If they are the same (the condition is TRUE), line 10 
  24903. deletes the second return symbol. There is no ELSE condition in this IF 
  24904. statement, since we are not interested in any other characters besides return 
  24905. symbols and the end of the file. Therefore, control passes through the ENDIF 
  24906. statement and jumps to the label LOOP in line 3, where the sequence repeats. 
  24907.  
  24908. See also: 
  24909.  
  24910.     Ami Pro Macro Language Contents 
  24911.     Using Macro Programming Statements 
  24912.  
  24913.  
  24914.  
  24915. ΓòÉΓòÉΓòÉ 690. Using labels ΓòÉΓòÉΓòÉ
  24916.  
  24917. A label is a position marker which you can refer to. You can use a label to 
  24918. define the location where the macro transfers control from the GOTO statement. 
  24919.  
  24920.  
  24921. Syntax 
  24922. Label: 
  24923. Label is a single word followed immediately by a colon. Labels cannot be 
  24924. function names or statement names. 
  24925.  
  24926. Example 
  24927. The following shows some permissible label names: 
  24928. TopOfLoop: 
  24929. Any1: 
  24930. proceed: 
  24931.  
  24932. See also: 
  24933.  
  24934.     Ami Pro Macro Language Contents 
  24935.     Using Macro Programming Statements 
  24936.     Using the GOTO Statement 
  24937.  
  24938.  
  24939. ΓòÉΓòÉΓòÉ 691. Using the ONCANCEL statement ΓòÉΓòÉΓòÉ
  24940.  
  24941. The user can cancel the running of a macro by typing a key while the macro is 
  24942. playing back or by choosing Cancel in the Query$ function dialog box. Normally, 
  24943. canceling the macro terminates the macro with no notice to the macro user. By 
  24944. using the ONCANCEL statement, you can inform the user that the macro has 
  24945. canceled or you can cause the execution of the macro to continue elsewhere. 
  24946.  
  24947.  
  24948. If the macro encounters an error or cancel condition, Ami Pro looks for an 
  24949. ONCANCEL statement in the currently running macro function. If Ami Pro finds no 
  24950. ONCANCEL, it searches succeeding parent functions for an ONCANCEL statement, 
  24951. until it encounters the main function. This means that each macro function can 
  24952. have its own error processing. 
  24953.  
  24954. If an error occurs in a subroutine, and the macro processes it in that routine, 
  24955. Ami Pro does not search any farther for other ONCANCEL statements. You should 
  24956. ensure that parent functions correctly handle error conditions. 
  24957.  
  24958. When using the ONERROR and ONCANCEL statements, make sure that they are at the 
  24959. beginning of the macro. If an error occurs before these statements, control may 
  24960. not transfer to the error or cancellation routines. 
  24961.  
  24962. Syntax 
  24963. ONCANCEL Label 
  24964. Label is the name of a label to which control transfers in case the user 
  24965. cancels the macro. 
  24966.  
  24967. Example 
  24968. The following is an example of the ONERROR and ONCANCEL statements: 
  24969.  FUNCTION main() 
  24970.  ONERROR ErrorRoutine 'set error routine 
  24971.  ONCANCEL CancelRoutine 'set cancel routine 
  24972.  Query$ ("Choose OK or CANCEL.") ' set up routine 
  24973.  CALL notthere() ' this causes an error, since macro not there 
  24974.  GOTO endit 
  24975.  CancelRoutine: 
  24976.  message ("You canceled the macro.") 
  24977.  GOTO endit 
  24978.  ErrorRoutine: 
  24979.  message ("There has been a macro error.") 
  24980.  endit: 
  24981.  END FUNCTION 
  24982.  
  24983. This macro defines program locations for error and cancel handling in lines 2 
  24984. and 3. It then asks the macro user to type in a value using the Query$ 
  24985. function, which has OK and Cancel buttons. If the user chooses OK, the macro 
  24986. attempts to call a nonexistent macro named  notthere in line 5. This causes a 
  24987. jump to the error routine in line 10. If the user chooses cancel in the Query$ 
  24988. function, the program jumps to the cancel routine in line 7. 
  24989.  
  24990. See also: 
  24991.  
  24992.     Ami Pro Macro Language Contents 
  24993.     Using Macro Programming Statements 
  24994.     Query$ 
  24995.  
  24996.  
  24997.  
  24998. ΓòÉΓòÉΓòÉ 692. Using the ONERROR statement ΓòÉΓòÉΓòÉ
  24999.  
  25000. A macro runtime error can occur in several circumstances, including calling a 
  25001. macro that cannot be found, or passing a non-numeric string to a function that 
  25002. requires a number. If this happens, the macro program normally terminates with 
  25003. an error message that identifies the cause of the error. By using the ONERROR 
  25004. statement, you can direct program control to an error handling routine that 
  25005. could inform the user of the error, and suggest corrective action and/or 
  25006. perform a cleanup. 
  25007.  
  25008.  
  25009. Another important function of the ONERROR statement is to allow the macro to 
  25010. clean up after itself. This is particularly important if the macro uses Global 
  25011. Variable Functions or ASCII File Macro Functions. Exiting a macro without 
  25012. clearing these routines could affect the later operation of Ami Pro and OS/2. 
  25013.  
  25014. If the macro encounters an error condition, Ami Pro looks for an ONERROR 
  25015. statement in the currently running macro function. If Ami Pro finds no ONERROR, 
  25016. it searches succeeding parent functions for an ONERROR statement, until it 
  25017. encounters the main function. This means that each macro function can have its 
  25018. own error processing. 
  25019.  
  25020. If an error occurs in a subroutine and the macro processes it in that routine, 
  25021. Ami Pro does not search any farther for other ONERROR statements. You should 
  25022. ensure that parent functions correctly handle error conditions. 
  25023.  
  25024. When using the ONERROR and ONCANCEL statements, make sure that they are at the 
  25025. beginning of the macro. If an error occurs before these statements, control may 
  25026. not transfer to the error or cancellation routines. 
  25027.  
  25028. Syntax 
  25029. ONERROR Label 
  25030. Label is the name of a label to which you should transfer control in case of 
  25031. error. 
  25032.  
  25033. Example 
  25034. The following is an example of the ONERROR and ONCANCEL statements: 
  25035.  FUNCTION main() 
  25036.  ONERROR ErrorRoutine 'set error routine 
  25037.  ONCANCEL CancelRoutine 'set cancel routine 
  25038.  Query$ ("Choose OK or CANCEL.") ' set up routine 
  25039.  CALL notthere() ' this causes an error, since macro not there 
  25040.  GOTO endit 
  25041.  CancelRoutine: 
  25042.  message ("You canceled the macro.") 
  25043.  GOTO endit 
  25044.  ErrorRoutine: 
  25045.  message ("There has been a macro error.") 
  25046.  endit: 
  25047.  END FUNCTION 
  25048.  
  25049. This macro defines program locations for error and cancel handling in lines 2 
  25050. and 3. It then asks the macro user to type in a value using the Query$ 
  25051. function, which has OK and Cancel buttons. If the user chooses OK, the macro 
  25052. attempts to call a nonexistent macro named  notthere in line 5. This causes a 
  25053. jump to the error routine in line 10. If the user chooses cancel in the Query$ 
  25054. function, the program jumps to the cancel routine in line 7. 
  25055.  
  25056. See also: 
  25057.  
  25058.     Ami Pro Macro Language Contents 
  25059.     Using Macro Programming Statements 
  25060.     Using the ONCANCEL Statement 
  25061.  
  25062.  
  25063.  
  25064.  
  25065.  
  25066. ΓòÉΓòÉΓòÉ 693. Using the SWITCH and CASE statements ΓòÉΓòÉΓòÉ
  25067.  
  25068. In a macro function, the lines of code are usually executed in the order they 
  25069. appear. You can divert the flow of execution through unconditional branching. A 
  25070. SWITCH statement behaves like multiple IF statements for one variable. 
  25071. Depending on the value of the variable, control can be transferred to different 
  25072. sections of the macro. 
  25073.  
  25074.  
  25075. The SWITCH and CASE statements work together to execute a series of program 
  25076. steps based on the value of a single variable. These statements are similar to 
  25077. the IF/ELSEIF statements. The major difference is that while you can execute 
  25078. different statements based on the values of different variables using the IF 
  25079. statement (IF a = 1 then ... ELSEIF b = 2 ... ELSEIF c = 3 ... ), all of the 
  25080. statements executed with a CASE statement depend on the variable defined in the 
  25081. SWITCH statement. 
  25082.  
  25083. When the macro encounters the SWITCH statement, the value of Variable is 
  25084. stored. This value is then compared to the expression in the first CASE 
  25085. statement. If they are equal, the statements between that CASE statement and 
  25086. the next CASE statement, the DEFAULT statement, or the ENDSWITCH statement, 
  25087. whichever comes first, is executed. Control then passes to the first statement 
  25088. beyond the ENDSWITCH statement. If the variable and the CASE expression are not 
  25089. equal, the statements are not executed. The program continues to the next CASE 
  25090. statement, which is evaluated in the same way. 
  25091.  
  25092. If none of the CASE expressions matched the variable by the time the DEFAULT 
  25093. statement is encountered, the statements between the DEFAULT and ENDSWITCH 
  25094. statements are executed. If there is no DEFAULT statement, control passes to 
  25095. the first statement beyond the ENDSWITCH statement. 
  25096.  
  25097. Syntax 
  25098. SWITCH Variable 
  25099.    CASE Expression1 
  25100.       Statements1 
  25101.    [CASE Expression2 
  25102.       Statements2...] 
  25103.    [DEFAULT 
  25104.       Statements3] 
  25105. ENDSWITCH 
  25106. Variable is a defined variable name that is compared to the expressions in the 
  25107. CASE statements. 
  25108. Expression1 is an expression that is compared to Variable. 
  25109. Statements1 are program statements that are executed if Variable is equal to 
  25110. Expression1. 
  25111. Expression2 is an expression that is compared to Variable. 
  25112. Statements2 are program statements that are executed if Variable is equal to 
  25113. Expression2. 
  25114. Statements3 are program statements that are executed if none of the expressions 
  25115. in any CASE statement is equal to Variable. 
  25116.  
  25117. Example 
  25118. The following example counts the frequency of occurrence of four words in a 
  25119. document and reports the percentage of each word used: 
  25120.  FUNCTION wordfreq() 
  25121.  word1 = Query$ ("Type the first word:") 
  25122.  word2 = Query$ ("Type the second word:") 
  25123.  word3 = Query$ ("Type the third word:") 
  25124.  word4 = Query$ ("Type the fourth word:") 
  25125.  DraftMode()' put in DraftMode 
  25126.  TYPE ("[ctrlhome]") ' go to top of file 
  25127.  w1cnt = 0 ' initialize counters 
  25128.  w2cnt = 0 
  25129.  w3cnt = 0 
  25130.  w4cnt = 0 
  25131.  ocnt = 0 
  25132.  loop: 'loop point for each word 
  25133.  word = CurWord$()  ' get word contents 
  25134.  SWITCH word 
  25135.     CASE (word1) ' if a match 
  25136.        w1cnt = w1cnt + 1 ' bump word count 
  25137.     CASE (word2) 
  25138.        w2cnt = w2cnt + 1 
  25139.     CASE (word3) 
  25140.        w3cnt = w3cnt + 1 
  25141.     CASE (word4) 
  25142.        w4cnt = w4cnt +1 
  25143.     default 
  25144.        ocnt = ocnt +1 ' didn't match our words 
  25145.  ENDSWITCH 
  25146.  TYPE ("[ctrlright]") ' to next word 
  25147.  IF (0 = AtEOF()) ' at the end of the file yet ? 
  25148.     GOTO loop ' no; continue 
  25149.  ENDIF 
  25150.  totcount = w1cnt + w2cnt + w3cnt + w4cnt + ocnt 
  25151.  p1 = (w1cnt / totcount) * 100 
  25152.  p1 = FormatNum$ ("", "", 2, p1) 
  25153.  p2 = (w2cnt / totcount) * 100 
  25154.  p2 = FormatNum$ ("", "", 2, p2) 
  25155.  p3 = (w3cnt / totcount) * 100 
  25156.  p3 = FormatNum$ ("", "", 2, p3) 
  25157.  p4 = (w4cnt / totcount) * 100 
  25158.  p4 = FormatNum$ ("", "", 2, p4) 
  25159.  message ("There are {w1cnt} cases of {word1}, or {p1}%") 
  25160.  message ("There are {w2cnt} cases of {word2}, or {p2}%") 
  25161.  message ("There are {w3cnt} cases of {word3}, or {p3}%") 
  25162.  message ("There are {w4cnt} cases of {word4}, or {p4}%") 
  25163.  message ("Total words in document: {totcount}") 
  25164.  END FUNCTION 
  25165.  
  25166. Lines 2 - 5 of this macro ask the macro user for the four words to be counted 
  25167. using the Query$ function and assign values to the variables word1 to word4. 
  25168. Line 6 uses the macro function DraftMode to put Ami Pro in Draft Mode, which 
  25169. speeds up processing of the macro. Lines 8 through 12 define the variables used 
  25170. for counters and initializes them to 0. After these setup statements, the body 
  25171. of the macro loop begins with the macro function getword in line 14, which gets 
  25172. the current word in the document, and places its value in the variable word. 
  25173.  
  25174. Line 15 of the macro is the SWITCH statement. It sets the value of the variable 
  25175. the following CASE statements use to compare to the value of word. The CASE 
  25176. statement in line 16 compares the value of word to word1, the first word whose 
  25177. frequency we are trying to count. If there is a match, then the counter for the 
  25178. first word is incremented, and control jumps to line 27 following the ENDSWITCH 
  25179. statement. If not, control passes to the following line where the value of word 
  25180. is compared to the second word we are counting, and so forth. If a match is not 
  25181. found by line 24, the default case, the program increments the counter of 
  25182. other, non-matched words in the document. The ENDSWITCH statement in line 26 
  25183. indicates the end of the SWITCH statement. 
  25184.  
  25185. Line 27 advances the insertion point to the next word and lines 28 - 30 jump 
  25186. back to line 13. The process is repeated for the following word in the file 
  25187. until the entire file has been examined. Line 31 adds the count of each word 
  25188. type together to determine the total number of words in the document. Lines 32 
  25189. - 39 calculate the average usage for each of the words, and use the FormatNum$ 
  25190. macro function to format the numbers as percentages. Finally, lines 40 - 44 
  25191. display the result of the word frequency count to the user. 
  25192.  
  25193. See also: 
  25194.  
  25195.     Ami Pro Macro Language Contents 
  25196.     Using Macro Programming Statements 
  25197.     Using the IF/THEN Statements 
  25198.  
  25199.  
  25200. ΓòÉΓòÉΓòÉ 694. Using the WHILE statement ΓòÉΓòÉΓòÉ
  25201.  
  25202. Looping allows repetitive tasks to be coded once and executed repeatedly until 
  25203. a certain condition becomes true or until an event occurs. The WHILE/END 
  25204. structure executes the lines of code between WHILE and WEND as long as a 
  25205. certain expression evaluates true. As soon as that expression evaluates false, 
  25206. control transfers to the first line of code after WEND. 
  25207.  
  25208.  
  25209. The WHILE statement is useful if you want to ensure that some condition has 
  25210. been fulfilled before continuing with other steps in the macro. 
  25211.  
  25212. When the WHILE statement is encountered in a macro program, the condition 
  25213. specified in condition is evaluated. If the condition evaluates to TRUE, then 
  25214. the statements between the WHILE and WEND statements are executed. If the 
  25215. condition is false, macro execution continues beyond the WEND statement. 
  25216. Following execution of the statements, the program goes back to the WHILE 
  25217. statement and reevaluates the condition. As long as the condition remains TRUE, 
  25218. the statements through the WEND statement continue to be executed. 
  25219.  
  25220. The statements between a WHILE/WEND loop are not executed at all if the 
  25221. condition specified in the WHILE statement is FALSE when first evaluated. It is 
  25222. also possible to create an infinite loop in a WHILE/WEND loop if the statements 
  25223. between them do not affect the condition in the WHILE statement. 
  25224.  
  25225. Syntax 
  25226. WHILE (Condition) 
  25227.    Statements 
  25228. WEND 
  25229. Condition is a condition that evaluates to either TRUE or FALSE. 
  25230. Statements are macro program statements. 
  25231.  
  25232. Example 
  25233. The following example illustrates using the WHILE loop in a macro to count the 
  25234. number of characters. 
  25235.  FUNCTION wc() 
  25236.  DraftMode() ' ensure we are in DraftMode 
  25237.  TYPE ("[ctrlhome]") ' go to top of file 
  25238.  counter = 0 ' initialize counter 
  25239.  WHILE (NOT(AtEOF())) ' as long as not at end of file 
  25240.     counter = counter +1 
  25241.     TYPE ("[right]") ' ahead a character 
  25242.  WEND 
  25243.  message ("There are {counter} characters in the file.") 
  25244.  END FUNCTION 
  25245.  
  25246. Line 2 of this macro changes Ami Pro to Draft Mode for faster operation, line 3 
  25247. positions the insertion point at the beginning of the file, and line 4 
  25248. initializes the counter variable to 0. Line 5, the WHILE statement, tells the 
  25249. macro to execute the following statements as long as the insertion point is not 
  25250. at the end of the file. Lines 6 and 7 form the loop of the WHILE statement, 
  25251. incrementing the counter and advancing to the next word in the file. The WEND 
  25252. statement in line 8 tells the macro to go to the WHILE statement and repeat the 
  25253. loop. Line 9 displays the character count to the user, and line 10 ends the 
  25254. macro. 
  25255.  
  25256. See also: 
  25257.  
  25258.     Ami Pro Macro Language Contents 
  25259.     Using Macro Programming Statements 
  25260.  
  25261.  
  25262.  
  25263.  
  25264.  
  25265. ΓòÉΓòÉΓòÉ 695. Using Variables ΓòÉΓòÉΓòÉ
  25266.  
  25267. Variables are named place holders that can be assigned values. The values of a 
  25268. variable can be changed while the macro is running. 
  25269.  
  25270.  
  25271. Before you can use a variable, you must define it. By defining it, you tell the 
  25272. macro that the variable exists. While you must formally dimension array 
  25273. variables, you can formally or implicitly declare single element variables. The 
  25274. limit for string variables is 498 characters. 
  25275.  
  25276. You can use both local single element variables and array variables in macro 
  25277. programs, but only in the macro that creates them. The macro language provides 
  25278. functions that allow for creation and maintenance of global variables that any 
  25279. macro can use during an Ami Pro session. 
  25280.  
  25281. In Ami Pro, you can access global variables by name or by number. Ami Pro does 
  25282. not have different variable types, such as integers, floating point numbers, 
  25283. and characters. Ami Pro stores each variable as a string and converts the 
  25284. string to the appropriate numeric type when running the macro. 
  25285.  
  25286. When you reference a variable in an arithmetic expression, Ami Pro converts it 
  25287. to integer or floating point format and then processes it. Because Ami Pro does 
  25288. not evaluate variable contents until needed, variables that do not contain 
  25289. numbers cause run-time errors if you use them in arithmetic expressions. 
  25290.  
  25291. You can pass the address of a variable or array to a routine. This allows a 
  25292. subroutine to modify the calling routine╨ós variable. This is useful when a 
  25293. subroutine needs to "return" more than one value. For example, to pass its 
  25294. address use the "&" directly before the variable: 
  25295. passvar(&myvar) 
  25296.  
  25297. This would pass the address of the variable myvar to subroutine passvar. 
  25298. Passvar does not declare this variable in any special way; however, to access 
  25299. it, the reference needs to have an "*" before the variable. The asterisk (*) 
  25300. and the ampersand (&) denote indirection. 
  25301.  
  25302. Example 
  25303.  FUNCTION passvar(pv) 
  25304.  *pv=*pv+1 
  25305.  END FUNCTION 
  25306.  
  25307. Here, passvar increments the caller's variable by one. 
  25308.  
  25309. To allow for variable indirection, use a semicolon to denote an end of 
  25310. statement. It is optional except when you use indirection. 
  25311.  
  25312. See also: 
  25313.  
  25314.     Ami Pro Macro Language Contents 
  25315.     Array Macro Functions 
  25316.     Declaring Formal Variables Using the DEFSTR Statement 
  25317.     Declaring Formal Variables Using the DIM Statement 
  25318.     Declaring Variables Implicitly 
  25319.     Identifying Strings as Variables 
  25320.     String Macro Functions 
  25321.     Understanding the Lifetime and Visibility of a Variable 
  25322.     Using Global Variables to Hold Values 
  25323.  
  25324.  
  25325. ΓòÉΓòÉΓòÉ 696. Declaring Formal Variables Using the DEFSTR Statement ΓòÉΓòÉΓòÉ
  25326.  
  25327. You can formally declare single element variables using the DEFSTR statement 
  25328. and array variables using the DIM statement. The most common use for DEFSTR is 
  25329. to declare a variable for use with indirection (&). 
  25330.  
  25331.  
  25332. The DIM statement does the same thing that the DEFSTR statement does, except 
  25333. that it defines an array variable, rather than a single element variable. It 
  25334. includes an expression that allows you to declare the number of elements in the 
  25335. array. Ami Pro evaluates the DIM statement each time and updates the contents 
  25336. of the array. 
  25337.  
  25338. Syntax 
  25339. DEFSTR Name1[, Name2]... 
  25340. Name1 and Name2 are the names of the variables you wish to define. 
  25341.  
  25342. Example 
  25343. The following example illustrates the use of the DEFSTR statement: 
  25344.  FUNCTION typeami() 
  25345.  DEFSTR progname 
  25346.  progname = "Ami Pro" 
  25347.  TYPE ("The name of this program is {progname}.") 
  25348.  END FUNCTION 
  25349.  
  25350. In this example, progname is a single element variable in line 2. Line 3 
  25351. assigns progname the value "Ami Pro", and in the fourth line, the TYPE function 
  25352. types a message to the screen with the variable name and other text. 
  25353.  
  25354. See also: 
  25355.  
  25356.     Ami Pro Macro Language Contents 
  25357.     Array Macro Functions 
  25358.     Using Variables 
  25359.     Declaring Formal Variables Using the DIM Statement 
  25360.     Declaring Variables Implicitly 
  25361.     Identifying Strings as Variables 
  25362.     Understanding the Lifetime and Visibility of a Variable 
  25363.     Using Global Variables to Hold Values 
  25364.  
  25365.  
  25366.  
  25367. ΓòÉΓòÉΓòÉ 697. Declaring Formal Variables Using the DIM statement ΓòÉΓòÉΓòÉ
  25368.  
  25369. You can formally declare single element variables using the DEFSTR statement 
  25370. and array variables using the DIM statement. The most common use for DEFSTR is 
  25371. to declare a variable for use with indirection (&). 
  25372.  
  25373.  
  25374. The DIM statement does the same thing that the DEFSTR statement does, except 
  25375. that it defines an array variable, rather than a single element variable. It 
  25376. includes an expression that allows you to declare the number of elements in the 
  25377. array. Ami Pro evaluates the DIM statement each time and updates the contents 
  25378. of the array. 
  25379.  
  25380. Syntex 
  25381. DIM array1 (count1)[ array2 (count2)]... 
  25382. Array1 and array2 are the names of the arrays to be dimensioned. 
  25383. Count1 is the maximum number of elements in array1. 
  25384. Count2 is the maximum number of elements in array2. 
  25385.  
  25386. Example 
  25387. The following example illustrates the use of the DIM statement to define an 
  25388. array: 
  25389.  FUNCTION typenames() 
  25390.  DIM names(4) 
  25391.  names(1) = "Cassie Conners" 
  25392.  names(2) = "David Zane" 
  25393.  names(3) = "Cris Walker" 
  25394.  names(4) = "Peyton Myers" 
  25395.  FOR count = 1 to 4 
  25396.    curname = names(count) 
  25397.    TYPE ("Name number {count} is {curname}.[ENTER]") 
  25398.  NEXT 
  25399.  END FUNCTION 
  25400.  
  25401. Line 2 of this macro declares that there are four elements in the array names. 
  25402. Lines 3 ╨º 6 assign each element of the array a string value. Line 7 sets up a 
  25403. FOR/NEXT loop with four iterations. Line 8 assigns the value of the current 
  25404. element in the names array to the variable curname. Then, line 9 types the text 
  25405. into the current file, followed by the ENTER key, which ends the paragraph. 
  25406. Lines 10 and 11 end the FOR loop and the macro. 
  25407.  
  25408. See also: 
  25409.  
  25410.     Ami Pro Macro Language Contents 
  25411.     Array Macro Functions 
  25412.     Using Variables 
  25413.     Declaring Formal Variables Using the DEFSTR Statement 
  25414.     Declaring Variables Implicitly 
  25415.     Identifying Strings as Variables 
  25416.     String Macro Functions 
  25417.     Understanding the Lifetime and Visibility of a Variable 
  25418.     Using Global Variables to Hold Values 
  25419.  
  25420.  
  25421. ΓòÉΓòÉΓòÉ 698. Declaring Variables Implicitly ΓòÉΓòÉΓòÉ
  25422.  
  25423. You do not have to declare single element variables formally. You can 
  25424. implicitly declare a single element variable by assigning it a value within the 
  25425. macro. You cannot implicitly dimension array variables. The only way to tell 
  25426. the macro program how many elements to expect in the array is to dimension it. 
  25427.  
  25428.  
  25429. Example 
  25430.  FUNCTION main () 
  25431.  your name = Query $ ("What is your name?") 
  25432.  Message ("Your name is {your name}.") 
  25433.  END FUNCTION 
  25434.  
  25435. This macro implicitly declares the single element variable, your name, on Line 
  25436. 2. Line 3 displays a dialog box with the variable your name. 
  25437.  
  25438. See also: 
  25439.  
  25440.     Ami Pro Macro Language Contents 
  25441.     Array Macro Functions 
  25442.     Using Variables 
  25443.     Declaring Formal Variables Using the DEFSTR Statement 
  25444.     Declaring Formal Variables Using the DIM Statement 
  25445.     Identifying Strings as Variables 
  25446.     Understanding the Lifetime and Visibility of a Variable 
  25447.     Using Global Variables to Hold Values 
  25448.  
  25449.  
  25450.  
  25451.  
  25452. ΓòÉΓòÉΓòÉ 699. Identifying Strings as Variables ΓòÉΓòÉΓòÉ
  25453.  
  25454. Many macro functions accept strings as their arguments. You can incorporate 
  25455. single element variables into strings by surrounding them with curly braces ({ 
  25456. }). Consider the following line of macro code: 
  25457.  
  25458. TYPE ("The first item on the list is {item}") 
  25459.  
  25460. In this example, the macro knows when to type the word 'item' and when to use 
  25461. the variable referenced by the name 'item'. By placing curly braces around the 
  25462. variable name when you use it as part of a string, you use the contents of the 
  25463. variable rather than its name. 
  25464.  
  25465. You can also use curly braces around a single element variable name at any time 
  25466. to improve the clarity of the macro. Using curly braces around variable names 
  25467. indicates that the word inside the braces is a variable name rather than 
  25468. something else. 
  25469.  
  25470. You cannot use curly braces around array variables. 
  25471.  
  25472. See also: 
  25473.  
  25474.     Ami Pro Macro Language Contents 
  25475.     Array Macro Functions 
  25476.     Using Variables 
  25477.     Declaring Formal Variables Using the DEFSTR Statement 
  25478.     Declaring Formal Variables Using the DIM Statement 
  25479.     Declaring Variables Implicitly 
  25480.     String Macro Functions 
  25481.     Understanding the Lifetime and Visibility of a Variable 
  25482.     Using Global Variables to Hold Values 
  25483.  
  25484.  
  25485.  
  25486.  
  25487. ΓòÉΓòÉΓòÉ 700. Understanding the lifetime and visibility of a variable ΓòÉΓòÉΓòÉ
  25488.  
  25489. The lifetime of a variable refers to the time that the variable maintains its 
  25490. value. This is usually as long as the macro function is running. The exception 
  25491. is the global variable, which retains its value during the entire Ami Pro 
  25492. session. 
  25493.  
  25494.  
  25495. The visibility of a variable refers to macro functions that recognize the 
  25496. variable. 
  25497.  
  25498. Within Ami Pro, each variable is visible only to the macro that defined it and 
  25499. lasts only for the duration of that macro. This means that if one macro calls 
  25500. another macro as a function, the variables in the calling macro are not 
  25501. available to, and cannot be modified by, the called macro. In addition, if a 
  25502. macro finishes running with certain values stored in variables, running the 
  25503. macro a second time reinitializes the variables and loses previously existing 
  25504. values. 
  25505.  
  25506. When one macro calls another macro as a function, it can pass arguments to the 
  25507. called macro, which are usually variables from the parent macro. When this 
  25508. happens, Ami Pro makes a copy of each variable and passes the copy to the 
  25509. function. Since the function only receives a copy of the original, the function 
  25510. cannot modify the original variable. The function can return a value to the 
  25511. calling macro, and you can assign that value to a variable within the calling 
  25512. macro. 
  25513.  
  25514. Example 
  25515. The following example illustrates passing variables to functions: 
  25516.  FUNCTION main() 
  25517.  var1 = "original value, main macro" 
  25518.  TYPE ("{var1}[ENTER]") 
  25519.  CALL upcase (var1) 
  25520.  TYPE ("{var1}[ENTER]") 
  25521.  var1 = CALL upcase (var1) 
  25522.  TYPE ("{var1}[ENTER]") 
  25523.  END FUNCTION 
  25524.  
  25525.  FUNCTION upcase( var2) 
  25526.  TYPE("original value, upcase macro[ENTER]") 
  25527.  var3 = UCASE$( var2) 
  25528.  TYPE ("{ var2}[ENTER]") 
  25529.  upcase =  var3 
  25530.  END FUNCTION 
  25531.  
  25532. The output from the above macro is as follows: 
  25533. 1  original value, main macro 
  25534. 2  original value, upcase macro 
  25535. 3  original value, main macro 
  25536. 4  original value, main macro 
  25537. 5  original value, upcase macro 
  25538. 6  original value, main macro 
  25539.  7  ORIGINAL VALUE, MAIN MACRO 
  25540.  
  25541. The first line of output comes from line 3 of the main macro, and displays the 
  25542. original value of var1 as defined in the main macro. Line 3 of the output comes 
  25543. from line 13 of the upcase macro. Even though var2 passes as an argument to the 
  25544. UCASE$ function (which uppercases the argument), its value has not changed. 
  25545. Line 4 of the output is from line 5 of the main macro, and illustrates again 
  25546. that passing an argument to another macro does not affect the value of that 
  25547. argument once it has returned to the main macro. 
  25548.  
  25549. Lines 5 and 6 of the output show another iteration of the upcase macro, and 
  25550. have the same results as occurred the first time through. Line 7 of the output 
  25551. is from line 7 of the main macro, and shows that the var1 string from the main 
  25552. macro became uppercase when assigned the result of the upcase macro in line 6. 
  25553.  
  25554. See also: 
  25555.  
  25556.     Ami Pro Macro Language Contents 
  25557.     Using Variables 
  25558.     Declaring Formal Variables Using the DEFSTR Statement 
  25559.     Declaring Formal Variables Using the DIM Statement 
  25560.     Declaring Variables Implicitly 
  25561.     Identifying Strings as Variables 
  25562.     Using Global Variables to Hold Values 
  25563.  
  25564.  
  25565.  
  25566.  
  25567. ΓòÉΓòÉΓòÉ 701. Using global variables to hold values ΓòÉΓòÉΓòÉ
  25568.  
  25569. Global variables are like safety deposit boxes that you can use to store 
  25570. information when it is not in use. When a macro needs to store information for 
  25571. later use, it creates a global variable and assigns the value of the program 
  25572. variable to the global variable. Later, another macro, or another instance of 
  25573. the same macro, can retrieve the value of the global variable, assign it to a 
  25574. variable name in the macro, and use or change it as needed. 
  25575.  
  25576.  
  25577. See also: 
  25578.  
  25579.     Ami Pro Macro Language Contents 
  25580.     Using Variables 
  25581.     Declaring Formal Variables Using the DEFSTR Statement 
  25582.     Declaring Formal Variables Using the DIM Statement 
  25583.     Declaring Variables Implicitly 
  25584.     Identifying Strings as Variables 
  25585.     Understanding the Lifetime and Visibility of a Variable 
  25586.  
  25587.  
  25588.  
  25589.  
  25590. ΓòÉΓòÉΓòÉ 702. Using Numbers, Strings, and Operators ΓòÉΓòÉΓòÉ
  25591.  
  25592. An expression is a combination of numbers, strings, variables, and operators 
  25593. used to determine a result. You can assign the result to a variable, use it as 
  25594. an argument to a function or macro, return it as the result of a macro, or use 
  25595. it to determine whether or not to execute a macro routine. 
  25596.  
  25597.  
  25598. Examples 
  25599. Some examples of expressions are: 
  25600.  var 
  25601.  var + var1 
  25602.  var1 | var2 
  25603.  var * 3 >var2 
  25604.  var < 10 AND var >0 
  25605.  
  25606. In line 1, the expression is a single element variable. If you do not use 
  25607. operators in the expression, the result of the expression is the variable or 
  25608. constant. In line 2, the expression uses the mathematical operator + to add two 
  25609. variables together. Line 3 uses the bitwise OR operator | to "OR" the bit 
  25610. values of var1 and var2. Line 4 uses the relational operator > to compare two 
  25611. values. Line 5 uses the logical operator AND to compare two logical values to 
  25612. determine the result. 
  25613.  
  25614. Operators are either mathematical, relational, or logical, and operate on the 
  25615. other elements of the expression to determine the result. 
  25616.  
  25617. The four types of operators are Mathematical Operators, Bitwise Operators, 
  25618. Relational Operators, and Relational Operators. 
  25619.  
  25620. See also: 
  25621.  
  25622.     Ami Pro Macro Language Contents 
  25623.     Understanding Operator Precedence 
  25624.     Using Mathematical Operators 
  25625.     Using Bitwise Operators 
  25626.     Using Relational Operators 
  25627.     Using Logical Operators 
  25628.  
  25629.  
  25630. ΓòÉΓòÉΓòÉ 703. Understanding operator precedence ΓòÉΓòÉΓòÉ
  25631.  
  25632. Ami Pro evaluates expressions with multiple operators by first performing 
  25633. operations with a higher precedence, followed by operations with a lower 
  25634. precedence. If two operations have the same precedence, Ami Pro evaluates from 
  25635. left to right. 
  25636.  
  25637.  
  25638. The precedence of operators is: 
  25639.     NOT 
  25640.     Multiplication and Division 
  25641.     Addition and Subtraction 
  25642.     Bitwise AND and Bitwise OR 
  25643.     Greater Than, Less Than, Greater Than or Equal To, Less Than or Equal To 
  25644.     Equal To and Not Equal To 
  25645.     AND and OR 
  25646.  
  25647. You can use parentheses to determine the order of expression evaluation. If you 
  25648. use parentheses, Ami Pro first evaluates expressions inside the innermost set 
  25649. of parentheses, followed by the next set of parentheses, etc. 
  25650.  
  25651. If you use two operators in a row, you must separate the operators by 
  25652. parentheses. 
  25653.  
  25654. Example 
  25655. The following examples illustrate expression evaluation. Some of the examples 
  25656. use parentheses to change the evaluation order. 
  25657. var > var1    'is true if var > var1 
  25658. var = 4       'is true if var = 4 
  25659. name < "Jones"       'is true if name is anything besides Jones 
  25660. var + var1 <= var2 * var3 
  25661. var > var1 AND var1 < 10 
  25662. var <>0 OR (NOT IsNumeric(var))    'two operands in a row 
  25663. (c >= "A" AND c <= "Z") OR (c >= "a" AND c <= "z") 
  25664. 'determines if the variable c is alphabetic 
  25665. var = 0 AND (IsNumeric(var1) OR IsNumeric (var2)) OR var3 >0 
  25666. ' true if var3 >0 or if var = 0 and either var1 or var2 is numeric 
  25667. var = 0 AND ((IsNumeric(var1) OR IsNumeric (var2)) OR var3 >0) 
  25668. ' true if var = 0 and either var1 or var2 is numeric or var3 >0 
  25669.  
  25670. See also: 
  25671.  
  25672.     Ami Pro Macro Language Contents 
  25673.     Using Numbers, Strings, and Operators 
  25674.     Using Mathematical Operators 
  25675.     Using Bitwise Operators 
  25676.     Using Relational Operators 
  25677.     Using Logical Operators 
  25678.  
  25679.  
  25680. ΓòÉΓòÉΓòÉ 704. Using mathematical operators ΓòÉΓòÉΓòÉ
  25681.  
  25682. Mathematical operators include addition, subtraction, multiplication, and 
  25683. division. 
  25684.  
  25685.  
  25686. The mathematical operators are: 
  25687.     Name (Character) - Definition 
  25688.     Multiplication (*) - Multiplies the value to the left of the operator by 
  25689.     the value to the right of the operator. 
  25690.     Division (/) - Divides the value to the left of the operator by the value 
  25691.     to the right of the operator. 
  25692.     Addition (+) - Adds the value to the left of the operator to the value to 
  25693.     the right of the operator. 
  25694.     Subtraction (-) - Subtracts the value to the right of the operator from the 
  25695.     value to the left of the operator. 
  25696.  
  25697. Values used by mathematical operators must be numeric, otherwise a runtime 
  25698. macro error can result. 
  25699.  
  25700. See also: 
  25701.  
  25702.     Ami Pro Macro Language Contents 
  25703.     Using Numbers, Strings, and Operators 
  25704.     Understanding Operator Precedence 
  25705.     Using Bitwise Operators 
  25706.     Using Relational Operators 
  25707.     Using Logical Operators 
  25708.  
  25709.  
  25710.  
  25711.  
  25712. ΓòÉΓòÉΓòÉ 705. Using bitwise operators ΓòÉΓòÉΓòÉ
  25713.  
  25714. Bitwise operators include the bitwise AND and the bitwise OR. 
  25715.  
  25716.  
  25717. The bitwise operators are: 
  25718.     Name (Character) - Definition 
  25719.     Bitwise AND (&) - Performs a logical AND between each bit of the value to 
  25720.     the left of the operator and the value to the right of the operator. 
  25721.     Bitwise OR (|) - Performs a logical OR between each bit of the value to the 
  25722.     left of the operator, and the value to the right of the operator. 
  25723.  
  25724. Values used by bitwise operators must be integers or a runtime macro error can 
  25725. result. Bitwise operators, which compare each bit of a value, are not the same 
  25726. as logical operators, which compare the entire value. 
  25727.  
  25728. See also: 
  25729.  
  25730.     Ami Pro Macro Language Contents 
  25731.     Using Numbers, Strings, and Operators 
  25732.     Understanding Operator Precedence 
  25733.     Using Mathematical Operators 
  25734.     Using Relational Operators 
  25735.     Using Logical Operators 
  25736.  
  25737.  
  25738. ΓòÉΓòÉΓòÉ 706. Using relational operators ΓòÉΓòÉΓòÉ
  25739.  
  25740. Relational operators include equality, greater than, less than, greater than or 
  25741. equal to, less than or equal to, or not equal to. 
  25742.  
  25743.  
  25744. The relational operators are: 
  25745.     Name (Character) - Definition 
  25746.     Equals (=) - Compares the value to the left of the operand and the value to 
  25747.     the right of the operand. The result of the comparison is TRUE if the 
  25748.     values are equal. 
  25749.     Greater Than (>) - Compares the value to the left of the operand and the 
  25750.     value to the right of the operand. The result is TRUE if the value to the 
  25751.     left is greater than the value to the right. 
  25752.     Less Than (<) - Compares the value to the left of the operand and the value 
  25753.     to the right of the operand. The result is TRUE if the value to the left is 
  25754.     less than the value to the right. 
  25755.     Greater Than or Equal To (>=) - Compares the value to the left of the 
  25756.     operand and the value to the right of the operand. The result is TRUE if 
  25757.     the value to the left is greater than or equal to the value to the right. 
  25758.     Less Than or Equal To (<=) - Compares the value to the left of the operand 
  25759.     and the value to the right of the operand. The result is TRUE if the value 
  25760.     to the left is less than or equal to the value to the right. 
  25761.     Not Equal To (<> or !=) - Compares the value to the left of the operand and 
  25762.     the value to the right of the operand. The result is TRUE if the value to 
  25763.     the left is not equal to the value to the right. 
  25764.  
  25765. Values used by relational operators can be strings, numbers, or expressions. 
  25766.  
  25767. See also: 
  25768.  
  25769.     Ami Pro Macro Language Contents 
  25770.     Using Numbers, Strings, and Operators 
  25771.     Understanding Operator Precedence 
  25772.     Using Mathematical Operators 
  25773.     Using Bitwise Operators 
  25774.     Using Logical Operators 
  25775.  
  25776.  
  25777.  
  25778.  
  25779. ΓòÉΓòÉΓòÉ 707. Using logical operators ΓòÉΓòÉΓòÉ
  25780.  
  25781. Logical operators are: 
  25782.  
  25783.     Logical And (AND) - Logically compares the value to the left of the operand 
  25784.     with the value to the right of the operand. The result is TRUE if both 
  25785.     expressions evaluate to TRUE. 
  25786.     Logical Or (OR) - Logically compares the value to the left of the operand 
  25787.     with the value to the right of the operand. The result is TRUE if either 
  25788.     expression evaluates to TRUE. 
  25789.     Logical Not (NOT) - Evaluates the value to the right of the operand. The 
  25790.     result is TRUE if the expression evaluates to FALSE. The result is FALSE if 
  25791.     the expression evaluates to TRUE. 
  25792.  
  25793. Values used by logical operators can be integers, numbers, strings or 
  25794. expressions. If the value is equal to 0 or to the null string (""), it is 
  25795. FALSE. If it is anything else, it is TRUE. 
  25796.  
  25797. See also: 
  25798.  
  25799.     Ami Pro Macro Language Contents 
  25800.     Using Numbers, Strings, and Operators 
  25801.     Understanding Operator Precedence 
  25802.     Using Mathematical Operators 
  25803.     Using Bitwise Operators 
  25804.     Using Relational Operators 
  25805.  
  25806.  
  25807. ΓòÉΓòÉΓòÉ 708. Using Constants ΓòÉΓòÉΓòÉ
  25808.  
  25809. A constant expression is an expression whose value does not change for the 
  25810. duration of the macro program. Normally, constants are strings of text that the 
  25811. macro uses. 
  25812.  
  25813.  
  25814. There are two types of constants: defined and predefined. You create defined 
  25815. constants in your macro. Ami Pro provides predefined constants you may use in 
  25816. your macro. 
  25817.  
  25818. See also: 
  25819.  
  25820.     Ami Pro Macro Language Contents 
  25821.     Defining Constants 
  25822.     Predefining Constants 
  25823.  
  25824.  
  25825.  
  25826.  
  25827. ΓòÉΓòÉΓòÉ 709. Defining constants ΓòÉΓòÉΓòÉ
  25828.  
  25829. A constant expression is normally a string of text in a macro. There are 
  25830. several characters that you need to represent in a special manner so that Ami 
  25831. Pro can recognize them within strings. These characters are the left curly 
  25832. brace ({), the left square brace ([), and the double quotation mark ("). 
  25833.  
  25834.  
  25835. Because curly braces surround variable names in strings, you must type two 
  25836. curly braces to type a curly brace within a string. Use the TYPE function to 
  25837. represent key names in strings. Since square braces surround a key name, you 
  25838. must type two square braces to represent a square brace within a string. 
  25839.  
  25840. Double quotation marks surround strings to define their boundaries. To type a 
  25841. double quotation mark within a string, you must type two quotation marks in a 
  25842. row. You do not need to type two right curly braces or two right square braces 
  25843. when you are using them in strings. 
  25844.  
  25845. Example 
  25846. The following example illustrates the representation of strings within a macro: 
  25847.  FUNCTION strings() 
  25848.  'a string assigned to a variable 
  25849.  var = "Variable" 
  25850.  'a typical string 
  25851.  TYPE ("This is a constant string of text. ") 
  25852.  'a string with a key name 
  25853.  TYPE ("This string has a key name inside it.[ENTER]") 
  25854.  'a string with a variable name 
  25855.  TYPE ("This string contains a variable with the value {var}. ") 
  25856.  'a string with curly braces embedded 
  25857.  TYPE ("The curly brace character, {{, is used to fence a variable. ") 
  25858.  'a string with a square brace character 
  25859.  TYPE ("The square brace character, [[, is used to fence a key name. ") 
  25860.  'a string with embedded quotes 
  25861.  TYPE ("Use quotation marks like this ""string"" to define a string.") 
  25862.  END FUNCTION 
  25863.  
  25864. The output of the macro looks like the following: 
  25865. This is a constant string of text. This string has a key name inside it. 
  25866.  
  25867. This string contains a variable with the value Variable. The curly brace 
  25868. character, {, fences a variable. The square brace character, [, fences a key 
  25869. name. Use quotation marks like this "string" to define a string. 
  25870.  
  25871. See also: 
  25872.  
  25873.     Ami Pro Macro Language Contents 
  25874.     Using Constants 
  25875.     Predefining Constants 
  25876.  
  25877.  
  25878. ΓòÉΓòÉΓòÉ 710. Predefining constants ΓòÉΓòÉΓòÉ
  25879.  
  25880. To make a macro more readable, you can use constants to represent values that 
  25881. do not change in a macro. Ami Pro uses a list of defined constants to perform 
  25882. substitutions when they are used in a macro. This list is most useful when 
  25883. using Ami Pro functions that require numeric arguments be given to them for 
  25884. interpretation. When the macro is compiled, the compiler substitutes the 
  25885. constant in the macro for the number in the list of defined constants, unless 
  25886. the name is inside a string. 
  25887.  
  25888.  
  25889. Many functions use flags as parameters to the function. A flag is a number that 
  25890. conveys a meaning to the function. By adding numbers together, a number can 
  25891. extract several different values when the macro runs. 
  25892.  
  25893. Example 
  25894. The following is an example of using predefined constants in a macro: 
  25895.  FUNCTION lineson() 
  25896.  flag = NumberLines+NumberEveryOther+ResetEachPage 
  25897.  ' compiles as flag = 1+4+16, so flag = 21 
  25898.  LineNumber (flag, "Body Text") 
  25899.  message ("Line Numbering On") 
  25900.  END FUNCTION 
  25901.  
  25902.  FUNCTION linesoff() 
  25903.  LineNumber (off, "Body Text") 
  25904.  ' compiles as LineNumber (0,"Body Text") 
  25905.  message ("Line Numbering Off") 
  25906.  END FUNCTION 
  25907.  
  25908. In this example, the two macros turn line numbering on and off in a file. The 
  25909. lineson macro turns on line numbering every other line. Then it resets the 
  25910. numbering to 1 on each page. The  linesoff macro turns off line numbering. 
  25911.  
  25912. One of the parameters to the LineNumber function is a flag that specifies which 
  25913. line numbering options to use. Ami Pro adds the numbers representing these 
  25914. options together and passes them to the function. The option to turn the 
  25915. numbering on is 1; the option to number every other line is 4, and the option 
  25916. to reset numbering each page is 16. You can use predefined constants to add 
  25917. these numbers and then place the total in the function call. This makes it 
  25918. clear exactly what the macro is doing. 
  25919.  
  25920. The macro uses the same procedure in the  linesoff macro. To turn numbering 
  25921. off, the macro uses a flag of 0. Since off is defined as 0 in the substitution 
  25922. list, this substitution makes the macro more readable. 
  25923.  
  25924. Ami Pro stores the substitution list in a glossary file named MACDEFIN.SAM in 
  25925. the Ami Pro directory (usually C:\AMIPRO). The file contains substitutions for 
  25926. predefined constant names. You can add to the glossary file. The glossary item 
  25927. name is the predefined constant name in the macro. Ami Pro substitutes the 
  25928. predefined constant name with the item. Neither the defined name nor the 
  25929. replacement can contain spaces. The defined name must begin with an alphabetic 
  25930. character and can contain only letters and numbers. 
  25931.  
  25932. If you modify this file, macros compiled under the modified MACDEFIN.SAM may 
  25933. not compile on other systems. Copy the MACDEFIN.SAM to the Ami Pro directory 
  25934. (usually C:\AMIPRO) to compile successfully. 
  25935.  
  25936. See also: 
  25937.  
  25938.     Ami Pro Macro Language Contents 
  25939.     Using Constants 
  25940.     Defining Constants 
  25941.  
  25942.  
  25943.  
  25944. ΓòÉΓòÉΓòÉ 711. Calling Built-In Functions and Other Macros ΓòÉΓòÉΓòÉ
  25945.  
  25946. To execute a subroutine, one macro can call another macro and then return a 
  25947. single value to the calling macro. Before a macro can call another macro, you 
  25948. can identify it prior to its first use with the DECLARE statement. You can also 
  25949. identify it with each use by using either the CALL or CALLI statement. 
  25950.  
  25951.  
  25952. It does not make any difference whether you use the DECLARE statement once at 
  25953. the beginning of a calling macro or you use the CALL or CALLI statement each 
  25954. time in the subroutine. 
  25955.  
  25956. When executing another macro, Ami Pro follows a search path to find the macro. 
  25957. You do not have to specify a full path to the macro. 
  25958.  
  25959. You can also call macro functions within a macro. You do not need to declare or 
  25960. call built-in functions. To use a built-in function, use its name. You can call 
  25961. Ami Pro functions by providing the parameters required for the function and 
  25962. having the function execute. You can also call an Ami Pro function by giving 
  25963. the function name without parentheses. This displays the dialog box for the 
  25964. function and then allows the macro user to choose the parameters for the 
  25965. function. 
  25966.  
  25967. See also: 
  25968.  
  25969.     Ami Pro Macro Language Contents 
  25970.     Calling Built-In Functions 
  25971.     Calling Ami Pro Functions 
  25972.     Determining the Location of a Macro When it is Run 
  25973.     Returning Values From Called Macros 
  25974.     Using the CALL and CALLI Statements 
  25975.     Using the DECLARE Statement 
  25976.  
  25977.  
  25978.  
  25979. ΓòÉΓòÉΓòÉ 712. Calling built-in functions ΓòÉΓòÉΓòÉ
  25980.  
  25981. The Ami Pro macro language offers a variety of functions you can call from 
  25982. within a macro. The macro language includes functions to control the execution 
  25983. of the macro, to allow interaction with the user, to allow interaction with the 
  25984. Ami Pro program itself, and to allow interaction with other programs using 
  25985. Dynamic Data Exchange (DDE) protocol. 
  25986.  
  25987.  
  25988. Syntax 
  25989. [Result = ]Function([Parm1][[,] [Parm2...]) 
  25990. Result is a variable that receives the return value of the function. 
  25991. Function is the name of the function you want to use. 
  25992. Parm1 and parm2 are the parameters required by the function, if any. 
  25993.  
  25994. Example 
  25995. The following macro uses the built-in functions GetDocPath$, SetDocPath, Decide 
  25996. and Query$ to get the user's default document path, display it, and to allow it 
  25997. to be changed: 
  25998.  FUNCTION changepath() 
  25999.  path = GetDocPath$()       ' gets current path 
  26000.  response = Decide ("Change Document Path From {path}?") 
  26001.  IF (response)       ' user said yes to dialog box 
  26002.     path = Query$ ("Type New Path:") 
  26003.     SetDocPath (path) 
  26004.  ENDIF 
  26005.  END FUNCTION 
  26006.  
  26007. Line 2 of the macro uses the GetDocPath$ function to get the current path. This 
  26008. line stores the result of this function in the variable path. Line 3 of the 
  26009. macro uses the Decide function to display a dialog box and ask the user if he 
  26010. wants to change his path. The Decide function requires one parameter, the 
  26011. prompt you should use in the dialog box. It returns either TRUE or FALSE, 
  26012. depending on whether the user chose Yes or No in the dialog box. This line 
  26013. assigns the return value from the Decide function to the variable response. If 
  26014. the user decided to change the path, the Query$ function in line 5 displays an 
  26015. edit box for the user to type the new path. This line returns the typed value 
  26016. and assigns it to the variable path. Finally, line 6 sets the new document path 
  26017. using the SetDocPath function. 
  26018.  
  26019. See also: 
  26020.  
  26021.     Ami Pro Macro Language Contents 
  26022.     Calling Built-In Functions and Other Macros 
  26023.     Calling Ami Pro Functions 
  26024.     Determining the Location of a Macro When it is Run 
  26025.     Returning Values From Called Macros 
  26026.  
  26027.  
  26028.  
  26029. ΓòÉΓòÉΓòÉ 713. Calling Ami Pro functions ΓòÉΓòÉΓòÉ
  26030.  
  26031. You can execute almost any Ami Pro function using a macro. You can access Ami 
  26032. Pro functions through pulldown menus that have equivalent functions in the 
  26033. macro language. 
  26034.  
  26035.  
  26036. When using an Ami Pro function, the macro can provide all the functions the 
  26037. program requires, which causes the function to automatically execute. The macro 
  26038. can also start the function and allow the user to make choices for that 
  26039. function in the dialog box. 
  26040.  
  26041. Syntax 
  26042. [Result = ]Function([Parm1][[,] [Parm2...]) 
  26043. Result is a variable that receives the return value of the function. 
  26044. Parm1 and Parm2 are the parameters required by the function, if any. 
  26045.  
  26046. The syntax for calling an Ami Pro function that prompts the user for parameters 
  26047. is: 
  26048. [Result = ] Function 
  26049. Function is the name of the function you want to use. 
  26050.  
  26051. Return Value 
  26052. 1 (TRUE) if the function completes successfully. 
  26053. 0 (FALSE) if the user canceled the function. 
  26054. -2 (GENERALFAILURE) if the state of the program prohibited the function at the 
  26055. time or the function could not complete for some other reason. 
  26056.  
  26057. Example 
  26058. The following macro sets the line spacing in the current document to single 
  26059. spacing: 
  26060.  FUNCTION singlespace() 
  26061.  result = Spacing(SpaceSingle) 
  26062.  IF (result <> TRUE) ' the spacing was not equal to single 
  26063.     message ("Failed to set single spacing.") 
  26064.  ENDIF 
  26065.  END FUNCTION 
  26066.  
  26067. In line 2, the Ami Pro function Spacing is called. The Spacing function takes a 
  26068. single argument, with the desired spacing. SpaceSingle is defined to -1, which 
  26069. is the correct value for single spacing. The result of the function is returned 
  26070. to the variable result. This variable is examined in line 4, and if the spacing 
  26071. change did not occur, an error message is displayed for the user. 
  26072.  
  26073. The following macro sets line spacing but allows the user to determine the 
  26074. desired spacing: 
  26075.  FUNCTION setspace() 
  26076.  result = Spacing 
  26077.  IF (result = false) 
  26078.     message ("Did not set spacing") 
  26079.  ENDIF 
  26080.  END FUNCTION 
  26081.  
  26082. In line 2, the macro calls the Spacing function without any parentheses. This 
  26083. causes the Line Spacing dialog box to display on the screen so the user can set 
  26084. the spacing. As in the previous example, this line assigned the result of the 
  26085. function call to the variable so that a message can display if the spacing did 
  26086. not change. 
  26087.  
  26088. See also: 
  26089.  
  26090.     Ami Pro Macro Language Contents 
  26091.     Calling Built-In Functions and Other Macros 
  26092.     Calling Built-In Functions 
  26093.     Determining the Location of a Macro When it is Run 
  26094.     Returning Values From Called Macros 
  26095.  
  26096.  
  26097. ΓòÉΓòÉΓòÉ 714. Determining the location of a macro when it is run ΓòÉΓòÉΓòÉ
  26098.  
  26099. Ami Pro uses a search path to find the location of the macros to execute. If a 
  26100. macro contains a full path specification, Ami Pro looks there. If there is no 
  26101. path specified, Ami Pro searches first the default macro directory, second the 
  26102. default document directory, and third the directory where Ami Pro stores 
  26103. program files (usually C:\AMIPRO). If Ami Pro can not find the macro in any of 
  26104. these locations, Ami Pro displays an error message. 
  26105.  
  26106.  
  26107. In an Ami Pro installation the default macro path is a subdirectory of the 
  26108. AMIPRO directory (usually C:\AMIPRO\MACROS). This directory may contain several 
  26109. example macros. Whenever the macros dialog box displays, it defaults to 
  26110. displaying macros in that directory. You can change this path by modifying the 
  26111. path in User Setup Paths, by editing the amiuser3.ini file, or by using the 
  26112. macro functions GetProfileString$ and WriteProfileString. 
  26113.  
  26114. If you write macros that other people may use, you may not know the final 
  26115. location of the macro file. If the macro calls another macro, assigns a macro 
  26116. to a menu to call later, or uses an external dialog box, then you may not be 
  26117. able to specify the path to the desired file. The macro search path allows you 
  26118. to specify only the file name and macro name and allows Ami Pro to find the 
  26119. macro file. 
  26120.  
  26121. Ami Pro does not use this search path when looking for an external dialog box, 
  26122. a dynamic link library (DLL), or other supporting files. If these supporting 
  26123. files are in the same directory as the macro that needs them, you can use the 
  26124. GetMacPath$ function to determine the default macro path. You can then use that 
  26125. path to locate the supporting macro files. To determine the name of the macro 
  26126. that is running, use the macro function, GetRunningMacroFile$. 
  26127.  
  26128. See also: 
  26129.  
  26130.     Ami Pro Macro Language Contents 
  26131.     Calling Built-In Functions and Other Macros 
  26132.     Calling Built-In Functions 
  26133.     Calling Ami Pro Functions 
  26134.     Returning Values From Called Macros 
  26135.     GetMacPath$ 
  26136.     GetProfileString$ 
  26137.     GetRunningMacroFile$ 
  26138.     WriteProfileString 
  26139.  
  26140.  
  26141.  
  26142. ΓòÉΓòÉΓòÉ 715. Returning values from called macros ΓòÉΓòÉΓòÉ
  26143.  
  26144. A called macro can return a value to the calling macro. The returned value can 
  26145. be a number or a string or it can be a status code to indicate the macro 
  26146. successfully completed. 
  26147.  
  26148.  
  26149. You should assign the value to return to the calling macro to a variable name 
  26150. with the same name as the called macro. When the called macro ends at the END 
  26151. FUNCTION or EXIT FUNCTION statement, the value of the variable with the same 
  26152. name as the called macro returns to the calling macro. 
  26153.  
  26154. If you need to have more than one value returned from a called function, use 
  26155. indirection (&). It passes the memory address of a variable to the called 
  26156. function. The called function may then directly modify the variable. When the 
  26157. called macro finishes, any modifications to the variable are reflected. You can 
  26158. pass any number of variables in this manner. 
  26159.  
  26160. Syntax 
  26161. Return(Value) 
  26162.  
  26163. Example 
  26164. The following is an example of returning a value from a called macro to the 
  26165. calling macro: 
  26166.  FUNCTION calc() 
  26167.  'this macro gets two numbers from the user, adds them together and displays 
  26168. the result. 
  26169.  num1 = Query$ ("Type the first number:") 
  26170.  num2 = Query$ ("Type the second number:") 
  26171.  result = CALL addit (num1, num2) 
  26172.  result2 = CALL subtractit (num1, num2) 
  26173.  message ("The sum of {num1} and {num2} is {result}.") 
  26174.  message("The difference between {num1} and {num2} is {result2}.") 
  26175.  END FUNCTION 
  26176.  
  26177.  FUNCTION addit(num1, num2) 
  26178.  addit = num1 + num2 
  26179.  END FUNCTION 
  26180.  
  26181.  FUNCTION subtractit(num1, num2) 
  26182.  Difference = num1 - num2 
  26183.  RETURN(Difference) 
  26184.  END FUNCTION 
  26185.  
  26186. In lines 3 and 4, the  calc macro uses the Query$ function to get the two 
  26187. numbers from the user. It then calls the  addit macro in line 5, and stores the 
  26188. return value in the variable result. Finally, the result displays in the 
  26189. message function in line 7. 
  26190.  
  26191. The  addit macro assigns the sum of the two variables to the variable addit and 
  26192. then ends. By assigning the sum to the variable with the same name as the 
  26193. macro, its value returns to the  calc macro. 
  26194.  
  26195. The Subtractit macro assigns the difference of the two variables to the 
  26196. variable subtractit and then ends. Its value returns to the Calc macro. By 
  26197. using the RETURN statement, the macro assigns the return value to a variable 
  26198. name that is different from the name of the called macro. 
  26199.  
  26200. See also: 
  26201.  
  26202.     Ami Pro Macro Language Contents 
  26203.     Calling Built-In Functions and Other Macros 
  26204.     Calling Built-In Functions 
  26205.     Calling Ami Pro Functions 
  26206.     Determining the Location of a Macro When it is Run 
  26207.     Using the END FUNCTION Statement 
  26208.     Using the EXIT FUNCTION Statement 
  26209.     Query$ 
  26210.  
  26211.  
  26212. ΓòÉΓòÉΓòÉ 716. Integrating REXX Commands ΓòÉΓòÉΓòÉ
  26213.  
  26214. REXX is the OS/2 batch file programming language. You can create a REXX file 
  26215. using the OS/2 Editor (E) or the OS/2 advanced Editor (EPM). All REXX command 
  26216. files must have a .CMD extension for Ami Pro to recognize them. For more 
  26217. information about creating REXX files, select the Information icon in the OS/2 
  26218. System folder and select REXX Information. 
  26219.  
  26220.  
  26221. There are several ways you can integrate REXX commands with Ami Pro: 
  26222.     You can run a REXX command file directly from Ami Pro by choosing Tools 
  26223.     Macros and choosing Play REXX file. 
  26224.     You can call REXX command files from Ami Pro macros. 
  26225.     You can use REXX commands in Ami Pro macro files. 
  26226.     You can use Ami Pro macro functions in REXX command files. 
  26227.     You can exchange parameters between Ami Pro macros and REXX command files. 
  26228.  
  26229. Running REXX Command Files from Ami Pro 
  26230. You can run REXX command files from Ami Pro several different ways. You can 
  26231. execute a previously created REXX command file from within Ami Pro. 
  26232. 1.  Choose Tools Macros. 
  26233. 2.  Choose Play REXX File. 
  26234. 3.  Specify the name of the file you want to execute. 
  26235.     All REXX files must have a .CMD extension for Ami Pro to recognize them. 
  26236.     You can specify another drive and directory by selecting them in the list 
  26237.     boxes or typing the full path in the Macro file text box. 
  26238. 4.  Choose OK. 
  26239.     Ami Pro plays the REXX command file. 
  26240.  
  26241. You can also create an Ami Pro macro to start a REXX command file. You can use 
  26242. RexxCmd to start the command file by passing the filename any optional 
  26243. arguments. The REXX file can retrieve those arguments using the ARG function. 
  26244. If the REXX file includes a return statement, the return value is available in 
  26245. the Ami Pro macro as the return value of RexxCmd(). For example, 
  26246. stat = RexxCmd("c:\amipro\macros\myrexx.cmd", fname) 
  26247. For additional information, see the REXXFIND.SMM sample macro. REXXFIND.SMM 
  26248. calls the OS/2 Seek and Find routine through REXX. It then exchanges 
  26249. information with the REXX function and lists the files that match the criteria. 
  26250.  
  26251. If you want to execute a single REXX statement from an Ami Pro macro, you can 
  26252. use RexxFunction which takes a REXX statement string as the parameter. If the 
  26253. REXX file includes a RETURN statement, the return value is available in the Ami 
  26254. Pro macro as the return value of RexxFunction. For example, 
  26255. ok = RexxFunction("SysDeleteFile(""c:\test"")") 
  26256. sets the variable ok to 0, but 
  26257. ok = RexxFunction("return SysDeleteFile(""c:\test"")") 
  26258. sets the variable ok to whatever SysDeleteFile returns. 
  26259.  
  26260. Using Ami Pro Macro Functions in REXX Files 
  26261. You can use all Ami Pro macro functions and commands in a REXX command file 
  26262. invoked by Ami Pro. However, REXX does not allow a $ character in a function 
  26263. name, and all Ami macro functions that return strings end with a $. To access 
  26264. string functions from REXX, use the function name without the $. For example, 
  26265. instead of 
  26266. name = Query$("Enter your name:") 
  26267. use 
  26268. name = Query("Enter your name:") 
  26269.  
  26270. You can also call an Ami Pro macro from a REXX command file invoked by Ami Pro. 
  26271. For example, 
  26272. x = mymacro.smm!MyMacro("myarg") 
  26273. or 
  26274. x = Call mymacro.smm!MyMacro("myarg") 
  26275.  
  26276. Using Dialog Boxes with REXX 
  26277. If you want to communicate with the user from a REXX command file invoked from 
  26278. Ami Pro, you can write an Ami Pro macro that displays a dialog box. REXX 
  26279. returns the value of the button that dismissed the box. Since Ami Pro lets you 
  26280. process the contents of the dialog box interactively, you return the ID of any 
  26281. control. If you want to display a message box or simply get an answer to a 
  26282. question, you can also use the Ami Pro functions Message and Query (without the 
  26283. $'s). 
  26284.  
  26285. If you use the REXX functions SAY or PULL, Ami Pro intercepts these calls and 
  26286. translates them to Message or Query functions. Ami Pro saves the prompt and 
  26287. displays it in the query box. However, in REXX you normally prompt for a 
  26288. response with SAY and immediately get the response with PULL so the message you 
  26289. pass to SAY does not display until the next SAY or PULL function. 
  26290.  
  26291. See also: 
  26292.  
  26293.     Ami Pro Macro Language Contents 
  26294.     Message$ 
  26295.     Query$ 
  26296.     REXXCmd 
  26297.     REXXFunction 
  26298.  
  26299.  
  26300. ΓòÉΓòÉΓòÉ 717. Transferring Program Control ΓòÉΓòÉΓòÉ
  26301.  
  26302. The Ami Pro macro language provides a method of transferring control to another 
  26303. section of the same macro. This is useful when the macro needs to continue from 
  26304. another location and it is not necessary to return to the original location. In 
  26305. addition, Ami Pro provides special commands to transfer control to an error 
  26306. handling routine and a user cancel handling routine. 
  26307.  
  26308.  
  26309. See also: 
  26310.  
  26311.     Ami Pro Macro Language Contents 
  26312.     Using DDE Poke to access Ami Pro from another application 
  26313.     Using the GOTO Statement 
  26314.     Using the IF/THEN Statements 
  26315.     Using Labels 
  26316.     Using the ONCANCEL Statement 
  26317.     Using the ONERROR Statement 
  26318.  
  26319.  
  26320.  
  26321.  
  26322.  
  26323. ΓòÉΓòÉΓòÉ 718. Using DDE Poke to access Ami Pro from another Application ΓòÉΓòÉΓòÉ
  26324.  
  26325. Many OS/2 applications have macro language commands that support DDE 
  26326. functionality.  Ami Pro can support these DDE commands through the use of 
  26327. bookmarks. When you name an existing bookmark in a DDEPoke message, Ami Pro 
  26328. replaces the contents of the bookmark with the poked data. 
  26329.  
  26330.  
  26331. Generally there are three steps. First, you initiate the DDE conversation using 
  26332. the other application's macro language. Usually this is done with some type of 
  26333. Initiate or DDEInitiate command. Second, you use the other application's macro 
  26334. language to poke data from that application into an Ami Pro bookmark. Usually 
  26335. this is done with some type of Poke or DDEPoke command. Finally, you terminate 
  26336. the DDE conversation using the other application's macro language. Usually this 
  26337. is done with a Terminate or DDETerminate command. 
  26338.  
  26339. Example 
  26340. For example, you could write the following macro in 123 to poke data from a 
  26341. spreadsheet into an Ami Pro document: 
  26342. {dde-open AMIPRO;"(Untitled)"} 
  26343. 'Open a DDE channel to an untitled Ami Pro document 
  26344. {dde-execute [MarkBookMark("DDE_BookMark1",4003)]} 
  26345. 'Create a bookmark in Ami Pro to poke data in to 
  26346. {dde-poke Data,"DDE_BookMark1"} 
  26347. 'Data is the named range of information to poke into the Ami Pro bookmark 
  26348. {dde-close} 
  26349. 'Terminate the DDE channel to Ami Pro 
  26350. {Quit} 
  26351.  
  26352. See also: 
  26353.  
  26354.     Ami Pro Macro Language Contents 
  26355.     Transferring Program Control 
  26356.  
  26357.  
  26358.  
  26359.  
  26360.  
  26361. ΓòÉΓòÉΓòÉ 719. Using Results of Evaluations to Control a Macro ΓòÉΓòÉΓòÉ
  26362.  
  26363. Frequently, the value of a variable determines the next step a macro should 
  26364. take. At other times, the macro should complete a series of steps a number of 
  26365. times and then the program should execute other steps. The macro language 
  26366. provides several statements that can control macro execution based on the value 
  26367. of expressions. 
  26368.  
  26369.  
  26370. The available statements include FOR/NEXT, which executes a loop a defined 
  26371. number of times; IF/THEN, which executes statements only if an expression is 
  26372. TRUE; the SWITCH/CASE statements, which execute a set of steps based on the 
  26373. value of a variable; and the WHILE/WEND statement that repeatedly executes a 
  26374. series of steps as long as an expression evaluates to TRUE. 
  26375.  
  26376. See also: 
  26377.  
  26378.     Ami Pro Macro Language Contents 
  26379.     Using Macro Programming Statements 
  26380.     Using the BREAK Statement 
  26381.     Using the FOR Statement 
  26382.     Using theIF/THEN Statements 
  26383.     Using the SWITCH and CASE Statements 
  26384.     Using the WHILE Statement 
  26385.  
  26386.  
  26387.  
  26388. ΓòÉΓòÉΓòÉ 720. Using the Lotus Dialog Editor ΓòÉΓòÉΓòÉ
  26389.  
  26390. You can create a dialog box in the Dialog Editor by drawing push buttons, group 
  26391. boxes, radio buttons, check boxes, text boxes, edit boxes, list boxes, combo 
  26392. boxes, and static text directly onto an editing screen. After you create and 
  26393. save your dialog box in the Dialog Editor, you can include it in or call it 
  26394. from an Ami Pro macro. 
  26395.  
  26396.  
  26397. The dialog box you create in the Dialog Editor is modal. That means the user 
  26398. can make choices from the dialog box, but no other action can take place until 
  26399. either OK or CANCEL has been chosen. You must include either an OK button, a 
  26400. CANCEL button, or both in the dialog box to return control to the macro. 
  26401.  
  26402. The exception to this is when you assign a callback to a particular control. If 
  26403. the value of a control that has a callback assigned to it ever changes, then a 
  26404. macro function specified in SetDialogCallback is instantly executed, even 
  26405. though the dialog box is still displayed. This allows you to validate data 
  26406. entered in a dialog box. 
  26407.  
  26408. You can start the Dialog Editor by typing LTSDLGED at an OS/2 command prompt. 
  26409. You can then choose Help Contents for more information about the Dialog Editor. 
  26410.  
  26411. See also: 
  26412.  
  26413.     DialogBox 
  26414.     DlgClearControl 
  26415.     DlgClose 
  26416.     DlgEnableControl 
  26417.     DlgGetListBoxCount 
  26418.     DlgGetListBoxLines 
  26419.     DlgHideControl 
  26420.     DlgKeyInterrupt 
  26421.     DlgLimitText 
  26422.     DlgSetCaption 
  26423.     GetDialogField$ 
  26424.  
  26425.  
  26426.