home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / mape120.zip / PMPROGED.HLP (.txt) < prev    next >
OS/2 Help File  |  1995-12-21  |  56KB  |  1,806 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. About Program Editor ΓòÉΓòÉΓòÉ
  3.  
  4.  Programmers Editor for OS/2 
  5.  
  6. Created by Peter Koller, La vieille Maison d'Anglais, Trebuon, 29530 Plonevez 
  7. du Faou, France. (...more...) 
  8.  
  9. About La Maison d'Anglais 
  10.  
  11. La Maison d'Anglais pictured above is a 17th century (169?) weavers cottage of 
  12. either English or Flemish (Angles) origin. The programs originating therein are 
  13. the products of Peter Koller, a dedicated Hardware and Software engineer of 
  14. more than 18 years experience in the design of computers, their software, and 
  15. their interface to the real world. 
  16.  
  17. Program Editor for OS/2 is a product designed to provide a simple, well thought 
  18. out basis to a program development environment. Although designed for 
  19. programmers, SysOp's may find this editor useful for editing messy or complex 
  20. files. 
  21.  
  22. Salient features include the ability to run compilers for parsing and 
  23. customisation using editor scripts. 
  24.  
  25. Program Editor provides a substantially User Friendly environment for editing 
  26. text files. Loading time is short, and cursor movement controls are refined. 
  27. File EA's are set for new files, click on the file to start the editor. 
  28.  
  29. Overview 
  30.  
  31.      LOADS of minor features plus... 
  32.  
  33.      Customisable edit functions (scripts). 
  34.  
  35.      Background Exec to Parse. Test/Make your programs before exiting the 
  36.       editor. 
  37.  
  38.      Works with most compilers. 
  39.  
  40.      Customizable goto error keys position you at the error. 
  41.  
  42.      Extensively MultiThreaded. 
  43.  
  44.      Smooth Scrolling. 
  45.  
  46.      Well Tested. 
  47.  
  48.      Good General Purpose Editor, esp. large files. 
  49.  
  50.      Fast, Reliable, Safe. 
  51.  
  52.  Program editor evaluation copy is a fully functional product for you to enjoy 
  53.  for 30 days. After that, Please Register.... 
  54.  
  55.  Other products available 
  56.  
  57.  PM Make 
  58.  
  59.  PM Make is a programmers make utility that makes use of the PM interface to 
  60.  provide the necessary functions for project maintenance.- 
  61.  
  62.      Built in project backup and restore. 
  63.  
  64.      User menus defined in the makefile can set compiler, etc., options. 
  65.  
  66.      Can include 'global' makefiles as headers. 
  67.  
  68.      Can stop on error. 
  69.  
  70.      Allows review of error messages. 
  71.  
  72.      Force make according to compiler, linker, or user options or make all. 
  73.  
  74.      Can make .exe, .hlp, .dll, etc... all in one build. 
  75.  
  76.      Background build with 'pop up on error' mode. 
  77.  
  78.      Can work in multiple directories, and circumvent tools that won't 
  79.       recognize paths. 
  80.  
  81.      Fast. 
  82.  
  83.      Applicable to any third party compilers, linkers, or other tools. 
  84.  
  85.  Enquiries concerning the production of new products, or the inclusion of this 
  86.  product into new products, or the inclusion of features from this product into 
  87.  new products are very welcome. 
  88.  
  89.   See Also:- 
  90.  
  91.       Installation. 
  92.       (c) Copyright 
  93.       What is a Script. 
  94.  
  95.  Note:  This product is designed for use with third party products. These third 
  96.  party products have their own copyright. This product does not confer any 
  97.  rights to you in respect of a third party. 
  98.  
  99.  
  100. ΓòÉΓòÉΓòÉ 2. Installation ΓòÉΓòÉΓòÉ
  101.  
  102. Installation Instructions 
  103.  
  104. You must use the Install utility provided if you wish to 
  105.  
  106.      Install Program Editor. 
  107.      Uninstall Program Editor. 
  108.      Register Program Editor. 
  109.  
  110.  If you are merely registering, you can uncheck all the buttons before 
  111.  proceeding. The minimum files installed are pmproged.exe, pmproged.hlp, 
  112.  pmproged.eas, and register.doc. 
  113.  
  114.  That's it !! Enjoy. 
  115.  
  116.  To uninstall Program Editor run install.exe and select Uninstall, the press 
  117.  Install. Be sure the path and help path is entered correctly before 
  118.  uninstalling. Only those files supplied in the original package will be 
  119.  deleted. You must delete any Objects or Folders by hand. Delete the 'Program 
  120.  Edited' template in the Templates folder and reboot your system. 
  121.  
  122.  
  123. ΓòÉΓòÉΓòÉ 3. (c)copyright ΓòÉΓòÉΓòÉ
  124.  
  125. This program is the (c) copyright of 
  126.  
  127.       Peter Koller, 
  128.       La vieille Maison d'Anglais, 
  129.       Trebuon, 
  130.       29530, Plonevez du Faou, 
  131.       FRANCE. 
  132.  
  133.  All Rights Reserved. 
  134.  
  135.  Note:  This copyright includes the whole product, including the scripting 
  136.  language format, the installation program, and all documentation associated 
  137.  with the product. 
  138.  
  139.    1. You may use the program only on a single machine at any one time.If you 
  140.       have purchased a multiple copy, you may use an according number of copies 
  141.       simultaneously. 
  142.  
  143.    2. You may copy the program into machine readable or printed form for backup 
  144.       or data compression purposes. You may not reverse engineer or disassemble 
  145.       the program. 
  146.  
  147.    3. You may give this copy to others. You may also charge the end user 
  148.       reasonable costs incurred by your distribution of this product. Please 
  149.       ensure you distribute the entire package as shown below. 
  150.  
  151.    4. This product is Shareware. You Must be registered if you continue to use 
  152.       this product after you have evaluated it. Unregistered software will time 
  153.       out after one month. 
  154.  
  155.    5. If you have a Customer Registration Code (CRN), you must not disclose it 
  156.       to anyone. Please quote the number shown in the statistics dialog, rather 
  157.       than the full CRN, when seeking technical support. 
  158.  
  159.  The Author accepts no liability for fitness of purpose, or damages caused 
  160.  whether incidental, or consequential, by the use of this product, howsoever 
  161.  caused. This product is Sold As Seen. In those countries where this statement 
  162.  conflicts with your statutory rights your statutory rights shall remain 
  163.  unaffected. 
  164.  
  165.  This product consists of 
  166.  
  167.  install.exe         The program install utility. 
  168.  pmpfold.cmd         REXX folder creation, used by install.exe 
  169.  pmproged.exe        The executable file. 
  170.  pmproged.hlp        This help File. 
  171.  pmproged.inf        This help File in .INF format. 
  172.  pmproged.eas        The extended attributes file (essential) 
  173.  exe.eas             The .exe file extended attributes. 
  174.  register.doc        The product registration sheet. 
  175.  read.me             Late breaking information. 
  176.  uninstal.doc        How to remove (uninstall) Program Editor 
  177.  main.scr            Main example script. 
  178.  home.scr            Home example script 
  179.  eof.scr             End of file example script 
  180.  poptab.scr          Deindent example script 
  181.  pushtab.scr         Indent example script 
  182.  insbkt.scr          Insert Brackets example script 
  183.  test.scr            Test Message example script 
  184.  killmenu.scr        Reset menu example script 
  185.  truncspc.scr        Truncate trailing whitespace example script. 
  186.  
  187.  
  188. ΓòÉΓòÉΓòÉ 4. File Menu ΓòÉΓòÉΓòÉ
  189.  
  190. This menu is used to.- 
  191.  
  192.       Start a new file. 
  193.  
  194.       Open an existing file. 
  195.  
  196.       Save a file. 
  197.  
  198.       Save a file under a new name (SaveAs). 
  199.  
  200.  
  201. ΓòÉΓòÉΓòÉ 4.1. Starting a New File ΓòÉΓòÉΓòÉ
  202.  
  203. Select File, then New. 
  204.  
  205. If you have typed anything, you will be prompted to save it in a file. Select 
  206. cancel to abandon the new file command. If you decide to save the file select a 
  207. save file or cancel to clear the screen and open the new file. 
  208.  
  209.  
  210. ΓòÉΓòÉΓòÉ 4.2. Opening a File ΓòÉΓòÉΓòÉ
  211.  
  212. Select File, then Open. 
  213.  
  214. If you have typed anything, you will be prompted to save it in a file. Select a 
  215. save file or Cancel. Only then will the Open dialog appear. 
  216.  
  217. Double clicking on a directory or drive will select that directory or drive. 
  218.  
  219. Single clicking on a file will select that file, while double clicking will 
  220. load the file and exit the Open dialog. 
  221.  
  222.  
  223. ΓòÉΓòÉΓòÉ 4.3. Saving a File ΓòÉΓòÉΓòÉ
  224.  
  225. Select File, then Save. 
  226.  
  227. If your file has no name, you will be prompted for one. 
  228.  
  229.  
  230. ΓòÉΓòÉΓòÉ 4.4. Saving a File under a new name ΓòÉΓòÉΓòÉ
  231.  
  232. Select File, then SaveAs. 
  233.  
  234. You will be prompted to give a file name. You may also select a new path at 
  235. this point. 
  236.  
  237. Double clicking on a directory or drive will select that directory or drive. 
  238.  
  239. Single clicking on a file will select that file, while double clicking will 
  240. select the file and exit the Save As dialog. 
  241.  
  242. If you are overwriting an existing file, you will be required to confirm an 
  243. appropriate action, where Yes means overwrite the file, No means ask for a new 
  244. file name, and Cancel aborts the SaveAs dialog. 
  245.  
  246.  
  247. ΓòÉΓòÉΓòÉ 5. Edit Menu ΓòÉΓòÉΓòÉ
  248.  
  249. This menu is used to.- 
  250.  
  251.       Undo and then Redo the last action. 
  252.  
  253.       Cut a Selected area to the clipboard 
  254.  
  255.       Copy a Selected area to the clipboard 
  256.  
  257.       Paste from the clipboard over a selected area. 
  258.  
  259.       Insert Text from the clipboard 
  260.  
  261.       Clear a Selected area. (ERASE it !!) 
  262.  
  263.       Find a piece of text 
  264.  
  265.       Goto a particular line 
  266.  
  267.       Detab the whole file 
  268.  
  269.       Select the whole file 
  270.  
  271.  
  272. ΓòÉΓòÉΓòÉ 5.1. Undoing Changes ΓòÉΓòÉΓòÉ
  273.  
  274. Select Undo from the Edit menu or type alt+backspace to undo the last action. 
  275.  
  276. You Cannot undo two different actions. eg. if you type something and then 
  277. delete a char and then type something else, only the last bit of typing is 
  278. undone. 
  279.  
  280. After an action has been undone, it may be redone. Select Redo from the Edit 
  281. menu or type alt+backspace. 
  282.  
  283.  
  284. ΓòÉΓòÉΓòÉ 5.2. Cutting out blocks ΓòÉΓòÉΓòÉ
  285.  
  286. First select a piece of text to hilite it. 
  287.  
  288. Select Cut from the Edit menu or press shift+del to copy the selected text to 
  289. the clipboard and delete the hilited area. 
  290.  
  291. See also 
  292.  
  293.       Copy a Selected area to the clipboard 
  294.  
  295.       Paste from the clipboard over a selected area. 
  296.  
  297.       Insert Text from the clipboard 
  298.  
  299.       Clear a Selected area. (ERASE it !!) 
  300.  
  301.       Select the whole file 
  302.  
  303.  
  304. ΓòÉΓòÉΓòÉ 5.3. Copying blocks ΓòÉΓòÉΓòÉ
  305.  
  306. First select a piece of text to hilite it. 
  307.  
  308. Select Copy from the Edit menu or press ctrl+ins to copy the selected text to 
  309. the clipboard, this does not delete the hilited area. 
  310.  
  311. See also 
  312.  
  313.       Cut a Selected area to the clipboard 
  314.  
  315.       Paste from the clipboard over a selected area. 
  316.  
  317.       Insert Text from the clipboard 
  318.  
  319.       Clear a Selected area. (ERASE it !!) 
  320.  
  321.       Select the whole file 
  322.  
  323.  
  324. ΓòÉΓòÉΓòÉ 5.4. Pasting blocks ΓòÉΓòÉΓòÉ
  325.  
  326. Select Paste from the Edit menu or press shift+ins to delete any area that may 
  327. be hilited and then copy any text in the clipboard into the file at the 
  328. position previously occupied by the hilited area (eg. at the cursor position). 
  329.  
  330. See also 
  331.  
  332.       Cut a Selected area to the clipboard 
  333.  
  334.       Copy a Selected area to the clipboard 
  335.  
  336.       Insert Text from the clipboard 
  337.  
  338.       Clear a Selected area. (ERASE it !!) 
  339.  
  340.       Select the whole file 
  341.  
  342.  
  343. ΓòÉΓòÉΓòÉ 5.5. Inserting blocks ΓòÉΓòÉΓòÉ
  344.  
  345. Select Insert Text from the Edit menu or press alt+ins to insert Text at the 
  346. cursor position. Does not affect any hilited area. 
  347.  
  348. See also 
  349.  
  350.       Cut a Selected area to the clipboard 
  351.  
  352.       Copy a Selected area to the clipboard 
  353.  
  354.       Paste from the clipboard over a selected area. 
  355.  
  356.       Clear a Selected area. (ERASE it !!) 
  357.  
  358.       Select the whole file 
  359.  
  360.  
  361. ΓòÉΓòÉΓòÉ 5.6. Clearing selected text ΓòÉΓòÉΓòÉ
  362.  
  363. First select a piece of text to hilite it. 
  364.  
  365. Select Clear from the Edit menu or press del to delete the hilited area. 
  366.  
  367. Data is not copied to the clipboard. 
  368.  
  369. See also 
  370.  
  371.       Cut a Selected area to the clipboard 
  372.  
  373.       Copy a Selected area to the clipboard 
  374.  
  375.       Paste from the clipboard over a selected area. 
  376.  
  377.       Insert Text from the clipboard 
  378.  
  379.       Select the whole file 
  380.  
  381.  
  382. ΓòÉΓòÉΓòÉ 5.7. Finding text ΓòÉΓòÉΓòÉ
  383.  
  384. Select Find from the Edit menu. 
  385.  
  386. Find searches for text in the find entryfield. 
  387.  
  388. Enter the text you wish to find into the Find entryfield. 
  389.  
  390. Until Find has found something, all other options are disabled. Once text is 
  391. found, it is hilited. 
  392.  
  393. You may then 
  394.  
  395.    1. Change the text for that in the change entryfield. 
  396.  
  397.    2. Change the text as above, and then find the next occurrence. 
  398.  
  399.    3. Use any normal editing function, such as cut, copy, paste, typing, etc. 
  400.  
  401.    4. Change all occurrences of the text. 
  402.  
  403.  Note:  Find is a separate thread. Try not to edit the file whilst find is 
  404.  actually searching. This is usually not possible because find is fast. 
  405.  
  406.  
  407. ΓòÉΓòÉΓòÉ 5.8. Finding a specific line ΓòÉΓòÉΓòÉ
  408.  
  409. Select Goto Line from the Edit menu. Enter the line to which you wish to go. 
  410. The current line is shown in the bottom of the window. If you wish to return to 
  411. this point make a note of it. 
  412.  
  413.  
  414. ΓòÉΓòÉΓòÉ 5.9. Removing tab characters from a file ΓòÉΓòÉΓòÉ
  415.  
  416. Program Editor shows tabs as "o". All ascii codes except 0x00,CR,LF,and 0xff 
  417. are shown as separate characters. Hence all indenting is done with spaces. Note 
  418. that detabbing a huge file with 1,000,000's of tabs can take a very long time. 
  419. eg. 
  420.  
  421.       file has 500 tabs, 5000 chars.. 3 seconds. 
  422.  
  423.       file has 10,000 tabs,100,000 chars... 25 minutes. 
  424.  
  425.  Detab Dialog 
  426.  
  427.  The Detab dialog shows a status bar indicating progress. You may stop the 
  428.  Detab Thread at any time by pressing Stop or the ESC (keyboard) key. 
  429.  
  430.  You can select a different number of spaces to replace each tab if you wish. 
  431.  The default tabsize is not affected. Each tab in the file will be replaced by 
  432.  the number of spaces indicated. You cannot change the tabsize later, so saving 
  433.  your file before detabbing is recommmended. 
  434.  
  435.  You must stop the Detab Thread before you can press Cancel. When detabbing is 
  436.  finished the dialog will dismiss itself. You cannot undo a detab. 
  437.  
  438.  
  439. ΓòÉΓòÉΓòÉ 5.10. Selecting Text ΓòÉΓòÉΓòÉ
  440.  
  441. To select a block of text.... 
  442.  
  443.    1. Position the cursor at the start or end of the block you wish to select. 
  444.    2. Hold down the left mouse button and move the mouse over the area 
  445.       required. 
  446.  
  447.  OR 
  448.  
  449.    1. Position the cursor at the start or end of the block you wish to select. 
  450.    2. Hold down the Shift Key and use the cursor movement (arrow, home, end, 
  451.       etc.) Keys. 
  452.  
  453.  Note:  The Selected block will be hilited (coloured black?). 
  454.  
  455.  Because ctrl+ins (copy) and shift+ins (paste) as well as selecting text works 
  456.  in entry fields, you can copy a string to the clipboard and then into the 
  457.  "find" entryfield for example. 
  458.  
  459.  Similarly, you can copy a script in the "execute" entryfield, paste it into a 
  460.  file, and then save the file. 
  461.  
  462.  
  463. ΓòÉΓòÉΓòÉ 5.11. Selecting the whole file ΓòÉΓòÉΓòÉ
  464.  
  465. Select "Select All" from the Edit menu. 
  466.  
  467. Note:  Selecting the whole file enables you to copy the whole file to the 
  468. clipboard. You can exit Program Editor, and the file will remain in the 
  469. clipboard. BUT, note that any program that uses the clipboard can overwrite it. 
  470. However, the saved file is not lost. 
  471.  
  472.  
  473. ΓòÉΓòÉΓòÉ 6. Script Menu ΓòÉΓòÉΓòÉ
  474.  
  475. Apart from Execute..., all other menu items (if there are any) are setup by a 
  476. script. These menu items could be anything you like. 
  477.  
  478. See also 
  479.  
  480.    1. What is a script 
  481.    2. Script Command Structure 
  482.    3. Script Command Chains 
  483.    4. Script Looping Chains 
  484.    5. Script Command List 
  485.    6. Script Variables 
  486.    7. Script Limitations 
  487.  
  488.  
  489. ΓòÉΓòÉΓòÉ 6.1. What is a script ΓòÉΓòÉΓòÉ
  490.  
  491. Overview 
  492.  
  493. Scripting is the automation of normal edit functions, eg type, delete, cursor 
  494. control etc. Each script command performs the equivalent of a normal edit 
  495. operation. By having a script chain, the operations thus performed can become 
  496. quite complex. 
  497.  
  498. Scripts can be typed directly into the Execute.. dialog. They can also be saved 
  499. as a file and then be called from another script. They can also be set as a 
  500. menu item. This is usually done by the Main script which is always run on 
  501. startup. 
  502.  
  503. Scripting is designed to be simple. Internally, each script command calls the 
  504. same function that a keypress would call. Because scripting is designed for 
  505. repetitive tasks, repetition controls are built in. Scripting does not allow 
  506. you to perform some of the more complex tasks, as these could cause a disaster 
  507. if the script has errors. 
  508.  
  509. Scripts tend to be short and terse. Here is a script to go to the start of a 
  510. line and delete a tab's worth of characters if not already at the end of the 
  511. line. 
  512.  
  513. home[,,loop[tab,,!eoln[,,del[,,] 
  514.  
  515. This reads as keys HOME, (repeat tab times, (if not at end of line), DEL ) 
  516.  
  517. The editor is literally typing for you. This is a Chain. Scripts can contain 
  518. many chains. 
  519.  
  520. Here is a chain that goes to the start of the file if "Hi" is not found- 
  521.  
  522. find["Hi",1,!ishil[,,abs[0,,]        /this is a comment/ 
  523.  
  524. Here is one to change all "hi"'s to "ho"'s- 
  525.  
  526. loop[200000/...any BIG number! /,,find["hi",1,ins["ho",1,] 
  527.  
  528. Delete all "ho"'s 
  529.  
  530. loop[file,,find["ho",1,clear[,,] / note:- file = filesize / 
  531.  
  532. Scripting is ideal for automating repetitive typing tasks. For example, you 
  533. wish to make a batch file to backup all the files beginning with 'a'. So you 
  534. type 'dir a*.* > back.cmd', and then you edit in 'arc -a' etc. for each entry, 
  535. deleting all the unwanted rubbish along the way. How BORING. It's much more 
  536. fun, and easier to automate the editor to do it for you. And you can re-use the 
  537. script whenever you want. 
  538.  
  539. Look at the examples provided and experiment. 
  540.  
  541. See also 
  542.  
  543.    1. Script Command Structure 
  544.    2. Script Command Chains 
  545.    3. Script Looping Chains 
  546.    4. Script Command List 
  547.    5. Script Variables 
  548.    6. Script Limitations 
  549.  
  550.  
  551. ΓòÉΓòÉΓòÉ 6.2. Script Command Structure ΓòÉΓòÉΓòÉ
  552.  
  553. Each command has the following- 
  554.  
  555. command[(parameter),(parameter),(command[....etc) eg left[,, 
  556.  
  557.    1. Strings in "quotes" are not parsed. 
  558.  
  559.    2. Comments are anything between / ...and... /. 
  560.  
  561.    3. WHITESPACE eg space, tab, enter are ignored. 
  562.  
  563.    4. Space, newline and tab characters are ignored unless in quotes "..." 
  564.  
  565.    5. Each command gets and passes along a flag. Some commands respond to this 
  566.       flag, some set it, and some do both. 
  567.  
  568.  See also 
  569.  
  570.    1. What is a script 
  571.    2. Script Command Chains 
  572.    3. Script Looping Chains 
  573.    4. Script Command List 
  574.    5. Script Variables 
  575.    6. Script Limitations 
  576.  
  577.  
  578. ΓòÉΓòÉΓòÉ 6.3. Script Command Chains ΓòÉΓòÉΓòÉ
  579.  
  580. Commands are always constructed into CHAINS. Command chains are executed left 
  581. to right. Almost every command in a chain is called only if the previous 
  582. command returns TRUE. But there are some exeptions. All commands either alter 
  583. the flag, or pass along the old one. The flag may be TRUE or FALSE. 
  584.  
  585. Each chain must be terminated with ]. This allow a new chain to start, or the 
  586. current chain to loop. Each new chain starts with the flag set TRUE. 
  587.  
  588. Here are examples of valid chains- 
  589.  
  590.       loop[20,,ins["hello,there",1,crins[1,,ins["fred, how are YOU 
  591.       !!!",1,crins[1,,] 
  592.  
  593.       loop[1000,,!eoln[,,right[,,] / ..walk the file / 
  594.  
  595.       exec["insbkt.scr",,] 
  596.  
  597.       left[,,] 
  598.  
  599.       ins /say hello/ [hello,2,] 
  600.  
  601.  These are invalid or incomplete chains- 
  602.  
  603.       ins[hello,2]   / missing comma / 
  604.  
  605.       right[]     / missing two commas / 
  606.  
  607.       !stl[,,abs[0,,  / exit not defined / 
  608.  
  609.  any number of chains may be contained in a given script. 
  610.  
  611.  See also 
  612.  
  613.    1. What is a script 
  614.    2. Script Command Structure 
  615.    3. Script Looping Chains 
  616.    4. Script Command List 
  617.    5. Script Variables 
  618.    6. Script Limitations 
  619.  
  620.  
  621. ΓòÉΓòÉΓòÉ 6.4. Script Looping Chains ΓòÉΓòÉΓòÉ
  622.  
  623. This is a looping chain- 
  624.  
  625. loop[20,,/...commands.../]
  626.  
  627. loops may be nested... 
  628.  
  629. loop[5,,right[,,loop[2,,down[,,]]  / go right 5x down twice /
  630.  
  631. Loops may be nested up to about 20 deep. 
  632.  
  633. Valid loop counts are from 0 to 2^32-1 eg 4,294,967,295! Other valid loopcounts 
  634. include hpos or vpos. See Variables 
  635.  
  636. Loops exit if the chain returns false- 
  637.  
  638. loop[file,,/ ...commands in here... /!eof[,,down[,,] /will exit loop at end of file /
  639. loop[10000,,false[,,] /will exit immediately/
  640.  
  641. In fact loop responds to flag on input and output. This enables fine control of 
  642. loop starting and ending. Using the false and true commands allows you to 
  643. construct some weird chains. Here the ╨┐ symbol is used to show how the flag is 
  644. passed:- 
  645.  
  646. new chain == TRUE╨┐loop[,,╨┐command[,,╨┐] TRUE╨┐command[,,╨┐ etc.
  647. so...
  648. loop[20,,!eoln[,,loop[100,,!eoln[,,del[,,]]
  649.  
  650. and now showing flag...
  651. TRUE╨┐loop[20,,!eoln[,,???╨┐loop[100,,!eoln[,,???╨┐del[,,???╨┐(loop if true)] TRUE╨┐]
  652.  
  653. In the above example, note the outer loop is forced to loop, regardless of the 
  654. exit state of the inner loop. Note also that the ] character is not always the 
  655. end of a chain. You could have loop[1,,loop[2,,loop[3,,up[,,]up[,,]up[,,] as a 
  656. complete chain. Note the eoln test used both inside and outside the inner loop. 
  657. Note that a test could be put just before the ]. eg. loop[..down[,,!eof[,,] 
  658.  
  659. See also 
  660.  
  661.    1. What is a script 
  662.    2. Script Command Structure 
  663.    3. Script Command Chains 
  664.    4. Script Command List 
  665.    5. Script Variables 
  666.    6. Script Limitations 
  667.  
  668.  
  669. ΓòÉΓòÉΓòÉ 6.5. Script Command List ΓòÉΓòÉΓòÉ
  670.  
  671.  Note that blank  or incorrect variables resolve to 0, eg abs[,,] == abs[0,,] 
  672. and abs[rubbish,,] == abs[0,,] 
  673.  
  674.    1. Commands that return a condition 
  675.  
  676.       paste        instxt 
  677.       cut          clear 
  678.       find         exec 
  679.       ishil        !ishil 
  680.       false        true 
  681.       eof          !eof 
  682.       stf          !stf 
  683.       eoln         !eoln 
  684.       stln         !stln 
  685.       istxt        !istxt 
  686.       inhil        !inhil 
  687.  
  688.    2. Commands that ignore the previous condition. 
  689.  
  690.       false        true 
  691.       paint        sysptr 
  692.       eof          !eof 
  693.       stf          !stf 
  694.       eoln         !eoln 
  695.       stln         !stln 
  696.  
  697.    3. All other commands. 
  698.  
  699.       up           down 
  700.       left         right 
  701.       leftwrd      rightwrd 
  702.       tabmov       backtab 
  703.       home         end 
  704.       txthome      txtend 
  705.       line         abs 
  706.       copy         del 
  707.       backsp       hilite 
  708.       hilst        hilend 
  709.       hilall 
  710.       ins          ovr 
  711.       crins        crovr 
  712.       tabins       tabovr 
  713.       tabsize 
  714.       gethpos      getvpos 
  715.       add          sub 
  716.       set          txtset 
  717.       loop         menuitem 
  718.  
  719.  See also 
  720.  
  721.    1. What is a script 
  722.    2. Script Command Structure 
  723.    3. Script Command Chains 
  724.    4. Script Looping Chains 
  725.    5. Script Variables 
  726.    6. Script Limitations 
  727.  
  728.  
  729. ΓòÉΓòÉΓòÉ 6.6. Script Variables ΓòÉΓòÉΓòÉ
  730.  
  731. Variables can be used in any script command that uses numbers. 
  732.  
  733.    1. Numeric Values, variables, and constants. 
  734.  
  735.       Numbers go from 0 to 4,294,967,295. 
  736.       hpos           vpos 
  737.       scr1           scr2 
  738.       tab            file 
  739.       fpos           abs 
  740.       bklc           bkrc 
  741.       bklr           bkrr 
  742.       bkls           bkrs 
  743.       hst            hend 
  744.       true           false 
  745.       zero 
  746.  
  747.  Note:  Blank  or incorrect variables resolve to 0, eg.- 
  748.  abs[,,] == abs[0,,] 
  749.  abs[rubbish,,] == abs[0,,] 
  750.  
  751.  See also 
  752.  
  753.    1. What is a script 
  754.    2. Script Command Structure 
  755.    3. Script Command Chains 
  756.    4. Script Looping Chains 
  757.    5. Script Command List 
  758.    6. Script Limitations 
  759.  
  760.  
  761. ΓòÉΓòÉΓòÉ 6.7. Executing a script ΓòÉΓòÉΓòÉ
  762.  
  763. Just in case you screw up your file save it first. 
  764.  
  765. Type a script into the entryfield and press Execute to run it, Ok to set the 
  766. script but not run it, or Cancel to abandon what you have entered. 
  767.  
  768. Because ctrl+ins (copy) and shift+ins (paste) as well as selecting text works 
  769. in entry fields, you can copy a string to the clipboard and then into the 
  770. "execute" entryfield for example. 
  771.  
  772. Similarly, you can copy a script in the "execute" entryfield, paste it into a 
  773. file, and then save the file. 
  774.  
  775. Note:  It may not be possible to undo the action performed 
  776.  
  777. Note:  You can interrupt running scripts with the ESC key 
  778.  
  779. See also 
  780.  
  781.    1. What is a script 
  782.    2. Script Command Structure 
  783.    3. Script Command Chains 
  784.    4. Script Looping Chains 
  785.    5. Script Command List 
  786.    6. Script Variables 
  787.    7. Script Limitations 
  788.  
  789.  
  790. ΓòÉΓòÉΓòÉ 6.8. Script Limitations ΓòÉΓòÉΓòÉ
  791.  
  792. Script files are limited to 4096 characters in total. This includes spaces and 
  793. comments. Scripts slow down substantially when files are large enough to 
  794. require disk swapping. 
  795.  
  796. Function names are limited to 20 chars. 
  797.  
  798. Parameter strings are limited to 511 chars. 
  799.  
  800. Loop Counts are limited to ULONG's (2^32 - 1) 
  801.  
  802. Loop Nesting Depth is limited to 19. 
  803.  
  804. A maximum of 8 menuitems may be added to the script menu. 
  805.  
  806. There is little error checking. Unrecognized commands are often ignored. You 
  807. may execute a number of valid commands before an error occurs because chains 
  808. are not parsed but merely chained. Save your file before executing a new 
  809. script. 
  810.  
  811.  
  812. ΓòÉΓòÉΓòÉ 7. Options Menu ΓòÉΓòÉΓòÉ
  813.  
  814. Allows you to setup the various editor options. All options are retained on 
  815. exit. 
  816.  
  817. See Also 
  818.  
  819.       Setting the font size 
  820.  
  821.       Setting the tab size 
  822.  
  823.       Setting AutoSave 
  824.  
  825.       Setting 'Use EOF' 
  826.  
  827.       Colour Options 
  828.  
  829.       Setting the script path 
  830.  
  831.       Setting the Parse Profile 
  832.  
  833.  
  834. ΓòÉΓòÉΓòÉ 7.1. Setting the font size ΓòÉΓòÉΓòÉ
  835.  
  836. You may only select the sizes of the monospace fonts. This is deliberate, so 
  837. that indenting is correct. 
  838.  
  839. Program Editor does not use the standard font dialog. This allows all font 
  840. sizes to be enumerated, regardless of display (and eye) capabilities. 
  841.  
  842. Each font shows it's find index, that is the order in which it was found. This 
  843. number is of no consequence, and is used to index an internal font table. You 
  844. may nevertheless find it a useful pointer to the current font in the listbox. 
  845.  
  846. From V1.20, you may use any monospaced font Program Editor finds. The current 
  847. font and it's index are shown above the listbox. The current font size is shown 
  848. until you select an alternative. 
  849.  
  850. Select Apply to view the new font. If you press Cancel, the display will revert 
  851. to the original font. You may thus safely preview fonts on the text window. 
  852.  
  853. The font dialog is a seperate thread. 
  854.  
  855. See Also Colour Options 
  856.  
  857. Warning 
  858. Small or inappropriate fonts can cause severe headaches and/or eyestrain! 
  859.  
  860.  
  861. ΓòÉΓòÉΓòÉ 7.2. Colour Options ΓòÉΓòÉΓòÉ
  862.  
  863. You may drag and drop colours onto the Program Editor text window. The only 
  864. colours accepted are Solid Colours. Some background colours will make the 
  865. cursor difficult to see. 
  866.  
  867. To allow you to change font colours, a little coloured square is shown during 
  868. the font dialog. You may drop colours onto this square to change the text 
  869. colour. If the text colour chosen is the same as the background colour the text 
  870. will disappear. 
  871.  
  872. Window and text colours are retained on exit. 
  873.  
  874.  
  875. ΓòÉΓòÉΓòÉ 7.3. Setting the tab size ΓòÉΓòÉΓòÉ
  876.  
  877. Enter the number of spaces to type when you press the Tab key. 
  878.  
  879. Please ensure that you select a number that is sensible eg >1 and <255. This 
  880. value is not checked for errors. 
  881.  
  882.  
  883. ΓòÉΓòÉΓòÉ 7.4. Using Autosave ΓòÉΓòÉΓòÉ
  884.  
  885. When Autosave is enabled, Your file will be saved after a number of key 
  886. presses. Any keypress is counted, including arrow keys. 100 is the recommended 
  887. default. This setting is saved on exit. 
  888.  
  889.  
  890. ΓòÉΓòÉΓòÉ 7.5. Use EOF character ΓòÉΓòÉΓòÉ
  891.  
  892. The EOF character delimits the end of a text file. This usually causes no 
  893. problem and therefore should always be set. If you DO have a problem, eg. with 
  894. a compiler, setting EOF off strips the EOF character from your file on saving. 
  895.  
  896. Note:  Program Editor will always show an EOF character. This is useful if 
  897. there are a lot of useless and normally invisible spaces or lines at the end of 
  898. the file. 
  899.  
  900.  
  901. ΓòÉΓòÉΓòÉ 7.6. Setting the script path ΓòÉΓòÉΓòÉ
  902.  
  903. If you have installed the supplied "*.scr" files into the current directory you 
  904. may not need to perform this step. 
  905.  
  906. Enter the full path and filename (including the extension) of your default 
  907. script. The path is where Program Editor looks for all script files and 
  908. "pmproged.eas". The script filename is always run on startup. You must have a 
  909. startup script file, or you will get an error message. This main script file is 
  910. the ideal place to setup your own script menu. 
  911.  
  912. Once the script path is set, you can setup an alternative startup script on the 
  913. Command Line. This allows you to customise Program Editor to a number of 
  914. different uses. 
  915.  
  916. Note:  Always type the full path and script filename including it's file 
  917. extension. 
  918.  
  919.  
  920. ΓòÉΓòÉΓòÉ 7.7. Setting the Parse Profile ΓòÉΓòÉΓòÉ
  921.  
  922. The first item is the command to compile a file, whilst the second is a script 
  923. to find the numeric positions of any errors found. You are not limited to any 
  924. particular language, but the compiler must issue errors and warnings to STDOUT 
  925. or STDERR. If not, you may be able to use /e on the Command Line to specify an 
  926. error listing. 
  927.  
  928. You must save the file before executing the command, as the saved file is the 
  929. one that is parsed. 
  930.  
  931. $$(file) is used to set a filename into the command string. (see below) 
  932.  
  933. I use the following with IBM C Set++ **. 
  934.  
  935. Command.- 
  936.  
  937. icc /Fo- /C /Gm /Ss /W3 $$(FILE) 
  938.  
  939. Find Script.- 
  940.  
  941. set[hpos,0,set[vpos,0,] /* clear vars*/ 
  942. home[,,]         /* start of line*/ 
  943. find["(",,txtset[vpos,,]/* get vert*/ 
  944. find[":",,txtset[hpos,,]/* get horz*/ 
  945. sub[hpos,1,] /*icc counts from 1, pmproged from 0 */ 
  946. sysptr[vpos,hpos,]    /* set goto*/ 
  947. hilite[false,,]     /*turn off hilite in error list*/ 
  948.  
  949. Redirect.- Set to STDOUT 
  950.  
  951. Note:  ** IBM C Set++ (c) IBM . Registered trademarks of International Business 
  952. Machines Corporation. 
  953.  
  954.  
  955. ΓòÉΓòÉΓòÉ 7.8. Statistics ΓòÉΓòÉΓòÉ
  956.  
  957. This dialog shows the internal state of Program Editor. All the items are 
  958. fairly self explanatory. To work out the total memory used add the edit and 
  959. error file 'memory used' hexadecimal values together and add 0x1000 for 
  960. scripts. 
  961.  
  962.  
  963. ΓòÉΓòÉΓòÉ 8. Command Line Options ΓòÉΓòÉΓòÉ
  964.  
  965. pmproged (options) filename 
  966.  
  967. eg pmproged /eerror.lst /g100 /smyscript.scr myfile.c 
  968.  
  969. If you have a number of different objects for program editor, you can put 
  970. different options into the parameters field of each object. To find out more 
  971. about the different things that can be achieved by object settings, look at the 
  972. OS/2 system documentation. 
  973.  
  974. These are the options available. 
  975.  
  976.       /e ...Load an error list file into memory 
  977.  
  978.       /g ...Goto line 
  979.  
  980.       /s ...Load a script and execute it instead of the default 
  981.  
  982.  Note:  There is no space between options and their contents. /s, /S, -s, and 
  983.  -S, (where s is an option) are all equivalent. 
  984.  
  985.  
  986. ΓòÉΓòÉΓòÉ 9. Parse Menu ΓòÉΓòÉΓòÉ
  987.  
  988. Allows you to parse source files. You are not limited to any particular 
  989. language, but the compiler must issue errors and warnings to STDOUT or STDERR. 
  990. If not, you may be able to use /e on the Command Line to specify an error 
  991. listing. 
  992.  
  993. See Also 
  994.  
  995.       Command Line Options 
  996.  
  997.       Setting the Parse Profile 
  998.  
  999.  
  1000. ΓòÉΓòÉΓòÉ 9.1. Parse File ΓòÉΓòÉΓòÉ
  1001.  
  1002. This option allows you to parse a file. The file that is parsed is the one on 
  1003. disk, specified by the current filename. You must have a file open on the 
  1004. screen and saved before parsing. You must also have set up a valid parse 
  1005. profile. You are not limited to any particular language, but the compiler must 
  1006. issue errors and warnings to STDOUT or STDERR. If not, you may be able to use 
  1007. /e on the Command Line to specify an error listing. 
  1008.  
  1009. A small icon to the far right of the menu bar indicates the parse status. You 
  1010. may continue to edit during a parse. The icon will disappear after the parse is 
  1011. complete and you select the Parse menu. 
  1012.  
  1013. You can look at the errors found by using the View Error List menu option. 
  1014.  
  1015.            The file is being parsed. 
  1016.            Parse has found errors. 
  1017.            Parse has found no errors. 
  1018.  
  1019.  See Also 
  1020.  
  1021.       Command Line Options 
  1022.  
  1023.       Setting the Parse Profile 
  1024.  
  1025.  
  1026. ΓòÉΓòÉΓòÉ 9.2. First Error ΓòÉΓòÉΓòÉ
  1027.  
  1028. If you have an error list loaded, and a correct parse profile, this item will 
  1029. place you at the first error that was found. 
  1030.  
  1031. This is not necessarily the point where the error occurred. 
  1032.  
  1033. See Also 
  1034.  
  1035.       Command Line Options 
  1036.  
  1037.       Setting the Parse Profile 
  1038.  
  1039.       Parsing a file 
  1040.  
  1041.  
  1042. ΓòÉΓòÉΓòÉ 9.3. Next Error ΓòÉΓòÉΓòÉ
  1043.  
  1044. If you have an error list loaded, and a correct parse profile, this item will 
  1045. place you at the next error that was found. 
  1046.  
  1047. This is not necessarily the point where the error occurred. 
  1048.  
  1049. See Also 
  1050.  
  1051.       Command Line Options 
  1052.  
  1053.       Setting the Parse Profile 
  1054.  
  1055.       Parsing a file 
  1056.  
  1057.  
  1058. ΓòÉΓòÉΓòÉ 9.4. Previous Error ΓòÉΓòÉΓòÉ
  1059.  
  1060. If you have an error list loaded, and a correct parse profile, this item will 
  1061. place you at the first error that was found. 
  1062.  
  1063. This is not necessarily the point where the error occurred. 
  1064.  
  1065. See Also 
  1066.  
  1067.       Command Line Options 
  1068.  
  1069.       Setting the Parse Profile 
  1070.  
  1071.       Parsing a file 
  1072.  
  1073.  
  1074. ΓòÉΓòÉΓòÉ 9.5. View Error List ΓòÉΓòÉΓòÉ
  1075.  
  1076. If you have an error list loaded, this item will allow you to view the error 
  1077. list. Note that the File menu will be disabled while viewing errors. 
  1078.  
  1079. See Also 
  1080.  
  1081.       Command Line Options 
  1082.  
  1083.       Setting the Parse Profile 
  1084.  
  1085.       Parsing a file 
  1086.  
  1087.  
  1088. ΓòÉΓòÉΓòÉ 10. Help Menu ΓòÉΓòÉΓòÉ
  1089.  
  1090. To make Program Editor quick at starting, Help is not automatically enabled. On 
  1091. a slow PC this makes Program Editor much faster, and on a fast PC, it's only 
  1092. slightly more difficult to get help. Many users may not even notice the 
  1093. difference. 
  1094.  
  1095. Having made it to here, help is now Enabled. 
  1096.  
  1097. To enable help select Help from the menubar or press the F1 key. Help will also 
  1098. automatically be enabled when selecting a Help button in a dialog. 
  1099.  
  1100. Until help is enabled pressing F1 during a menu selection will have no effect. 
  1101.  
  1102. If help is enabled select Help.. and then the topic of interest. If no specific 
  1103. help is available, the About page is displayed. See Using Help for a more 
  1104. detailed description of the help system. 
  1105.  
  1106. The About page is also found in Help.. General Help.. on the menubar. 
  1107.  
  1108.  
  1109. ΓòÉΓòÉΓòÉ 10.1. Keys Help ΓòÉΓòÉΓòÉ
  1110.  
  1111. Where a (+) sign is shown, this means press both keys together. Hold down the 
  1112. first key, and then press the second. 
  1113.  
  1114.  Key             Action 
  1115.  Home            Go to start of line. 
  1116.  Alt+0(zero)     Go to start of file. 
  1117.  Ctrl+Home       Go to start of text. (Skip indent) 
  1118.  End             Go to end of line. 
  1119.  Ctrl+End        Go to end of file. 
  1120.  Page Up         Go up one page. 
  1121.  Page Down       Go down one page. 
  1122.  Arrows          Move in the direction of the arrow. 
  1123.  Ctrl+Left       Go to start of next word. 
  1124.  Ctrl+Right      Go to start of previous word. 
  1125.  Shift+Any...    Hilite the text while moving, use any key sequence above. 
  1126.  
  1127.  Delete          Delete char to right of cursor. 
  1128.  Backspace       Delete char to left of cursor. 
  1129.  Insert          Toggle insert mode 
  1130.  F1              Help Enable, then Help. 
  1131.  ESC             Abandon execution of parse, detab, find, or script. 
  1132.  
  1133.  Others...       ...Shown next to menu item 
  1134.  
  1135.  Note:  Not all menu items have a shortcut key. 
  1136.  
  1137.  
  1138. ΓòÉΓòÉΓòÉ 11. The Status Line ΓòÉΓòÉΓòÉ
  1139.  
  1140. The status line at the bottom of the text page displays information relevant to 
  1141. the current position in the file. 
  1142.  
  1143. Status Information 
  1144.  
  1145.    1. OVR or INS, indicates whether you are in insert or overtype mode. If you 
  1146.       are in overtype mode, the cursor changes from a line to a box. You cannot 
  1147.       overtype the end of the file. 
  1148.  
  1149.    2. Display Line, indicates the line number of the top visible line on the 
  1150.       screen. As you can look at a point in the file unrelated to the cursor 
  1151.       position, this number is usually different to that of the cursor. 
  1152.  
  1153.    3. Cursor, indicates the current cursor vertical, and horizontal position. 
  1154.       This is where to look if you cannot find your cursor on the screen. 
  1155.  
  1156.    4. @, indicates the current file position in characters, counting from zero 
  1157.       at the start of the file. 
  1158.  
  1159.    5. Brackets, indicates the number of mismatched brackets in the file. If you 
  1160.       have more open brackets than close brackets, the number of odd brackets 
  1161.       and their type are displayed. With practice, this is a great way of 
  1162.       checking bracket nesting in "C". (but sadly no use for scripts) 
  1163.  
  1164.  
  1165. ΓòÉΓòÉΓòÉ 12. Hints and Tips ΓòÉΓòÉΓòÉ
  1166.  
  1167. Parse Profile 
  1168.  
  1169. The easiest way to set up a parse profile is probably as follows.- 
  1170.  
  1171.      Create a source file full of errors. 
  1172.  
  1173.      Run your compiler and make a note of the options used. 
  1174.  
  1175.      Check that the compiler displays a list of errors. 
  1176.  
  1177.      Open the source file with program editor. 
  1178.  
  1179.      Setup the parse profile to run the compiler with the same options as 
  1180.       before. 
  1181.  
  1182.      Type a dummy script in the script entryfield of the parse profile. eg 
  1183.       abs[0,,] 
  1184.  
  1185.      Parse the file.If no error list is created experiment with the 
  1186.       redirection buttons. 
  1187.  
  1188.      View the error list, select all, and copy. 
  1189.  
  1190.      View the file, and select new. Select Paste. 
  1191.  
  1192.      Save the error list with a new name using Save As. 
  1193.  
  1194.  You can now experiment with the Error list. The first, next, and previous 
  1195.  error menuitems function like this.- 
  1196.  
  1197.  First Error     Goto line 1 
  1198.  Next Error      Go down a line 
  1199.  Previous Error  Go Up a line 
  1200.  
  1201.  What you do next is rather dependant on the error list. The script file must 
  1202.  be able to position itself on the error linenumbers so that you can use 
  1203.  txtset[,,] to read them. Do not use sysptr[,,] yet, you will add that later. 
  1204.  
  1205.  If your compiler does not issue error line numbers you cannot proceed. 
  1206.  
  1207.  Develop and test your script using the execute script dialog. Satisfy yourself 
  1208.  that the script will find the error number from the start of the line, and 
  1209.  then use home[,,] to put you there. You should end up with something vaguely 
  1210.  like this.- 
  1211.  
  1212.   home[,,]
  1213.   find["???",true,txtset[scr1,,]
  1214.   find["???",true,txtset[scr2,,]
  1215.  
  1216.  If your compiler numbers lines from 0, you will have to use add[,,] to add 1 
  1217.  to the line number. 
  1218.  
  1219.  Copy the script to the parse profile and add the sysptr[,,] command. If you 
  1220.  don't have a horizontal error position leave it blank. Your final parse script 
  1221.  will look something like.- 
  1222.  
  1223.   home[,,]
  1224.   find["???",true,txtset[scr1,,]
  1225.   find["???",true,txtset[scr2,,]
  1226.   sysptr[scr1,scr2,]
  1227.  
  1228.  Script Path 
  1229.  
  1230.  Program Editor uses the script path setting to obtain associated files. 'Scrip 
  1231.  Path' is really an inadequate name, because not only scripts should be placed 
  1232.  here, but any future internal files that may be issued for later versions. The 
  1233.  file pmproged.eas is placed here for example. When you save a New file, 
  1234.  Program Editor calls EAUTIL to set the extended attributes to those contained 
  1235.  in pmproged.eas. If the file is not found, or EAUTIL fails for some reason, 
  1236.  the new file will not have the correct extended attribute. AND YOU WILL NOT BE 
  1237.  WARNED. It is not inconceivable that someone may wish to create their own 
  1238.  version of pmproged.eas, but if you get it wrong, you may create 'orphan' 
  1239.  files. eg 'Caveat Emptor'!! BEWARE. If you use the supplied install utility, 
  1240.  you should not go far wrong. But don't forget to set the script path, it does 
  1241.  more than you think!! 
  1242.  
  1243.  Script Menu 
  1244.  
  1245.  There are several ways in which script menu's are used. You can have a main 
  1246.  script which allow you to select a whole new menu. The main script would load 
  1247.  a script which first deletes all or some of the menuitems, and then adds it's 
  1248.  own. Bear in mind that anything complex soon becomes burdensome, keep it 
  1249.  simple. Have a look at killmenu.scr and main.scr to see how menu's can be 
  1250.  controlled. 
  1251.  
  1252.  If you use exec[,,] it must be the last command in a script, unless the script 
  1253.  resides in the execute script entryfield the executed script overwrites the 
  1254.  calling script. You can consider exec[,,] to be like a goto, not a gosub. When 
  1255.  you select a script menuitem, the editor calls exec[,,] itself. 
  1256.  
  1257.  Use the truncspc.scr script to strip trailing spaces. This can substantially 
  1258.  shrink file sizes. 
  1259.  
  1260.  
  1261. ΓòÉΓòÉΓòÉ 13. The Problem Page ΓòÉΓòÉΓòÉ
  1262.  
  1263. Not many so far.. 
  1264.  
  1265.      Mouse pointer sometimes shows a clock. Moving the mouse outside the text 
  1266.       area restores the cursor. This appears to be a bug in VIEW.EXE the help 
  1267.       system. 
  1268.      If line ends are incorrect please ensure that you do not confuse the file 
  1269.       by having CR without LF, or worse, LF then CR, in the file. This can 
  1270.       theoretically happen with scripting or by using AltGr. The correct end of 
  1271.       line is CR+LF in that order. 
  1272.  You can 'workaround' by using the System Editor to open the file, modify, and 
  1273.  then save it. Typing space followed by backspace modifies the file. Or, you 
  1274.  can transfer the file through the clipboard. 
  1275.      (fixed?)If the bracket counters get confused, going to the start of file 
  1276.       will reset them. 
  1277.      (V1.20)Opening Find or Detab during a parse dramatically slows down the 
  1278.       parse but allows Find or Detab adequate time to function. (Fix.. get a 
  1279.       Cray!) 
  1280.      Please report problems to me. 
  1281.  
  1282.  Fixes in V1.20 
  1283.  
  1284.    1. Improved text selection mechanism. 
  1285.    2. Improved handling of cursors and pointers during focus and activation 
  1286.       changes. 
  1287.    3. Fixed bug in bracket counters. 
  1288.    4. Fixed memory deallocation failure in parse command. 
  1289.    5. Rewritten parse runs in background. 
  1290.    6. Updated this file. 
  1291.    7. New and updated script commands. Backward compatible. 
  1292.    8. Improved detab with dialog. 
  1293.    9. Added Statistics dialog. 
  1294.   10. Faster load times. 
  1295.  
  1296.  Note:  CR and LF are carriage return (AltGr+13) and line feed (AltGr+10). 
  1297.  
  1298.  
  1299. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1300.  
  1301. eg. gethpos[,,] 
  1302. Set by. 
  1303.  
  1304.      gethpos 
  1305.      Maths functions 
  1306.  Used by. 
  1307.  
  1308.      All. 
  1309.  
  1310.  
  1311. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1312.  
  1313. eg. getvpos[,,] 
  1314. Set by. 
  1315.  
  1316.      getvpos 
  1317.      Maths functions 
  1318.  Used by. 
  1319.  
  1320.      All. 
  1321.  
  1322.  
  1323. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1324.  
  1325. eg. set[scr1,20,] 
  1326. Set by. 
  1327.  
  1328.      Maths functions 
  1329.  Used by. 
  1330.  
  1331.      All. 
  1332.  
  1333.  
  1334. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1335.  
  1336. eg. set[scr2,20,] 
  1337. Set by. 
  1338.  
  1339.      Maths functions 
  1340.  Used by. 
  1341.  
  1342.      All. 
  1343.  
  1344.  
  1345. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1346.  
  1347. Size of a tab eg. set[scr1,tab,] 
  1348. Set by. 
  1349.  
  1350.      tabsize 
  1351.      System. 
  1352.  Used by. 
  1353.  
  1354.      All. 
  1355.  
  1356.  
  1357. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1358.  
  1359. Size of file eg. loop[file,,] 
  1360. Set by. 
  1361.  
  1362.      System. 
  1363.  Used by. 
  1364.  
  1365.      All. 
  1366.  
  1367.  
  1368. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1369.  
  1370. Number of lines in the file eg. loop[fpos,,] 
  1371. Set by. 
  1372.  
  1373.      System. 
  1374.  Used by. 
  1375.  
  1376.      All. 
  1377.  
  1378.  
  1379. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1380.  
  1381. Current absolute cursor position eg. loop[abs,,backsp[,,] /delete to start of 
  1382. file/ 
  1383. Set by. 
  1384.  
  1385.      System. 
  1386.  Used by. 
  1387.  
  1388.      All. 
  1389.  
  1390.  
  1391. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1392.  
  1393. Start of hilite eg. abs[hst,,] 
  1394. Set by. 
  1395.  
  1396.      hilst 
  1397.      System (eg. using the mouse). 
  1398.  
  1399.  Note:  hst is always less than hend. 
  1400.  Used by. 
  1401.  
  1402.      All. 
  1403.  
  1404.  
  1405. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1406.  
  1407. End of hilite eg. abs[hend,,] 
  1408. Set by. 
  1409.  
  1410.      hilend 
  1411.      System (using the mouse). 
  1412.  
  1413.  Note:  hend is always greater than hst. 
  1414.  Used by. 
  1415.  
  1416.      All. 
  1417.  
  1418.  
  1419. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1420.  
  1421. True equals 1 eg. loop[true,,] /loops once/ 
  1422. Set by. 
  1423.  
  1424.      System. 
  1425.  Used by. 
  1426.  
  1427.      All. 
  1428.  
  1429.  
  1430. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1431.  
  1432. False equals zero eg. abs[false,,] /goto start of file/ 
  1433. Set by. 
  1434.  
  1435.      System. 
  1436.  Used by. 
  1437.  
  1438.      All. 
  1439.  
  1440.  
  1441. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1442.  
  1443. bklr, bkrr, bklc, bkrc, bkls, bkrs 
  1444.  
  1445. Bracket counters bk(l,r = left or right)(r,s,c = round, square, or curly) 
  1446.  
  1447. Set by 
  1448.  
  1449.      System. 
  1450.  Used by. 
  1451.  
  1452.      All. 
  1453.  
  1454.  
  1455. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1456.  
  1457. Zero eg. abs[zero,,] /goto start of file/ 
  1458. Set by. 
  1459.  
  1460.      System. 
  1461.  Used by. 
  1462.  
  1463.      All. 
  1464.  
  1465.  
  1466. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1467.  
  1468. paste[,,] 
  1469.  
  1470. Paste from Clipboard.Deletes hilited area. 
  1471.  
  1472. Returns clipboard data valid(eg success). 
  1473.  
  1474.  
  1475. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1476.  
  1477. instxt[,,] 
  1478.  
  1479. Insert text from clipboard. Does not delete hilited area. 
  1480.  
  1481. Returns clipboard data valid(eg success). 
  1482.  
  1483.  
  1484. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1485.  
  1486. cut[,,] 
  1487.  
  1488. Copy text to clipboard and delete hilited area. 
  1489.  
  1490. Returns hilited flag. 
  1491.  
  1492.  
  1493. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1494.  
  1495. copy[,,] 
  1496.  
  1497. Copy text to clipboard. 
  1498.  
  1499. Leaves hiliting unaffected 
  1500.  
  1501.  
  1502. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1503.  
  1504. clear[,,] 
  1505.  
  1506. Delete hilited area. 
  1507.  
  1508. Returns hilited flag. 
  1509.  
  1510.  
  1511. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1512.  
  1513. find[value,flag,] 
  1514.  
  1515. eg. find["hello",true,] Find text in file and hilite it. If flag is true the 
  1516. find is case sensitive, otherwise it isn't. 
  1517.  
  1518. Returns TRUE if found 
  1519.  
  1520.  
  1521. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1522.  
  1523. ishil[,,] and !ishil[,,] 
  1524.  
  1525. Check to see if hiliting is on or off. 
  1526.  
  1527. Returns TRUE if condition is met. 
  1528.  
  1529.  
  1530. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1531.  
  1532. exec["filename",,] 
  1533.  
  1534. Load the script file into memory and execute it. Exec must be the last command 
  1535. in a script because the new script overwrites the old. 
  1536.  
  1537. Returns false on failure. 
  1538.  
  1539.  
  1540. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1541.  
  1542. true[,,] and false[,,] 
  1543.  
  1544. Return 1 and 0 respectively. Ignore Previous Flags !! 
  1545.  
  1546.  
  1547. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1548.  
  1549. eof[,,], !eof[,,], stf[,,], and !stf[,,] 
  1550.  
  1551. Test to see if at the end or start of the file. 
  1552.  
  1553. Returns TRUE if condition is met. 
  1554.  
  1555.  
  1556. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1557.  
  1558. eoln[,,] and !eoln[,,] 
  1559.  
  1560. Test to see if at the end of a line. 
  1561.  
  1562. Returns TRUE if condition is met. 
  1563.  
  1564.  
  1565. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1566.  
  1567. stln[,,] and !stln[,,] 
  1568.  
  1569. Test to see if at the start of a line. 
  1570.  
  1571. Returns TRUE if condition is met. 
  1572.  
  1573.  
  1574. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1575.  
  1576. del[,,] 
  1577.  
  1578. Delete character to right of cursor. 
  1579.  
  1580.  
  1581. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1582.  
  1583. backsp[,,] 
  1584.  
  1585. Delete character to left of cursor. 
  1586.  
  1587.  
  1588. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1589.  
  1590. istxt[value,flag,] and !istxt[value,flag,] 
  1591.  
  1592. eg. istxt["hello",true,] Test text in file. If flag is true the test is case 
  1593. sensitive, otherwise it isn't. 
  1594.  
  1595. Returns either TRUE or FALSE if the text strings match. 
  1596.  
  1597.  
  1598. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1599.  
  1600. inhil[,,] and !inhil[,,] 
  1601.  
  1602. Test to see if the cursor is in the hilited area. 
  1603.  
  1604. Returns TRUE if condition is met. 
  1605.  
  1606.  
  1607. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1608.  
  1609. paint[,,] 
  1610.  
  1611. Repaints the text screen. Use sparingly as this slows scripts down a great 
  1612. deal. 
  1613.  
  1614. No return flag specified 
  1615.  
  1616.  
  1617. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1618.  
  1619. sysptr[vertical,horizontal,] 
  1620.  
  1621. Currently only used by parse scripts, Sets the vertical and horizontal position 
  1622. for the First, Next, and Previous Error commands. 
  1623.  
  1624. Ignores the previous flag state. 
  1625.  
  1626. No return flag specified 
  1627.  
  1628.  
  1629. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1630.  
  1631. abs[value,,] 
  1632.  
  1633. Goto the absolute file position specified in value. eg. abs[0,,] /go home/ 
  1634.  
  1635.  
  1636. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1637.  
  1638. menuitem[menuitemtext,filename,] 
  1639.  
  1640. eg. menuitem["Insert {..}","insbkt.scr",] 
  1641.  
  1642. Insert new menuitem into script menu. note that the menuitem must be able to 
  1643. find the named script file in the SCRIPT PATH and load it into memory. 
  1644.  
  1645. Note:  false[,,menuitem[,,] deletes the last menuitem. 
  1646.  
  1647.  
  1648. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1649.  
  1650. leftwrd[,,], rightwrd[,,] 
  1651.  
  1652. Move the cursor to the start of the previous or next word 
  1653.  
  1654.  
  1655. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1656.  
  1657. left[,,], right[,,], up[,,], and down[,,] 
  1658.  
  1659. Move the cursor in the direction indicated. 
  1660.  
  1661.  
  1662. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1663.  
  1664. tabmov[,,] 
  1665.  
  1666. Move the cursor to the next tab position. Will not cross to the next line. 
  1667.  
  1668.  
  1669. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1670.  
  1671. backtab[,,] 
  1672.  
  1673. Move the cursor to the previous tab position. Will not cross to the previous 
  1674. line. 
  1675.  
  1676.  
  1677. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1678.  
  1679. home[,,] and end[,,] 
  1680.  
  1681. Goto the start and end of the current line. 
  1682.  
  1683.  
  1684. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1685.  
  1686. txthome[,,], txtend[,,] 
  1687.  
  1688. Positions the cursor at the start or end of text. 
  1689.  
  1690. txthome[,,] works like Ctrl+Home on the keyboard by moving to the start of a 
  1691. line and skipping all leading whitespace. 
  1692.  
  1693. txtend[,,] stops at the beginning of any trailing whitespace. 
  1694.  
  1695.  
  1696. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1697.  
  1698. line[vertical,horizontal,] 
  1699.  
  1700. Goto Line number. Vertical must be 1 or greater. Horizontal starts at 0 and 
  1701. must not be greater than the line length. 
  1702.  
  1703.  
  1704. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1705.  
  1706. hilst[,,], hilend[,,], and hilall[,,] 
  1707.  
  1708. Set hilite start or end to current position. Start can be greater than End. 
  1709. There are no restrictions. Hilall hilites the entire file. 
  1710.  
  1711.  
  1712. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1713.  
  1714. hilite[flag,,] 
  1715.  
  1716. Turns on hiliting if flag is not equal to 0. Else turns off hiliting. 
  1717.  
  1718.  
  1719. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1720.  
  1721. ins[text,quantity,] and ovr[text,quantity,] 
  1722.  
  1723. Inserts or overtypes text, quantity number of times. eg. ins["hello",1,] 
  1724.  
  1725.  
  1726. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1727.  
  1728. crins[quantity,,] and crovr[quantity,,] 
  1729.  
  1730. Insert or overtype quantity number of new lines eg. crins[5,,] /insert 5 new 
  1731. lines/ 
  1732.  
  1733.  
  1734. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1735.  
  1736. tabins[,,] and tabovr[,,] 
  1737.  
  1738. Insert or overtype a tab. Tabsize can be set by tabsize[size,,] 
  1739.  
  1740.  
  1741. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1742.  
  1743. tabsize[value,,] 
  1744.  
  1745. Set default tab size.This is not system wide and is restored on exit. 
  1746.  
  1747.  
  1748. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1749.  
  1750. gethpos[,,] and getvpos[,,] 
  1751.  
  1752. Load current cursor horizontal or vertical cursor position into hpos and vpos. 
  1753.  
  1754.  
  1755. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1756.  
  1757. set[variable,value,], add[variable,value,], and sub[variable,value,] 
  1758.  
  1759. Mathematical operation affects variable by adding, subtracting or setting with 
  1760. value. eg. add[hpos,20,] 
  1761.  
  1762.  
  1763. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1764.  
  1765. txtset[variable,,] 
  1766.  
  1767. If there is a number in the File (or Error List), then variable is set to that 
  1768. number, else zero. 
  1769.  
  1770. Used mostly by Parse scripts. eg. txtset[vpos,,] 
  1771.  
  1772.  
  1773. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  1774.  
  1775. loop[value,,] 
  1776.  
  1777. The command chain repeats until quantity is reached or a command returns FALSE. 
  1778. eg. loop[1000,,!eof[,,right[,,] will step right 1000 times or to end of file, 
  1779. whichever occurs first. 
  1780.  
  1781. Note loops can be flagged on entry OR on exit, or both. Because instructions 
  1782. are executed in turn, odd results may occur if some care is not taken with 
  1783. complex looping scripts. Remember, the flag is passed from instruction to 
  1784. instruction within the chain. 
  1785.  
  1786. eg. 
  1787.  
  1788. This is not valid.. 
  1789.  
  1790. false[,,loop[20,,true[,,ins["hello",1,] /never notices loop instruction at all/ 
  1791.  
  1792. ... equivalent to.. 
  1793.  
  1794. ins["hello",1,] 
  1795.  
  1796. But this is valid.. 
  1797.  
  1798. loop[2,,ins["hello",1,right[,,!eoln[,,] /will insert at least 1 "hello"/ 
  1799.  
  1800. This is also valid.. 
  1801.  
  1802. eoln[,,loop[2,,crovr[1,,] /do loop if end of line / 
  1803.  
  1804. Or.. 
  1805.  
  1806. loop[file,,istxt["{",,del[,,true[,,!eof[,,] /force loop to do whole file/