home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
pmproged.zip
/
PMPROGED.HLP
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1995-12-21
|
56KB
|
1,806 lines
ΓòÉΓòÉΓòÉ 1. About Program Editor ΓòÉΓòÉΓòÉ
Programmers Editor for OS/2
Created by Peter Koller, La vieille Maison d'Anglais, Trebuon, 29530 Plonevez
du Faou, France. (...more...)
About La Maison d'Anglais
La Maison d'Anglais pictured above is a 17th century (169?) weavers cottage of
either English or Flemish (Angles) origin. The programs originating therein are
the products of Peter Koller, a dedicated Hardware and Software engineer of
more than 18 years experience in the design of computers, their software, and
their interface to the real world.
Program Editor for OS/2 is a product designed to provide a simple, well thought
out basis to a program development environment. Although designed for
programmers, SysOp's may find this editor useful for editing messy or complex
files.
Salient features include the ability to run compilers for parsing and
customisation using editor scripts.
Program Editor provides a substantially User Friendly environment for editing
text files. Loading time is short, and cursor movement controls are refined.
File EA's are set for new files, click on the file to start the editor.
Overview
LOADS of minor features plus...
Customisable edit functions (scripts).
Background Exec to Parse. Test/Make your programs before exiting the
editor.
Works with most compilers.
Customizable goto error keys position you at the error.
Extensively MultiThreaded.
Smooth Scrolling.
Well Tested.
Good General Purpose Editor, esp. large files.
Fast, Reliable, Safe.
Program editor evaluation copy is a fully functional product for you to enjoy
for 30 days. After that, Please Register....
Other products available
PM Make
PM Make is a programmers make utility that makes use of the PM interface to
provide the necessary functions for project maintenance.-
Built in project backup and restore.
User menus defined in the makefile can set compiler, etc., options.
Can include 'global' makefiles as headers.
Can stop on error.
Allows review of error messages.
Force make according to compiler, linker, or user options or make all.
Can make .exe, .hlp, .dll, etc... all in one build.
Background build with 'pop up on error' mode.
Can work in multiple directories, and circumvent tools that won't
recognize paths.
Fast.
Applicable to any third party compilers, linkers, or other tools.
Enquiries concerning the production of new products, or the inclusion of this
product into new products, or the inclusion of features from this product into
new products are very welcome.
See Also:-
Installation.
(c) Copyright
What is a Script.
Note: This product is designed for use with third party products. These third
party products have their own copyright. This product does not confer any
rights to you in respect of a third party.
ΓòÉΓòÉΓòÉ 2. Installation ΓòÉΓòÉΓòÉ
Installation Instructions
You must use the Install utility provided if you wish to
Install Program Editor.
Uninstall Program Editor.
Register Program Editor.
If you are merely registering, you can uncheck all the buttons before
proceeding. The minimum files installed are pmproged.exe, pmproged.hlp,
pmproged.eas, and register.doc.
That's it !! Enjoy.
To uninstall Program Editor run install.exe and select Uninstall, the press
Install. Be sure the path and help path is entered correctly before
uninstalling. Only those files supplied in the original package will be
deleted. You must delete any Objects or Folders by hand. Delete the 'Program
Edited' template in the Templates folder and reboot your system.
ΓòÉΓòÉΓòÉ 3. (c)copyright ΓòÉΓòÉΓòÉ
This program is the (c) copyright of
Peter Koller,
La vieille Maison d'Anglais,
Trebuon,
29530, Plonevez du Faou,
FRANCE.
All Rights Reserved.
Note: This copyright includes the whole product, including the scripting
language format, the installation program, and all documentation associated
with the product.
1. You may use the program only on a single machine at any one time.If you
have purchased a multiple copy, you may use an according number of copies
simultaneously.
2. You may copy the program into machine readable or printed form for backup
or data compression purposes. You may not reverse engineer or disassemble
the program.
3. You may give this copy to others. You may also charge the end user
reasonable costs incurred by your distribution of this product. Please
ensure you distribute the entire package as shown below.
4. This product is Shareware. You Must be registered if you continue to use
this product after you have evaluated it. Unregistered software will time
out after one month.
5. If you have a Customer Registration Code (CRN), you must not disclose it
to anyone. Please quote the number shown in the statistics dialog, rather
than the full CRN, when seeking technical support.
The Author accepts no liability for fitness of purpose, or damages caused
whether incidental, or consequential, by the use of this product, howsoever
caused. This product is Sold As Seen. In those countries where this statement
conflicts with your statutory rights your statutory rights shall remain
unaffected.
This product consists of
install.exe The program install utility.
pmpfold.cmd REXX folder creation, used by install.exe
pmproged.exe The executable file.
pmproged.hlp This help File.
pmproged.inf This help File in .INF format.
pmproged.eas The extended attributes file (essential)
exe.eas The .exe file extended attributes.
register.doc The product registration sheet.
read.me Late breaking information.
uninstal.doc How to remove (uninstall) Program Editor
main.scr Main example script.
home.scr Home example script
eof.scr End of file example script
poptab.scr Deindent example script
pushtab.scr Indent example script
insbkt.scr Insert Brackets example script
test.scr Test Message example script
killmenu.scr Reset menu example script
truncspc.scr Truncate trailing whitespace example script.
ΓòÉΓòÉΓòÉ 4. File Menu ΓòÉΓòÉΓòÉ
This menu is used to.-
Start a new file.
Open an existing file.
Save a file.
Save a file under a new name (SaveAs).
ΓòÉΓòÉΓòÉ 4.1. Starting a New File ΓòÉΓòÉΓòÉ
Select File, then New.
If you have typed anything, you will be prompted to save it in a file. Select
cancel to abandon the new file command. If you decide to save the file select a
save file or cancel to clear the screen and open the new file.
ΓòÉΓòÉΓòÉ 4.2. Opening a File ΓòÉΓòÉΓòÉ
Select File, then Open.
If you have typed anything, you will be prompted to save it in a file. Select a
save file or Cancel. Only then will the Open dialog appear.
Double clicking on a directory or drive will select that directory or drive.
Single clicking on a file will select that file, while double clicking will
load the file and exit the Open dialog.
ΓòÉΓòÉΓòÉ 4.3. Saving a File ΓòÉΓòÉΓòÉ
Select File, then Save.
If your file has no name, you will be prompted for one.
ΓòÉΓòÉΓòÉ 4.4. Saving a File under a new name ΓòÉΓòÉΓòÉ
Select File, then SaveAs.
You will be prompted to give a file name. You may also select a new path at
this point.
Double clicking on a directory or drive will select that directory or drive.
Single clicking on a file will select that file, while double clicking will
select the file and exit the Save As dialog.
If you are overwriting an existing file, you will be required to confirm an
appropriate action, where Yes means overwrite the file, No means ask for a new
file name, and Cancel aborts the SaveAs dialog.
ΓòÉΓòÉΓòÉ 5. Edit Menu ΓòÉΓòÉΓòÉ
This menu is used to.-
Undo and then Redo the last action.
Cut a Selected area to the clipboard
Copy a Selected area to the clipboard
Paste from the clipboard over a selected area.
Insert Text from the clipboard
Clear a Selected area. (ERASE it !!)
Find a piece of text
Goto a particular line
Detab the whole file
Select the whole file
ΓòÉΓòÉΓòÉ 5.1. Undoing Changes ΓòÉΓòÉΓòÉ
Select Undo from the Edit menu or type alt+backspace to undo the last action.
You Cannot undo two different actions. eg. if you type something and then
delete a char and then type something else, only the last bit of typing is
undone.
After an action has been undone, it may be redone. Select Redo from the Edit
menu or type alt+backspace.
ΓòÉΓòÉΓòÉ 5.2. Cutting out blocks ΓòÉΓòÉΓòÉ
First select a piece of text to hilite it.
Select Cut from the Edit menu or press shift+del to copy the selected text to
the clipboard and delete the hilited area.
See also
Copy a Selected area to the clipboard
Paste from the clipboard over a selected area.
Insert Text from the clipboard
Clear a Selected area. (ERASE it !!)
Select the whole file
ΓòÉΓòÉΓòÉ 5.3. Copying blocks ΓòÉΓòÉΓòÉ
First select a piece of text to hilite it.
Select Copy from the Edit menu or press ctrl+ins to copy the selected text to
the clipboard, this does not delete the hilited area.
See also
Cut a Selected area to the clipboard
Paste from the clipboard over a selected area.
Insert Text from the clipboard
Clear a Selected area. (ERASE it !!)
Select the whole file
ΓòÉΓòÉΓòÉ 5.4. Pasting blocks ΓòÉΓòÉΓòÉ
Select Paste from the Edit menu or press shift+ins to delete any area that may
be hilited and then copy any text in the clipboard into the file at the
position previously occupied by the hilited area (eg. at the cursor position).
See also
Cut a Selected area to the clipboard
Copy a Selected area to the clipboard
Insert Text from the clipboard
Clear a Selected area. (ERASE it !!)
Select the whole file
ΓòÉΓòÉΓòÉ 5.5. Inserting blocks ΓòÉΓòÉΓòÉ
Select Insert Text from the Edit menu or press alt+ins to insert Text at the
cursor position. Does not affect any hilited area.
See also
Cut a Selected area to the clipboard
Copy a Selected area to the clipboard
Paste from the clipboard over a selected area.
Clear a Selected area. (ERASE it !!)
Select the whole file
ΓòÉΓòÉΓòÉ 5.6. Clearing selected text ΓòÉΓòÉΓòÉ
First select a piece of text to hilite it.
Select Clear from the Edit menu or press del to delete the hilited area.
Data is not copied to the clipboard.
See also
Cut a Selected area to the clipboard
Copy a Selected area to the clipboard
Paste from the clipboard over a selected area.
Insert Text from the clipboard
Select the whole file
ΓòÉΓòÉΓòÉ 5.7. Finding text ΓòÉΓòÉΓòÉ
Select Find from the Edit menu.
Find searches for text in the find entryfield.
Enter the text you wish to find into the Find entryfield.
Until Find has found something, all other options are disabled. Once text is
found, it is hilited.
You may then
1. Change the text for that in the change entryfield.
2. Change the text as above, and then find the next occurrence.
3. Use any normal editing function, such as cut, copy, paste, typing, etc.
4. Change all occurrences of the text.
Note: Find is a separate thread. Try not to edit the file whilst find is
actually searching. This is usually not possible because find is fast.
ΓòÉΓòÉΓòÉ 5.8. Finding a specific line ΓòÉΓòÉΓòÉ
Select Goto Line from the Edit menu. Enter the line to which you wish to go.
The current line is shown in the bottom of the window. If you wish to return to
this point make a note of it.
ΓòÉΓòÉΓòÉ 5.9. Removing tab characters from a file ΓòÉΓòÉΓòÉ
Program Editor shows tabs as "o". All ascii codes except 0x00,CR,LF,and 0xff
are shown as separate characters. Hence all indenting is done with spaces. Note
that detabbing a huge file with 1,000,000's of tabs can take a very long time.
eg.
file has 500 tabs, 5000 chars.. 3 seconds.
file has 10,000 tabs,100,000 chars... 25 minutes.
Detab Dialog
The Detab dialog shows a status bar indicating progress. You may stop the
Detab Thread at any time by pressing Stop or the ESC (keyboard) key.
You can select a different number of spaces to replace each tab if you wish.
The default tabsize is not affected. Each tab in the file will be replaced by
the number of spaces indicated. You cannot change the tabsize later, so saving
your file before detabbing is recommmended.
You must stop the Detab Thread before you can press Cancel. When detabbing is
finished the dialog will dismiss itself. You cannot undo a detab.
ΓòÉΓòÉΓòÉ 5.10. Selecting Text ΓòÉΓòÉΓòÉ
To select a block of text....
1. Position the cursor at the start or end of the block you wish to select.
2. Hold down the left mouse button and move the mouse over the area
required.
OR
1. Position the cursor at the start or end of the block you wish to select.
2. Hold down the Shift Key and use the cursor movement (arrow, home, end,
etc.) Keys.
Note: The Selected block will be hilited (coloured black?).
Because ctrl+ins (copy) and shift+ins (paste) as well as selecting text works
in entry fields, you can copy a string to the clipboard and then into the
"find" entryfield for example.
Similarly, you can copy a script in the "execute" entryfield, paste it into a
file, and then save the file.
ΓòÉΓòÉΓòÉ 5.11. Selecting the whole file ΓòÉΓòÉΓòÉ
Select "Select All" from the Edit menu.
Note: Selecting the whole file enables you to copy the whole file to the
clipboard. You can exit Program Editor, and the file will remain in the
clipboard. BUT, note that any program that uses the clipboard can overwrite it.
However, the saved file is not lost.
ΓòÉΓòÉΓòÉ 6. Script Menu ΓòÉΓòÉΓòÉ
Apart from Execute..., all other menu items (if there are any) are setup by a
script. These menu items could be anything you like.
See also
1. What is a script
2. Script Command Structure
3. Script Command Chains
4. Script Looping Chains
5. Script Command List
6. Script Variables
7. Script Limitations
ΓòÉΓòÉΓòÉ 6.1. What is a script ΓòÉΓòÉΓòÉ
Overview
Scripting is the automation of normal edit functions, eg type, delete, cursor
control etc. Each script command performs the equivalent of a normal edit
operation. By having a script chain, the operations thus performed can become
quite complex.
Scripts can be typed directly into the Execute.. dialog. They can also be saved
as a file and then be called from another script. They can also be set as a
menu item. This is usually done by the Main script which is always run on
startup.
Scripting is designed to be simple. Internally, each script command calls the
same function that a keypress would call. Because scripting is designed for
repetitive tasks, repetition controls are built in. Scripting does not allow
you to perform some of the more complex tasks, as these could cause a disaster
if the script has errors.
Scripts tend to be short and terse. Here is a script to go to the start of a
line and delete a tab's worth of characters if not already at the end of the
line.
home[,,loop[tab,,!eoln[,,del[,,]
This reads as keys HOME, (repeat tab times, (if not at end of line), DEL )
The editor is literally typing for you. This is a Chain. Scripts can contain
many chains.
Here is a chain that goes to the start of the file if "Hi" is not found-
find["Hi",1,!ishil[,,abs[0,,] /this is a comment/
Here is one to change all "hi"'s to "ho"'s-
loop[200000/...any BIG number! /,,find["hi",1,ins["ho",1,]
Delete all "ho"'s
loop[file,,find["ho",1,clear[,,] / note:- file = filesize /
Scripting is ideal for automating repetitive typing tasks. For example, you
wish to make a batch file to backup all the files beginning with 'a'. So you
type 'dir a*.* > back.cmd', and then you edit in 'arc -a' etc. for each entry,
deleting all the unwanted rubbish along the way. How BORING. It's much more
fun, and easier to automate the editor to do it for you. And you can re-use the
script whenever you want.
Look at the examples provided and experiment.
See also
1. Script Command Structure
2. Script Command Chains
3. Script Looping Chains
4. Script Command List
5. Script Variables
6. Script Limitations
ΓòÉΓòÉΓòÉ 6.2. Script Command Structure ΓòÉΓòÉΓòÉ
Each command has the following-
command[(parameter),(parameter),(command[....etc) eg left[,,
1. Strings in "quotes" are not parsed.
2. Comments are anything between / ...and... /.
3. WHITESPACE eg space, tab, enter are ignored.
4. Space, newline and tab characters are ignored unless in quotes "..."
5. Each command gets and passes along a flag. Some commands respond to this
flag, some set it, and some do both.
See also
1. What is a script
2. Script Command Chains
3. Script Looping Chains
4. Script Command List
5. Script Variables
6. Script Limitations
ΓòÉΓòÉΓòÉ 6.3. Script Command Chains ΓòÉΓòÉΓòÉ
Commands are always constructed into CHAINS. Command chains are executed left
to right. Almost every command in a chain is called only if the previous
command returns TRUE. But there are some exeptions. All commands either alter
the flag, or pass along the old one. The flag may be TRUE or FALSE.
Each chain must be terminated with ]. This allow a new chain to start, or the
current chain to loop. Each new chain starts with the flag set TRUE.
Here are examples of valid chains-
loop[20,,ins["hello,there",1,crins[1,,ins["fred, how are YOU
!!!",1,crins[1,,]
loop[1000,,!eoln[,,right[,,] / ..walk the file /
exec["insbkt.scr",,]
left[,,]
ins /say hello/ [hello,2,]
These are invalid or incomplete chains-
ins[hello,2] / missing comma /
right[] / missing two commas /
!stl[,,abs[0,, / exit not defined /
any number of chains may be contained in a given script.
See also
1. What is a script
2. Script Command Structure
3. Script Looping Chains
4. Script Command List
5. Script Variables
6. Script Limitations
ΓòÉΓòÉΓòÉ 6.4. Script Looping Chains ΓòÉΓòÉΓòÉ
This is a looping chain-
loop[20,,/...commands.../]
loops may be nested...
loop[5,,right[,,loop[2,,down[,,]] / go right 5x down twice /
Loops may be nested up to about 20 deep.
Valid loop counts are from 0 to 2^32-1 eg 4,294,967,295! Other valid loopcounts
include hpos or vpos. See Variables
Loops exit if the chain returns false-
loop[file,,/ ...commands in here... /!eof[,,down[,,] /will exit loop at end of file /
loop[10000,,false[,,] /will exit immediately/
In fact loop responds to flag on input and output. This enables fine control of
loop starting and ending. Using the false and true commands allows you to
construct some weird chains. Here the ╨┐ symbol is used to show how the flag is
passed:-
new chain == TRUE╨┐loop[,,╨┐command[,,╨┐] TRUE╨┐command[,,╨┐ etc.
so...
loop[20,,!eoln[,,loop[100,,!eoln[,,del[,,]]
and now showing flag...
TRUE╨┐loop[20,,!eoln[,,???╨┐loop[100,,!eoln[,,???╨┐del[,,???╨┐(loop if true)] TRUE╨┐]
In the above example, note the outer loop is forced to loop, regardless of the
exit state of the inner loop. Note also that the ] character is not always the
end of a chain. You could have loop[1,,loop[2,,loop[3,,up[,,]up[,,]up[,,] as a
complete chain. Note the eoln test used both inside and outside the inner loop.
Note that a test could be put just before the ]. eg. loop[..down[,,!eof[,,]
See also
1. What is a script
2. Script Command Structure
3. Script Command Chains
4. Script Command List
5. Script Variables
6. Script Limitations
ΓòÉΓòÉΓòÉ 6.5. Script Command List ΓòÉΓòÉΓòÉ
Note that blank or incorrect variables resolve to 0, eg abs[,,] == abs[0,,]
and abs[rubbish,,] == abs[0,,]
1. Commands that return a condition
paste instxt
cut clear
find exec
ishil !ishil
false true
eof !eof
stf !stf
eoln !eoln
stln !stln
istxt !istxt
inhil !inhil
2. Commands that ignore the previous condition.
false true
paint sysptr
eof !eof
stf !stf
eoln !eoln
stln !stln
3. All other commands.
up down
left right
leftwrd rightwrd
tabmov backtab
home end
txthome txtend
line abs
copy del
backsp hilite
hilst hilend
hilall
ins ovr
crins crovr
tabins tabovr
tabsize
gethpos getvpos
add sub
set txtset
loop menuitem
See also
1. What is a script
2. Script Command Structure
3. Script Command Chains
4. Script Looping Chains
5. Script Variables
6. Script Limitations
ΓòÉΓòÉΓòÉ 6.6. Script Variables ΓòÉΓòÉΓòÉ
Variables can be used in any script command that uses numbers.
1. Numeric Values, variables, and constants.
Numbers go from 0 to 4,294,967,295.
hpos vpos
scr1 scr2
tab file
fpos abs
bklc bkrc
bklr bkrr
bkls bkrs
hst hend
true false
zero
Note: Blank or incorrect variables resolve to 0, eg.-
abs[,,] == abs[0,,]
abs[rubbish,,] == abs[0,,]
See also
1. What is a script
2. Script Command Structure
3. Script Command Chains
4. Script Looping Chains
5. Script Command List
6. Script Limitations
ΓòÉΓòÉΓòÉ 6.7. Executing a script ΓòÉΓòÉΓòÉ
Just in case you screw up your file save it first.
Type a script into the entryfield and press Execute to run it, Ok to set the
script but not run it, or Cancel to abandon what you have entered.
Because ctrl+ins (copy) and shift+ins (paste) as well as selecting text works
in entry fields, you can copy a string to the clipboard and then into the
"execute" entryfield for example.
Similarly, you can copy a script in the "execute" entryfield, paste it into a
file, and then save the file.
Note: It may not be possible to undo the action performed
Note: You can interrupt running scripts with the ESC key
See also
1. What is a script
2. Script Command Structure
3. Script Command Chains
4. Script Looping Chains
5. Script Command List
6. Script Variables
7. Script Limitations
ΓòÉΓòÉΓòÉ 6.8. Script Limitations ΓòÉΓòÉΓòÉ
Script files are limited to 4096 characters in total. This includes spaces and
comments. Scripts slow down substantially when files are large enough to
require disk swapping.
Function names are limited to 20 chars.
Parameter strings are limited to 511 chars.
Loop Counts are limited to ULONG's (2^32 - 1)
Loop Nesting Depth is limited to 19.
A maximum of 8 menuitems may be added to the script menu.
There is little error checking. Unrecognized commands are often ignored. You
may execute a number of valid commands before an error occurs because chains
are not parsed but merely chained. Save your file before executing a new
script.
ΓòÉΓòÉΓòÉ 7. Options Menu ΓòÉΓòÉΓòÉ
Allows you to setup the various editor options. All options are retained on
exit.
See Also
Setting the font size
Setting the tab size
Setting AutoSave
Setting 'Use EOF'
Colour Options
Setting the script path
Setting the Parse Profile
ΓòÉΓòÉΓòÉ 7.1. Setting the font size ΓòÉΓòÉΓòÉ
You may only select the sizes of the monospace fonts. This is deliberate, so
that indenting is correct.
Program Editor does not use the standard font dialog. This allows all font
sizes to be enumerated, regardless of display (and eye) capabilities.
Each font shows it's find index, that is the order in which it was found. This
number is of no consequence, and is used to index an internal font table. You
may nevertheless find it a useful pointer to the current font in the listbox.
From V1.20, you may use any monospaced font Program Editor finds. The current
font and it's index are shown above the listbox. The current font size is shown
until you select an alternative.
Select Apply to view the new font. If you press Cancel, the display will revert
to the original font. You may thus safely preview fonts on the text window.
The font dialog is a seperate thread.
See Also Colour Options
Warning
Small or inappropriate fonts can cause severe headaches and/or eyestrain!
ΓòÉΓòÉΓòÉ 7.2. Colour Options ΓòÉΓòÉΓòÉ
You may drag and drop colours onto the Program Editor text window. The only
colours accepted are Solid Colours. Some background colours will make the
cursor difficult to see.
To allow you to change font colours, a little coloured square is shown during
the font dialog. You may drop colours onto this square to change the text
colour. If the text colour chosen is the same as the background colour the text
will disappear.
Window and text colours are retained on exit.
ΓòÉΓòÉΓòÉ 7.3. Setting the tab size ΓòÉΓòÉΓòÉ
Enter the number of spaces to type when you press the Tab key.
Please ensure that you select a number that is sensible eg >1 and <255. This
value is not checked for errors.
ΓòÉΓòÉΓòÉ 7.4. Using Autosave ΓòÉΓòÉΓòÉ
When Autosave is enabled, Your file will be saved after a number of key
presses. Any keypress is counted, including arrow keys. 100 is the recommended
default. This setting is saved on exit.
ΓòÉΓòÉΓòÉ 7.5. Use EOF character ΓòÉΓòÉΓòÉ
The EOF character delimits the end of a text file. This usually causes no
problem and therefore should always be set. If you DO have a problem, eg. with
a compiler, setting EOF off strips the EOF character from your file on saving.
Note: Program Editor will always show an EOF character. This is useful if
there are a lot of useless and normally invisible spaces or lines at the end of
the file.
ΓòÉΓòÉΓòÉ 7.6. Setting the script path ΓòÉΓòÉΓòÉ
If you have installed the supplied "*.scr" files into the current directory you
may not need to perform this step.
Enter the full path and filename (including the extension) of your default
script. The path is where Program Editor looks for all script files and
"pmproged.eas". The script filename is always run on startup. You must have a
startup script file, or you will get an error message. This main script file is
the ideal place to setup your own script menu.
Once the script path is set, you can setup an alternative startup script on the
Command Line. This allows you to customise Program Editor to a number of
different uses.
Note: Always type the full path and script filename including it's file
extension.
ΓòÉΓòÉΓòÉ 7.7. Setting the Parse Profile ΓòÉΓòÉΓòÉ
The first item is the command to compile a file, whilst the second is a script
to find the numeric positions of any errors found. You are not limited to any
particular language, but the compiler must issue errors and warnings to STDOUT
or STDERR. If not, you may be able to use /e on the Command Line to specify an
error listing.
You must save the file before executing the command, as the saved file is the
one that is parsed.
$$(file) is used to set a filename into the command string. (see below)
I use the following with IBM C Set++ **.
Command.-
icc /Fo- /C /Gm /Ss /W3 $$(FILE)
Find Script.-
set[hpos,0,set[vpos,0,] /* clear vars*/
home[,,] /* start of line*/
find["(",,txtset[vpos,,]/* get vert*/
find[":",,txtset[hpos,,]/* get horz*/
sub[hpos,1,] /*icc counts from 1, pmproged from 0 */
sysptr[vpos,hpos,] /* set goto*/
hilite[false,,] /*turn off hilite in error list*/
Redirect.- Set to STDOUT
Note: ** IBM C Set++ (c) IBM . Registered trademarks of International Business
Machines Corporation.
ΓòÉΓòÉΓòÉ 7.8. Statistics ΓòÉΓòÉΓòÉ
This dialog shows the internal state of Program Editor. All the items are
fairly self explanatory. To work out the total memory used add the edit and
error file 'memory used' hexadecimal values together and add 0x1000 for
scripts.
ΓòÉΓòÉΓòÉ 8. Command Line Options ΓòÉΓòÉΓòÉ
pmproged (options) filename
eg pmproged /eerror.lst /g100 /smyscript.scr myfile.c
If you have a number of different objects for program editor, you can put
different options into the parameters field of each object. To find out more
about the different things that can be achieved by object settings, look at the
OS/2 system documentation.
These are the options available.
/e ...Load an error list file into memory
/g ...Goto line
/s ...Load a script and execute it instead of the default
Note: There is no space between options and their contents. /s, /S, -s, and
-S, (where s is an option) are all equivalent.
ΓòÉΓòÉΓòÉ 9. Parse Menu ΓòÉΓòÉΓòÉ
Allows you to parse source files. You are not limited to any particular
language, but the compiler must issue errors and warnings to STDOUT or STDERR.
If not, you may be able to use /e on the Command Line to specify an error
listing.
See Also
Command Line Options
Setting the Parse Profile
ΓòÉΓòÉΓòÉ 9.1. Parse File ΓòÉΓòÉΓòÉ
This option allows you to parse a file. The file that is parsed is the one on
disk, specified by the current filename. You must have a file open on the
screen and saved before parsing. You must also have set up a valid parse
profile. You are not limited to any particular language, but the compiler must
issue errors and warnings to STDOUT or STDERR. If not, you may be able to use
/e on the Command Line to specify an error listing.
A small icon to the far right of the menu bar indicates the parse status. You
may continue to edit during a parse. The icon will disappear after the parse is
complete and you select the Parse menu.
You can look at the errors found by using the View Error List menu option.
The file is being parsed.
Parse has found errors.
Parse has found no errors.
See Also
Command Line Options
Setting the Parse Profile
ΓòÉΓòÉΓòÉ 9.2. First Error ΓòÉΓòÉΓòÉ
If you have an error list loaded, and a correct parse profile, this item will
place you at the first error that was found.
This is not necessarily the point where the error occurred.
See Also
Command Line Options
Setting the Parse Profile
Parsing a file
ΓòÉΓòÉΓòÉ 9.3. Next Error ΓòÉΓòÉΓòÉ
If you have an error list loaded, and a correct parse profile, this item will
place you at the next error that was found.
This is not necessarily the point where the error occurred.
See Also
Command Line Options
Setting the Parse Profile
Parsing a file
ΓòÉΓòÉΓòÉ 9.4. Previous Error ΓòÉΓòÉΓòÉ
If you have an error list loaded, and a correct parse profile, this item will
place you at the first error that was found.
This is not necessarily the point where the error occurred.
See Also
Command Line Options
Setting the Parse Profile
Parsing a file
ΓòÉΓòÉΓòÉ 9.5. View Error List ΓòÉΓòÉΓòÉ
If you have an error list loaded, this item will allow you to view the error
list. Note that the File menu will be disabled while viewing errors.
See Also
Command Line Options
Setting the Parse Profile
Parsing a file
ΓòÉΓòÉΓòÉ 10. Help Menu ΓòÉΓòÉΓòÉ
To make Program Editor quick at starting, Help is not automatically enabled. On
a slow PC this makes Program Editor much faster, and on a fast PC, it's only
slightly more difficult to get help. Many users may not even notice the
difference.
Having made it to here, help is now Enabled.
To enable help select Help from the menubar or press the F1 key. Help will also
automatically be enabled when selecting a Help button in a dialog.
Until help is enabled pressing F1 during a menu selection will have no effect.
If help is enabled select Help.. and then the topic of interest. If no specific
help is available, the About page is displayed. See Using Help for a more
detailed description of the help system.
The About page is also found in Help.. General Help.. on the menubar.
ΓòÉΓòÉΓòÉ 10.1. Keys Help ΓòÉΓòÉΓòÉ
Where a (+) sign is shown, this means press both keys together. Hold down the
first key, and then press the second.
Key Action
Home Go to start of line.
Alt+0(zero) Go to start of file.
Ctrl+Home Go to start of text. (Skip indent)
End Go to end of line.
Ctrl+End Go to end of file.
Page Up Go up one page.
Page Down Go down one page.
Arrows Move in the direction of the arrow.
Ctrl+Left Go to start of next word.
Ctrl+Right Go to start of previous word.
Shift+Any... Hilite the text while moving, use any key sequence above.
Delete Delete char to right of cursor.
Backspace Delete char to left of cursor.
Insert Toggle insert mode
F1 Help Enable, then Help.
ESC Abandon execution of parse, detab, find, or script.
Others... ...Shown next to menu item
Note: Not all menu items have a shortcut key.
ΓòÉΓòÉΓòÉ 11. The Status Line ΓòÉΓòÉΓòÉ
The status line at the bottom of the text page displays information relevant to
the current position in the file.
Status Information
1. OVR or INS, indicates whether you are in insert or overtype mode. If you
are in overtype mode, the cursor changes from a line to a box. You cannot
overtype the end of the file.
2. Display Line, indicates the line number of the top visible line on the
screen. As you can look at a point in the file unrelated to the cursor
position, this number is usually different to that of the cursor.
3. Cursor, indicates the current cursor vertical, and horizontal position.
This is where to look if you cannot find your cursor on the screen.
4. @, indicates the current file position in characters, counting from zero
at the start of the file.
5. Brackets, indicates the number of mismatched brackets in the file. If you
have more open brackets than close brackets, the number of odd brackets
and their type are displayed. With practice, this is a great way of
checking bracket nesting in "C". (but sadly no use for scripts)
ΓòÉΓòÉΓòÉ 12. Hints and Tips ΓòÉΓòÉΓòÉ
Parse Profile
The easiest way to set up a parse profile is probably as follows.-
Create a source file full of errors.
Run your compiler and make a note of the options used.
Check that the compiler displays a list of errors.
Open the source file with program editor.
Setup the parse profile to run the compiler with the same options as
before.
Type a dummy script in the script entryfield of the parse profile. eg
abs[0,,]
Parse the file.If no error list is created experiment with the
redirection buttons.
View the error list, select all, and copy.
View the file, and select new. Select Paste.
Save the error list with a new name using Save As.
You can now experiment with the Error list. The first, next, and previous
error menuitems function like this.-
First Error Goto line 1
Next Error Go down a line
Previous Error Go Up a line
What you do next is rather dependant on the error list. The script file must
be able to position itself on the error linenumbers so that you can use
txtset[,,] to read them. Do not use sysptr[,,] yet, you will add that later.
If your compiler does not issue error line numbers you cannot proceed.
Develop and test your script using the execute script dialog. Satisfy yourself
that the script will find the error number from the start of the line, and
then use home[,,] to put you there. You should end up with something vaguely
like this.-
home[,,]
find["???",true,txtset[scr1,,]
find["???",true,txtset[scr2,,]
If your compiler numbers lines from 0, you will have to use add[,,] to add 1
to the line number.
Copy the script to the parse profile and add the sysptr[,,] command. If you
don't have a horizontal error position leave it blank. Your final parse script
will look something like.-
home[,,]
find["???",true,txtset[scr1,,]
find["???",true,txtset[scr2,,]
sysptr[scr1,scr2,]
Script Path
Program Editor uses the script path setting to obtain associated files. 'Scrip
Path' is really an inadequate name, because not only scripts should be placed
here, but any future internal files that may be issued for later versions. The
file pmproged.eas is placed here for example. When you save a New file,
Program Editor calls EAUTIL to set the extended attributes to those contained
in pmproged.eas. If the file is not found, or EAUTIL fails for some reason,
the new file will not have the correct extended attribute. AND YOU WILL NOT BE
WARNED. It is not inconceivable that someone may wish to create their own
version of pmproged.eas, but if you get it wrong, you may create 'orphan'
files. eg 'Caveat Emptor'!! BEWARE. If you use the supplied install utility,
you should not go far wrong. But don't forget to set the script path, it does
more than you think!!
Script Menu
There are several ways in which script menu's are used. You can have a main
script which allow you to select a whole new menu. The main script would load
a script which first deletes all or some of the menuitems, and then adds it's
own. Bear in mind that anything complex soon becomes burdensome, keep it
simple. Have a look at killmenu.scr and main.scr to see how menu's can be
controlled.
If you use exec[,,] it must be the last command in a script, unless the script
resides in the execute script entryfield the executed script overwrites the
calling script. You can consider exec[,,] to be like a goto, not a gosub. When
you select a script menuitem, the editor calls exec[,,] itself.
Use the truncspc.scr script to strip trailing spaces. This can substantially
shrink file sizes.
ΓòÉΓòÉΓòÉ 13. The Problem Page ΓòÉΓòÉΓòÉ
Not many so far..
Mouse pointer sometimes shows a clock. Moving the mouse outside the text
area restores the cursor. This appears to be a bug in VIEW.EXE the help
system.
If line ends are incorrect please ensure that you do not confuse the file
by having CR without LF, or worse, LF then CR, in the file. This can
theoretically happen with scripting or by using AltGr. The correct end of
line is CR+LF in that order.
You can 'workaround' by using the System Editor to open the file, modify, and
then save it. Typing space followed by backspace modifies the file. Or, you
can transfer the file through the clipboard.
(fixed?)If the bracket counters get confused, going to the start of file
will reset them.
(V1.20)Opening Find or Detab during a parse dramatically slows down the
parse but allows Find or Detab adequate time to function. (Fix.. get a
Cray!)
Please report problems to me.
Fixes in V1.20
1. Improved text selection mechanism.
2. Improved handling of cursors and pointers during focus and activation
changes.
3. Fixed bug in bracket counters.
4. Fixed memory deallocation failure in parse command.
5. Rewritten parse runs in background.
6. Updated this file.
7. New and updated script commands. Backward compatible.
8. Improved detab with dialog.
9. Added Statistics dialog.
10. Faster load times.
Note: CR and LF are carriage return (AltGr+13) and line feed (AltGr+10).
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
eg. gethpos[,,]
Set by.
gethpos
Maths functions
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
eg. getvpos[,,]
Set by.
getvpos
Maths functions
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
eg. set[scr1,20,]
Set by.
Maths functions
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
eg. set[scr2,20,]
Set by.
Maths functions
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
Size of a tab eg. set[scr1,tab,]
Set by.
tabsize
System.
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
Size of file eg. loop[file,,]
Set by.
System.
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
Number of lines in the file eg. loop[fpos,,]
Set by.
System.
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
Current absolute cursor position eg. loop[abs,,backsp[,,] /delete to start of
file/
Set by.
System.
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
Start of hilite eg. abs[hst,,]
Set by.
hilst
System (eg. using the mouse).
Note: hst is always less than hend.
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
End of hilite eg. abs[hend,,]
Set by.
hilend
System (using the mouse).
Note: hend is always greater than hst.
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
True equals 1 eg. loop[true,,] /loops once/
Set by.
System.
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
False equals zero eg. abs[false,,] /goto start of file/
Set by.
System.
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
bklr, bkrr, bklc, bkrc, bkls, bkrs
Bracket counters bk(l,r = left or right)(r,s,c = round, square, or curly)
Set by
System.
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
Zero eg. abs[zero,,] /goto start of file/
Set by.
System.
Used by.
All.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
paste[,,]
Paste from Clipboard.Deletes hilited area.
Returns clipboard data valid(eg success).
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
instxt[,,]
Insert text from clipboard. Does not delete hilited area.
Returns clipboard data valid(eg success).
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
cut[,,]
Copy text to clipboard and delete hilited area.
Returns hilited flag.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
copy[,,]
Copy text to clipboard.
Leaves hiliting unaffected
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
clear[,,]
Delete hilited area.
Returns hilited flag.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
find[value,flag,]
eg. find["hello",true,] Find text in file and hilite it. If flag is true the
find is case sensitive, otherwise it isn't.
Returns TRUE if found
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
ishil[,,] and !ishil[,,]
Check to see if hiliting is on or off.
Returns TRUE if condition is met.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
exec["filename",,]
Load the script file into memory and execute it. Exec must be the last command
in a script because the new script overwrites the old.
Returns false on failure.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
true[,,] and false[,,]
Return 1 and 0 respectively. Ignore Previous Flags !!
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
eof[,,], !eof[,,], stf[,,], and !stf[,,]
Test to see if at the end or start of the file.
Returns TRUE if condition is met.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
eoln[,,] and !eoln[,,]
Test to see if at the end of a line.
Returns TRUE if condition is met.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
stln[,,] and !stln[,,]
Test to see if at the start of a line.
Returns TRUE if condition is met.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
del[,,]
Delete character to right of cursor.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
backsp[,,]
Delete character to left of cursor.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
istxt[value,flag,] and !istxt[value,flag,]
eg. istxt["hello",true,] Test text in file. If flag is true the test is case
sensitive, otherwise it isn't.
Returns either TRUE or FALSE if the text strings match.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
inhil[,,] and !inhil[,,]
Test to see if the cursor is in the hilited area.
Returns TRUE if condition is met.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
paint[,,]
Repaints the text screen. Use sparingly as this slows scripts down a great
deal.
No return flag specified
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
sysptr[vertical,horizontal,]
Currently only used by parse scripts, Sets the vertical and horizontal position
for the First, Next, and Previous Error commands.
Ignores the previous flag state.
No return flag specified
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
abs[value,,]
Goto the absolute file position specified in value. eg. abs[0,,] /go home/
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
menuitem[menuitemtext,filename,]
eg. menuitem["Insert {..}","insbkt.scr",]
Insert new menuitem into script menu. note that the menuitem must be able to
find the named script file in the SCRIPT PATH and load it into memory.
Note: false[,,menuitem[,,] deletes the last menuitem.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
leftwrd[,,], rightwrd[,,]
Move the cursor to the start of the previous or next word
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
left[,,], right[,,], up[,,], and down[,,]
Move the cursor in the direction indicated.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
tabmov[,,]
Move the cursor to the next tab position. Will not cross to the next line.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
backtab[,,]
Move the cursor to the previous tab position. Will not cross to the previous
line.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
home[,,] and end[,,]
Goto the start and end of the current line.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
txthome[,,], txtend[,,]
Positions the cursor at the start or end of text.
txthome[,,] works like Ctrl+Home on the keyboard by moving to the start of a
line and skipping all leading whitespace.
txtend[,,] stops at the beginning of any trailing whitespace.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
line[vertical,horizontal,]
Goto Line number. Vertical must be 1 or greater. Horizontal starts at 0 and
must not be greater than the line length.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
hilst[,,], hilend[,,], and hilall[,,]
Set hilite start or end to current position. Start can be greater than End.
There are no restrictions. Hilall hilites the entire file.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
hilite[flag,,]
Turns on hiliting if flag is not equal to 0. Else turns off hiliting.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
ins[text,quantity,] and ovr[text,quantity,]
Inserts or overtypes text, quantity number of times. eg. ins["hello",1,]
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
crins[quantity,,] and crovr[quantity,,]
Insert or overtype quantity number of new lines eg. crins[5,,] /insert 5 new
lines/
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
tabins[,,] and tabovr[,,]
Insert or overtype a tab. Tabsize can be set by tabsize[size,,]
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
tabsize[value,,]
Set default tab size.This is not system wide and is restored on exit.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
gethpos[,,] and getvpos[,,]
Load current cursor horizontal or vertical cursor position into hpos and vpos.
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
set[variable,value,], add[variable,value,], and sub[variable,value,]
Mathematical operation affects variable by adding, subtracting or setting with
value. eg. add[hpos,20,]
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
txtset[variable,,]
If there is a number in the File (or Error List), then variable is set to that
number, else zero.
Used mostly by Parse scripts. eg. txtset[vpos,,]
ΓòÉΓòÉΓòÉ <hidden> ΓòÉΓòÉΓòÉ
loop[value,,]
The command chain repeats until quantity is reached or a command returns FALSE.
eg. loop[1000,,!eof[,,right[,,] will step right 1000 times or to end of file,
whichever occurs first.
Note loops can be flagged on entry OR on exit, or both. Because instructions
are executed in turn, odd results may occur if some care is not taken with
complex looping scripts. Remember, the flag is passed from instruction to
instruction within the chain.
eg.
This is not valid..
false[,,loop[20,,true[,,ins["hello",1,] /never notices loop instruction at all/
... equivalent to..
ins["hello",1,]
But this is valid..
loop[2,,ins["hello",1,right[,,!eoln[,,] /will insert at least 1 "hello"/
This is also valid..
eoln[,,loop[2,,crovr[1,,] /do loop if end of line /
Or..
loop[file,,istxt["{",,del[,,true[,,!eof[,,] /force loop to do whole file/