═══ 1. Introduction ═══ Introduction This document covers the TEXTEDIT.CMD command which can be used to programatically modify any text file. This program is particularly useful for CID build processes. Useful return codes are returned on error. This program can be used under DOS, Windows 95 and Windows NT if the free regina interpreter is used. The TEXTEDIT.CMD command supports decision making with commands such as "#if" and supports #define & #include commands. Many commands function based on the currently active position. Note that this program was not built specifically to modify config.sys (although it has come commands that only make sense in config.sys such as LIBPATH). ═══ 1.1. Current Position ═══ Current Position Most commands work based on the concept of a "Current Position", this position can be changed with many commands such as TOP & FIND. The current position is usually the linenumber of a line (1 to n) or 0 where 0 indicates the TOP and is a special case to allow INSERTLINE to insert a line at the top of the file. Most commands will treat positions of 0 and 1 as being the same at least in their primary function for example a "DELETELINES 1" command will delete the 1st line whether the current position is 0 or 1 (however the current position should remain either 0 or 1). ═══ 2. TEXTEDIT.CMD Command Line ═══ TEXTEDIT.CMD Command Line TEXTEDIT[.CMD] InputFile OutputFile ChangeFile OptionalParameters The "InputFile" is read in when processing begins, it is the source of the file being changed. This parameter can be accessed from your script via the "${TextFileIn}" variable. The "OutputFile" parameter represents the name of the output file. This can be the same file as that specified for the "InputFile" parameter. The "OutputFile" becomes the default file on a "CHECKPOINT" command, and is available via the "${TextFileOut}" variable. The "ChangeFile" parameter specifies the file which contains the change script. This file contains the commands that you would like processed. This parameter can be accessed from your script via the "${ChangeFile}" variable. The "OptionalParameters" parameter need not be specified. Its contents can be accessed via the "${Parameters}" variable. Your script could do conditional processing on this value (with #if commands etc). Note that information you require could be passed to your change script in other ways such as OS/2 environment variables. For an example of what you can expect the preprocessor to output to the screen, please see the TextEdit Redirected Output (note that you can increase or decrease the detail with the SAYLEVEL command). ═══ 3. General Syntax ═══ SYNTAX This section describes the basic syntax of the change file script. Leading (& trailing) whitespace on a line is ignored and tab characters are not allowed. A line beginning with ";" is a comment line and is ignored. If a line contains "//" then the line is truncated immediately after the last whitespace prior to the inline comment. Note that you may need to use "//" in a line, in this case add an inline comment to the end of the line as everything after the last "//" is removed! A line which only contains spaces or is empty (blank) is treated as a comment and is ignored. If a line begins with a "@" then its not displayed to the console (unless you have turned "DEBUG" on). Commands are not case sensitive so that you might wish to use "DeleteLines" instead of "DELETELINES" or "deletelines". You may wish to see the following elements which are common over many command:  qTextq  qWildCardq  Integer  Positive Integer ═══ 3.1. qTextq ═══ QUOTED TEXT Many commands require quoted text, the only thing special about the quotes in this program are that they can be almost any character (anything non-alphanumeric), the only restriction are as follows: 1. The same quote character must appear at the start and end of the text. 2. If another parameter follows then there must be at least one space after the end quote character. EXAMPLES The following are examples of valid quoted strings:  "A string"  'Another string'  ^A 'string' which contains "quotes"^  █ABC█ ═══ 3.2. qWildcardq ═══ QUOTED WILDCARD SPECIFICATION A wildcard string is supplied as quoted text and is a way of specifying what you wish to search for. By default the search will be case-insensitive, however this can be changed at any time with the "CASESENSITIVE" command. The default wildcard character is "*" and depending on where its placed in the string (or if it exists at all) it has different effects. The following describe the alternative ways you can use it: 1. EXACT MATCH If the string does not contain a wildcard character then you are looking for an exact match. 2. LINE BEGINS WITH If the string ends with the wildcard character then we will match if the text line matches the rest. 3. LINE ENDS WITH If the string begins with the wildcard character then we will match if the text line matches the rest. 4. LINE CONTAINS If the string begins & ends with the wildcard character then we will match if the text line contains the rest. Note that the found string may start or end the line. 5. LINE BEGINS & ENDS WITH If the string contains a single wildcard character (not at start or end), then a line must start with the specified text as well as end with the specified text to match. EXAMPLES  "Match Start of Line*"  "*Match End of Line"  "Match Start of Line*Match End of Line"  "Match Whole Line"  "*Match Part Of Line*" ═══ 3.3. Integer ═══ INTEGER This is any whole number supplied in the decimal number base. A value of zero may be valid depending on the command. You can supply "-all" or "all" for the number, this is translated into a "big" number! Negative values are usually supplied to cause something to work backwards for example "DELETELINES -2" would delete the current line and the line before this one whereas "DELETELINES 2" would delete the current line and the one after this. ═══ 3.4. Positive Integer ═══ POSITIVE INTEGER This is any whole positive number supplied in the decimal number base. A value of zero may be valid depending on the command. ═══ 4. Commands ═══ AVAILABLE COMMANDS The following commands function is to move the current position:  BOTTOM  DOWN  FIND  MOVETO  TOP  UP The following commands are are used to set internal variables which will be replaced in any future source lines (textual replacement):  #define  #define+  EVALUATE The following commands allow you to execute parts of your script conditionally (for example to bail out if the correct number of replacements in a "REPLACETEXT" command were not made):  #if  #elseif  #endif  EXIT The following commands are are used to determine how much output will be sent to the console and/or are used in debugging your scripts:  DEBUG  SAYLEVEL Other commands:  #comment  #include  CASESENSITIVE  CHECKPOINT  DELETEBLOCK  DELETELINES  EXECUTE  INSERTLINE  LIBPATH  REPLACELINES  REPLACETEXT  SAY  SETPATH  WILDCARD ═══ 4.1. #comment ═══ #comment A #comment allows you to change the character sequences that indicate line and inline comments. By default to comment a whole line you begin it with ';'. To comment part of a line you use '//'. Depending on the changes you could be making these default comment characters may be inconvenient. Syntax [whitespace]#comment [whitespace]"LineCmtChars" [whitespace]"InLineCmtChars"[whitespace] The "LineCmtChars" parameter determines the character or characters which indicate that the whole line is a comment. The "InLineCmtChars" parameter determines the characters that begin an in line comment. Example - #comment #comment ';' ';;' #comment 'REM ' 'REM ' ═══ 4.2. #define[+] ═══ #define[+] A #define can be used to define a value (constant) once and then refer to it elsewhere. It allows you to update one place and have all necessary change flow though to all the statements that refer to it. Another possible use would be to "pass" parameters to a common piece of code which is included a number of times in your script. The "#define+" variant of this command differs from "#define" in that any variables that exist within the parameters to the command are expanded. With the "#define" variant its only when you reference the contents that the substitution takes place. See below for an example that may help clear up any confusion. You can redefine the contents of a variable if you wish later on in the script. To use your #define'd variable simply enclose it with "{" and "}", the line will be modified before its executed. If your script does not seem to do what you'd expect you should probably use the "DEBUG" command. A #define does not affect the "${Rc}" variable unless the command is invalid!. Syntax [whitespace]#define Variable [whitespace]"Contents"[whitespace] The "Variable" is to be defined and whenever seen in following lines will be replaced by the Contents. The line containing a #define does not itself have variables substituted. What this means is that if the "Contents" contains other definitions, the values of these at the time of use will be used. If this is not what is wanted (and it would not be if you wanted to record the current value of a standard variable), then you should use the EVALUATE command instead. Example - #define #define Test1 '*** REPLACE SOME LINES ***' @say '{Test1}' #define Test2 '"*** DELETE A BLOCK ***"' @say {Test2} Example - #define+ In this example we wish to comment out the current line by adding "REM" in front of it. If you replaced #define+ with #define in the following code this would fail and you would actually have removed the current line and replaced it with the commented out following line. #define+ TmpLine ^${CurrentLine}^ DeleteLines 1 InsertLine ^REM {TmpLine}^ ═══ 4.3. #elseif ═══ #elseif This command is used if you wish to have some lines included when the #if condition is false. Example REPLACETEXT all 'Fred' 'Dennis' #if '${ReplaceCount}' <> '7' @exit 255 'Invalid Number of replacements, expected to make 7...' #elseif @say '*** Made 7 changes as expected... ***' #endif ═══ 4.4. #endif ═══ #endif This command is used to terminate a previous #if command. There should be a matching #endif for every #if command. EXECUTE 'dir c:\os2\bitmap /od' #if ${Rc} <> 0 EXIT ${Rc} "Dir command failed with RC = ${Rc}" #endif ═══ 4.5. #if ═══ #if A #if can be used to conditionally include lines of text, this can be any other type of line or command except #elseif or #endif. As an example of its use, #if allows you to terminate your script if you don't make the correct (expected) number of changes in a "REPLACELINES" command. #if commands can be nested to any level and there need not be any lines between a #if and a #endif or #elseif command. Syntax [whitespace]#if [whitespace]ValidRexxCondition[whitespace] The "ValidRexxCondition" specifies a valid rexx conditional test which results in a TRUE or FALSE answer. The condition may be as complex as you wish and may include the special GetEnv() function to obtain information from the environment. Example REPLACETEXT all 'Fred' 'Dennis' #if '${ReplaceCount}' <> '7' @exit 255 'Invalid Number of replacements, expected to make 7...' #elseif @say '*** Made 7 changes as expected... ***' #endif ═══ 4.6. #include ═══ #include A #include can be used to include another file for processing. This allows you to split a very large complicated script into smaller easier to understand components or reuse a long sequence of lines "passing" parameters to the included file via a "#define" or "evaluate" command. Syntax [whitespace]#include [whitespace]FileName[whitespace] The "FileName" specifies the file to be included. If the filename is or contains #defined variables they will be replaced. In an attempt to be 'C' like the filename can be surrounded by "<" & ">" or double quotes. Example Some examples follow: 1. #include "CHANGE.TEI" 2. #include 3. #include <{TheIncludeFile}> ═══ 4.7. BOTTOM ═══ BOTTOM This command will move the current position to the last line in the file. Syntax [whitespace]BOTTOM[whitespace] ═══ 4.8. CASESENSITIVE ═══ CASESENSITIVE By default compares are case-insensitive you can change this with this command. Syntax [whitespace]CASESENSITIVE [whitespace]ON|OFF[whitespace] ═══ 4.9. CHECKPOINT ═══ CHECKPOINT All changes you make to the text file are made in memory and do not "take effect" until you checkpoint the file. A return code ("${Rc}") of zero will indicate that we were successful. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]CHECKPOINT [whitespace]["FileName"][whitespace] The "FileName" parameter specifies what file to checkpoint to, if not supplied then it is the output file specified on the command line. EXAMPLE ;--- Make a backup file (.BK) in the same directory as source file --- @evaluate 'BackupFileName' 'left("${TextFileIn}", lastpos(".", "${TextFileIn}")) || "BK"' @say 'PROCESSING : ${TextFileIn}' @say 'BACKUP FILE: {BackupFileName}' @checkpoint '{BackupFileName}' //Creating backup file @SAY "Checkpoint Rc = ${Rc} (${RcReason})" ═══ 4.10. DEBUG ═══ DEBUG This command is useful if your script is not doing what you expect it to. Syntax [whitespace]DEBUG [whitespace]DebugCommand[whitespace] The "DebugCommand" parameter specifies what we wish to do, it should be one of the following: 1. DUMPVAR This will dump the contents of all variables you have defined with either #define or evaluate. 2. LISTPGM This will list your program (script) to the console. 3. FILESTATE This will list your text file as it currently stands to the console. 4. ON This turns debug on. It turns on the "SAYLEVEL" to as high as it goes (and will ignore future "SAYLEVEL" commands). While debug is on all commands to be displayed whether or not the line begins with a '@'. You will see lines in which substitutions occurred both before & after. 5. OFF This turns debug off. It restores the "SAYLEVEL" to the last one the script specified (even if this command was processed while debug was on. ═══ 4.11. DELETEBLOCK ═══ DELETEBLOCK This command could be used to delete a block of lines that you can identify from the starting and ending lines. This command begins to search forwards from the current position so that you may with to use the "TOP" command prior to its use. If you are inserting lines into CONFIG.SYS for a specific purpose then it would be a good idea to generate comment lines lines to mark the start and end of this block so that the next time you wish to reapply the same or newer changes you can simply remove the block first and not need to delete each line individually... A return code ("${Rc}") of zero will indicate that we were successful. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]DELETEBLOCK [whitespace]"FromLine" [[whitespace]"ToLine"][whitespace] The "FromLine" parameter identifies what the first line to be deleted should look like. The "ToLine" parameter identifies what the last line to be deleted should look like. Note that it is valid for the resultant "block" to be 1 line long. This parameter is optional, if not specified then this value is taken from the "FromLine" value. EXAMPLE TOP WILDCARD '~' DELETEBLOCK 'REM ******** APS' "~END - APS" DELETEBLOCK 'DEVICE=C:\THIS.SYS' WILDCARD '*' ═══ 4.12. DELETELINES ═══ DELETELINES This command could be used to delete a block of lines (forwards or backwards) from (and including) the current position. A return code ("${Rc}") of zero will indicate that we were successful. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]DELETELINES [whitespace][DeleteCount][whitespace] The "DeleteCount" parameter specifies how many lines to delete. A negative value means delete backwards. EXAMPLE ;--- Delete the 2nd line --- MOVETO 2 DELETELINES BOTTOM @SAY 'Current Posn @bottom = "${CurrentPosn}"' DELETELINES @say 'Deleted the last line, Rc = ${Rc} (${RcReason})' @SAY 'Current Posn @bottom = "${CurrentPosn}" (should be 1 less than before)' DELETELINES 4 @say 'Deleted the last line (tried for 4), Rc = ${Rc} (${RcReason})' @SAY 'Current Posn @bottom = "${CurrentPosn}" (should be 1 less than before)' DELETELINES -2 @say 'The above DELETE should delete 2 lines (backwards & work), Rc = ${Rc} (${RcReason})' @SAY 'Current Posn @bottom = "${CurrentPosn}" (should be 2 less than before)' ═══ 4.13. DOWN ═══ DOWN This command will move the current position down by the amount specified. A return code ("${Rc}") of zero will indicate that we could move as far as requested otherwise. In any case the current position is moved as far as possible. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]DOWN [whitespace][Amount][whitespace] The "Amount" parameter specifies how many lines down we will attempt to move, the default being 1. EXAMPLE DOWN DOWN 2 ═══ 4.14. EVALUATE ═══ EVALUATE This command performs a similar function to the #define command in that the result is stored and is used if the variable name is enclosed with "{" & "}". You would use this command (over #define) for one of the following main reasons: 1. You wish to substitution to occur immediately and not be delayed like that that occurs when the #define command is used. 2. You wish to get some some data from rexx. 3. You wish to perform arithmetic or other similar operation. 4. You wish to get some information out of the environment. The evaulate command will handle syntax errors and unknown variables and will generate an internal syntax error if one of these events occurs. A return code ("${Rc}") of zero will indicate that we were successful. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]EVALUATE [whitespace]"Variable" [whitespace]["Expression"][whitespace] The "Variable" parameter is the name of the #define variable you wish created or updated. Note that it is possible to execute a rexx command which does not directly return a result that can be assigned via a "=" sign if the variable parameter is blank. The "Expression" parameter is executed by rexx and the result assigned to a variable (Variable = Expression). If its not supplied then its assumed you wish to get the value of a rexx variable with the same name. The expression currently supports the "GetEnv()" function. EXAMPLE The following command uses evaluate to work out what a good name for a backup file would be and creates one (it does assume the source has an extension): ;--- Make a backup of the file (use .BK extension) -------------------------- @say @say '*************************************************************************' @say '*** Make a backup of the file' @say @evaluate 'BackupFileName' 'left("${TextFileIn}", lastpos(".", "${TextFileIn}")) || "BK"' @say 'PROCESSING : ${TextFileIn}' @say 'BACKUP FILE: {BackupFileName}' @checkpoint '{BackupFileName}' //Creating backup file @SAY "Checkpoint Rc = ${Rc} (${RcReason})" @say Other examples:  evaluate Answer (5 + 6) * 11  evaluate TotalTextChanges {TotalTextChanges} + ${ReplaceCount} ═══ 4.15. EXECUTE ═══ EXECUTE This command can be used to execute any OS/2 (or DOS for that matter) command line. A return code ("${Rc}") of zero will indicate that we were successful. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]EXECUTE [whitespace]"Command"[whitespace] The "Command" parameter is the command line we wish executed. The command should not require user input (unless you like supplying it!). EXAMPLE @say @say '*************************************************************************' EXECUTE 'copy {TextFileIn} C:\TEXTEDIT.LST' #if ${Rc} <> 0 EXIT ${Rc} "Could not backup '{TextFileIn}', copy command failed with RC = ${Rc}" #endif ═══ 4.16. EXIT ═══ EXIT This command can be used to finish your script, it would usually be within a #if/#endif block. Syntax [whitespace]EXIT [whitespace]Rc [whitespace]["SayText"][whitespace] The "Rc" parameter is the command line we wish to exit with, the value may be zero. If the value is 0 you will still get a non-zero return code if a syntax error occurred in your script. The optional "SayText" if supplied will be displayed to the console (no matter what the current SAYLEVEL). EXAMPLE TOP DOWN DOWN REPLACETEXT all 'Fred' 'Dennis' #if '${ReplaceCount}' <> '7' @exit 255 'Invalid Number of replacements, expected to make 7...' #elseif @say '*** Made 7 changes as expected... ***' #endif ═══ 4.17. FIND ═══ FIND This command will perform a search forwards or backwards for a line matching your supplied specification. You can tell it to look for the 4th line if you wish. Syntax [whitespace]FIND [whitespace]Count [whitespace]"FindWhat"[whitespace] The "Count" parameter is the number of the found line we wish to stop on, for example this allows us to search for the 3rd line containing "delete". Note that we are counting the lines containing the text and not text matches within lines. The "FindWhat" parameter specifies what we are looking for. EXAMPLE TOP FIND -999 '*Prj*' @SAY 'Should not have move current position as search should fail. - CurrentLine = ${CurrentPosn}, FindRc = ${Rc}' #if ${Rc} <> 0 EXIT 255 "Could not find the required string" #endif ═══ 4.18. INSERTLINE ═══ INSERTLINE This command could be used to insert lines after the current position. Once the line has been inserted the current position is updated so that the next "INSERTLINE" command will insert a line following this one. A return code ("${Rc}") of zero will indicate that we were successful. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]INSERTLINE [whitespace]"NewLine"[whitespace] The "NewLine" parameter is the complete text of the line. EXAMPLE @say '*** Go to top & bottom and insert 3 lines ***' TOP InsertLine "****** NewTopLine ******" InsertLine "****** NewTopLine+1 ******" InsertLine "****** NewTopLine+2 ******" @say BOTTOM InsertLine "****** NewEndLine-2 ******" InsertLine "****** NewEndLine-1 ******" InsertLine "****** NewEndLine ******" ═══ 4.19. LIBPATH ═══ LIBPATH This command is used to modify the libpath. Syntax [whitespace]LIBPATH [whitespace]DELETE|ADDSTART|ADDEND [whitespace]"PathList"[whitespace] OR [whitespace]LIBPATH [whitespace]ADDAFTER|ADDBEFORE [whitespace]"LookForPath" [whitespace]"AddPathList"[whitespace] Please see the "SETPATH" command for an explanation of the parameters. EXAMPLE LIBPATH DELETE "C:\DB\UTILP;C:\SUPPORT;C:\EXPORT\SUE;C:\DEVCON\DLL" LIBPATH ADDSTART "C:\AT\START\OF\LIBPATH1;C:\AT\START\OF\LIBPATH2" LIBPATH ADDEND "C:\AT\END\OF\LIBPATH1;C:\AT\END\OF\LIBPATH2" LIBPATH ADDBEFORE 'C:\NETWARE' "W:\BEFORE\C\NETWARE" LIBPATH ADDAFTER 'c:\netware' "W:\AFTER\C\NETWARE" LIBPATH ADDAFTER 'c:\WontFind' "W:\ADDED\TO\START\WITH\RC" ═══ 4.20. MOVETO ═══ MOVETO This command will move the current position to the location specified. If there are not enough lines to move to the position specified the last line becomes the current location. A return code ("${Rc}") of zero will indicate that we could move as far as requested. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]MOVETO [whitespace]LineNumberOrZero[whitespace] The "LineNumberOrZero" parameter specifies the line number we want. EXAMPLE ;--- Test remember current location an go back to it ------------------------ @TOP @DOWN 13 @evaluate 'SavedPosition' '${CurrentPosn}' @BOTTOM @SAY 'Now at current Position = ${CurrentPosn}' @MOVETO {SavedPosition} @SAY 'After Posn Restore, current Position = ${CurrentPosn}' ═══ 4.21. REPLACELINES ═══ REPLACELINES This command will replace lines (that match your specification) from the current position forwards or backwards with a line of text that you specify. The current position is not moved by this command. A return code ("${Rc}") of zero will indicate that we were successful. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]REPLACELINES [whitespace]HowMany [whitespace]["LookFor"]: [whitespace]["ReplaceWith"][whitespace] The "HowMany" parameter specifies up to how many replacements you would like made (and the direction). The "LookFor" parameter specifies what lines should be replaced with "ReplaceWith". EXAMPLE @top REPLACELINES all "~COBOL~" "REM **** COBOL LINE WAS HERE ****" @say 'Made ${ReplaceCount} changes...' ═══ 4.22. REPLACETEXT ═══ REPLACETEXT This command will replace occurances of a string that you specify with another. You specify the maximum number that should be replaced as well as the direction from the current position. The current position is not moved by this command. Note that currently there is a 'feature' in backwards replacing that if you are restricting the number of replacements that can occur the replace within a line you may notice that the replacement occurs left to right whereas logically it should be right to left! A return code ("${Rc}") of zero will indicate that we were successful. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]REPLACETEXT [whitespace]HowMany [whitespace]["LookFor"]: [whitespace]["ReplaceWith"][whitespace] The "HowMany" parameter specifies up to how many replacements you would like made (and the direction). The "LookFor" parameter specifies what text should be replaced with "ReplaceWith". Note that unlike other commands the search and replace is case sensitive and is not affected by the "CASESENSITIVE" command and that it can not include wildcard characters. EXAMPLE TOP DOWN DOWN REPLACETEXT all 'Fred' 'Dennis' @say 'Made ${ReplaceCount} changes...' ═══ 4.23. SAY ═══ SAY This command will output the text you specify to the console. It will be output no matter what SAYLEVEL is in effect. A return code ("${Rc}") of zero will indicate that we were successful. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]SAY [whitespace]["Text"][whitespace] The "Text" parameter specifies what you wish output to the console. If you don't supply the text then a blank line is output. EXAMPLE @say '*************************************************************************' @say '*** Make a backup of the file' @say 'PROCESSING : ${TextFileIn}' @say 'BACKUP FILE: {BackupFileName}' @checkpoint '{BackupFileName}' //Creating backup file @SAY "Checkpoint Rc = ${Rc} (${RcReason})" @say ═══ 4.24. SAYLEVEL ═══ SAYLEVEL This command can be used to increase or decrease the amount of information sent to the console. It only takes affect outside of "DEBUG" mode. Syntax [whitespace]SAYLEVEL [whitespace]NewLevel[whitespace] The "NewLevel" parameter specifies to what level you wish to see output. to the console. If you don't supply the text then a blank line is output. The levels are as follows: 0. See only SAY & EXIT output. 1. See syntax error information. 2. See non-zero return code info. 3. See informational messages. 4+ ? EXAMPLE ;--- Lowest level --- SAYLEVEL 0 ;--- Don't get much however will see if you get a syntax error --- SAYLEVEL 1 ;--- Highest level --- SAYLEVEL all ═══ 4.25. SETPATH ═══ SETPATH This command is used to modify the a line of the form: [whitespace]SET [whitespace]Variable=PathsSeperatedBySemiColons For example: SET TMP=C:\TMP SET TMPDIR=C:\TMP SET SMTMP=C:\TMP SET TEMP=C:\TMP Syntax [whitespace]SETPATH [whitespace]Variable [whitespace]DELETE|ADDSTART|ADDEND [whitespace]"PathList"[whitespace] OR [whitespace]SETPATH [whitespace]Variable [whitespace]ADDAFTER|ADDBEFORE [whitespace]"LookForPath" [whitespace]"AddPathList"[whitespace] The "Variable" specifies the environment variable that we are looking to change. The "PathList" and "AddPathList" parameters are lists of 1 or more paths seperated by semicolons. The "LookForPath" parameter is what to search for as we wish to add path(s) before or after this path (if not found we insert at the beginning). EXAMPLE SETPATH 'Path' DELETE "C:\" SETPATH 'Path' ADDBEFORE "C:\OS2" "C:\BATCH;C:\UTILP" SETPATH 'PrjDir' ADDEND "C:\AT\END" SETPATH 'PrjDir' ADDSTART "C:\AT\START1;C:\AT\START2" ═══ 4.26. TOP ═══ TOP This command will move the current position to before the first line in the file. Syntax [whitespace]TOP[whitespace] ═══ 4.27. UP ═══ UP This command will move the current position up by the amount specified. A return code ("${Rc}") of zero will indicate that we could move as far as requested otherwise. In any case the current position is moved as far as possible. You could use "#if" to perform conditional processing based on the result and use "exit" if you wish to treat the non-zero return code as a fatal error. Syntax [whitespace]UP [whitespace][Amount][whitespace] The "Amount" parameter specifies how many lines up we will attempt to move, the default being 1. EXAMPLE UP UP 2 ═══ 4.28. WILDCARD ═══ WILDCARD The default wildcard character is "*", if you are looking for a string which needs to contain this character then you must change the current wildcard to something not contained in what you are searching for. Syntax [whitespace]WILDCARD [whitespace]"NewWildcardChar"[whitespace] The "NewWildcardChar" is a single character to replace the current wildcard character (initially '*'). It is recommended that the character you choose be an uncommon character. Example TOP WILDCARD '~' DELETEBLOCK 'REM ******** APS' "~END - APS" WILDCARD '*' ═══ 5. Standard Variables ═══ Standard Variables The following standard variables are available for subsitution into your script:  ${Rc}  ${RcReason}  ${CurrentPosn}  ${CurrentLine}  ${ReplaceCount}  ${ReplacedLine}  ${TextFileIn}  ${TextFileOut}  ${ChangeFile}  ${ChangeTime}  ${Parameters}  ${Version}  ${SyntaxErrorCount} ═══ 5.1. ${Rc} ═══ ${Rc} Most commands will update the return code to indicate whether they worked without exception or not. A return code of 0 is best but a non zero return code need not indicate a failure, for example if you use "DOWN 12345", the chances are it will return a non-zero return code because the file you are editing is probably not that big. The current position was however moved to the end of the file and this may have been what you wanted. To display an error it is recommended that you display "${RcReason}" as well as this value. If a command sets a non-zero return code you will by default see this recorded to the console (you can hide this with the SAYLEVEL command). ═══ 5.2. ${RcReason} ═══ ${RcReason} This is a textual reason for the non-zero return code in the "${Rc}" variable. ═══ 5.3. ${CurrentPosn} ═══ ${CurrentPosn} This variable can be used to find out what the current position is. ═══ 5.4. ${CurrentLine} ═══ ${CurrentLine} This variable can be used to get the text of the line at the current position. Note assuming that the file is completely empty the string "" will be returned. ═══ 5.5. ${ReplaceCount} ═══ ${ReplaceCount} Commands that perform replacements update this variable to indicate how many changes were made. ═══ 5.6. ${ReplacedLine} ═══ ${ReplacedLine} This variable can only be used in the REPLACELINES command and can be used to refer to the line that is about to be replaced. ═══ 5.7. ${TextFileIn} ═══ ${TextFileIn} This is the name of the input text file which was specified on the command line. ═══ 5.8. ${TextFileOut} ═══ ${TextFileOut} This is the name of the output text file which was specified on the command line. ═══ 5.9. ${ChangeFile} ═══ ${ChangeFile} This is the name of the input script file which was specified on the command line. ═══ 5.10. ${ChangeTime} ═══ ${ChangeTime} This is the current date/time and may change from use to use. If you wish a constant value then one way would be to copy the current time using the EVALUATE command. ═══ 5.11. ${Parameters} ═══ ${Parameters} This is the optional parameters that were specified on the command line. Note that you may parse these parameters in any way you wish as is demonstrated in a simplistic example below: ;--- Get the passed parameters ---------------------------------------------- ;debug on @evaluate "" "parse value '${Parameters}' with PcType Step Crap" #if Crap <> '' exit 1000 "Too many parameters, only expected 2 (Parameters=${Parameters})" #endif #if Step = '' exit 1001 "Too few parameters, expected 2 (Parameters=${Parameters})" #endif @evaluate '' 'PcType = translate(PcType)' @evaluate '' 'Step = translate(Step)' #if PcType <> 'SERVER' & PcType <> 'WORKSTATION' exit 1002 "Invalid PcType parameter (PcType={PcType})" #endif #if Step <> 'SUE' & Step <> 'RETAIL' exit 1003 "Invalid Step parameter (PcType={Step})" #endif ;--- Output passed parameters to console ------------------------------------ @evaluate 'PcType' 'PcType' //Copy Rexx variable @evaluate 'Step' 'Step' //Copy Rexx variable @say 'PcType: {PcType}' @say 'Step : {Step}' ═══ 5.12. ${Version} ═══ ${Version} This is the version number of this program. You can use this to make sure that you are using a current version of the product. It has the form YY.DDD where YY=Year and DDD=Day of Year. ═══ 5.13. ${SyntaxErrorCount} ═══ ${SyntaxErrorCount} This is total number of syntax errors that have occurred since the script started. ═══ 6. Example ═══ The following examples are available: 1. Input Script 2. Text Input 3. Text Output 4. Console Output The input script converts the input text file to the text output. The console output was redirected. The command used for the example was: TEXTEDIT.CMD EXAMPLE.IN OUT\EXAMPLE.OUT EXAMPLE.TE > OUT\EXAMPLE.CON ═══ 6.1. Input Script ═══ Example Input Script - EXAMPLE.TE ;saylevel 0 debug ON ;--- Try some EVALUATE calls which will fail badly! ------------------------- evaluate "SyntaxError" "x()" evaluate "UnknownVariable" "X + Y" ;--- Make a BACKUP of the file (use .BK extension) -------------------------- @say @say '*************************************************************************' @say '*** Make a BackUp of the file' @say @evaluate 'BackUpFileName' 'left("${TextFileIn}", lastpos(".", "${TextFileIn}")) || "BK"' @say 'PROCESSING : ${TextFileIn}' @say 'BACKUP FILE: {BackUpFileName}' @checkpoint '{BackUpFileName}' //Creating BackUp file @say "Checkpoint Rc = ${Rc} (${RcReason})" @say @say @say '*************************************************************************' #define Test1 '*** REPLACE SOME LINES' @say '{Test1}' @top wildcard '~' replacelines all "~COBOL~" "REM **** COBOL LINE WAS HERE ****" @say @say '*************************************************************************' #define Test2 '"*** DELETE A BLOCK"' @say {Test2} bottom deleteblock '~ APS' "~END - APS" @say 'This should fail as we are past the start & end of this block (FindRc = ${Rc})' top deleteblock 'REM ******** APS' "~END - APS" @say 'This should work (FindRc = ${Rc})' deleteblock 'DEVICE=C:\DB\FIXES\PNPENABL.OS2' @say 'This should work (FindRc = ${Rc})' wildcard '*' @say @say '*************************************************************************' @say '*** Find some strings' top casesensitive ON find -1 "Should fail can't search backwards from Top!" casesensitive OFF find 1 '*Prj*' @say '1st "*Prj*" in file is on line #${CurrentPosn} - Case insensitive search - FindRc = ${Rc}' @top find 3 '*Prj*' @say '3rd "*Prj*" in file is on line #${CurrentPosn} - Case insensitive search - FindRc = ${Rc}' bottom casesensitive ON find -1 '*Prj*' @say 'Last "*Prj*" in file is on line #${CurrentPosn} - Case Sensitive search - FindRc = ${Rc}' find -3 '*Prj*' @say '3rd Last "*Prj*" in file is on line #${CurrentPosn} - Case Sensitive search - FindRc = ${Rc}' find -999 '*Prj*' @say 'Should not have move current position as search should fail. - CurrentLine = ${CurrentPosn}, FindRc = ${Rc}' ;#if ${Rc} <> 0 ; exit 255 "Could not locate the required string" ;#endif ;--- Add C:\XYZ to 'PrjDir' path -------------------------------------------- @say @say '*************************************************************************' @say '*** Adjust some paths' libpath DELETE "C:\DB\UTILP;Q:\PROD.EXP\SUE;C:\SUPPORT;C:\EXPORT\SUE" libpath ADDSTART "C:\AT\START\OF\LIBPATH1;C:\AT\START\OF\LIBPATH2" libpath ADDEND "C:\AT\END1;AT\END2" libpath ADDBEFORE 'C:\NETWARE' "BEFORE\NW" libpath ADDAFTER 'c:\netware' "AFTER\NW" libpath ADDAFTER 'c:\WontFind' "ADDED\TO\START\WITH\RC" setpath 'PrjDir' ADDEND "AT\END" setpath 'PrjDir' ADDSTART "AT\START1;AT\START2" ;--- Get some environment variables ----------------------------------------- @say @say '*************************************************************************' @evaluate 'EnvVarPrompt' 'GetEnv("Prompt")' @say 'THE CURRENT PROMPT IS "{EnvVarPrompt}"' ;--- Execute a command which should work ------------------------------------ @say @say '*************************************************************************' execute 'dir e:\os2\bitmap /od' #if ${Rc} <> 0 exit ${Rc} "Dir command failed with RC = ${Rc}" #endif @say ;--- Test remember current location an go back to it ------------------------ @say @say '*************************************************************************' @top @down 13 @evaluate 'SavedPosition' '${CurrentPosn}' @bottom @say 'Now at current Position = ${CurrentPosn}' @moveto {SavedPosition} @say 'After Posn Restore, current Position = ${CurrentPosn}' ;--- Try different quote characters ----------------------------------------- @say @say '*************************************************************************' @say '*** Try a few quotes ***' @say 'FRED - single' @say "FRED - double" @say FRED - double arrow @say @say @say '*************************************************************************' @say '*** Trying a few movement commands ***' top @say '"{CurrentPosn}" = "${CurrentPosn}"' @say 'Return code = ${Rc} (${RcReason})' down @say █"{CurrentPosn}" = "${CurrentPosn}"█ @say █Return code = ${Rc} (${RcReason})█ down 999 @say "Return code = ${Rc} (${RcReason})" @say '"{CurrentPosn}" = "${CurrentPosn}"' @say @say '*************************************************************************' @say '*** Replace some text, die if we did not make 7 changes ***' @say @say top down down replacetext all 'Fred' 'Dennis' #if '${ReplaceCount}' <> '7' @exit 255 'Invalid Number of replacements, expected to make 7...' #elseif @say ' Made 7 changes as expected...' #endif @say @say '*************************************************************************' @say '*** Try some delete lines ***' ;--- Delete the 2nd line ---- moveto 2 deletelines bottom @say 'Current Posn @Bottom = "${CurrentPosn}"' deletelines @say 'Deleted the last line, Rc = ${Rc} (${RcReason})' @say 'Current Posn @Bottom = "${CurrentPosn}" (should be 1 less than before)' deletelines 4 @say 'Deleted the last line (tried for 4), Rc = ${Rc} (${RcReason})' @say 'Current Posn @Bottom = "${CurrentPosn}" (should be 1 less than before)' deletelines -2 @say 'The above DELETE should delete 2 lines (backwards & work), Rc = ${Rc} (${RcReason})' @say 'Current Posn @Bottom = "${CurrentPosn}" (should be 2 less than before)' @say @say '*************************************************************************' @say '*** Go to Top & Bottom and insert 3 lines ***' top InsertLine "****** TOP ******" InsertLine "****** TOP+1 ******" InsertLine "****** TOP+2 ******" @say bottom InsertLine "****** END ******" InsertLine "****** END+1 ******" InsertLine "****** END+2 ******" @say @say '*************************************************************************' @say '*** Checkpoint the file ***' @say checkpoint @say "Checkpoint Rc = ${Rc} (${RcReason})" @say @say @say '*************************************************************************' @say '*** Display some standard variables ***' @say @say '"{Rc}" = "${Rc}"' @say '"{CurrentPosn}" = "${CurrentPosn}"' @say '"{CurrentLine}" = "${CurrentLine}"' @say '"{TextFileIn}" = "${TextFileIn}"' @say '"{TextFileOut}" = "${TextFileOut}"' @say '"{ChangeFile}" = "${ChangeFile}"' @say '"{ChangeTime}" = "${ChangeTime}"' @say '"{Parameters}" = "${Parameters}"' @say '"{Version}" = "${Version}"' @say '"{SyntaxErrorCount}" = "${SyntaxErrorCount}"' ;exit 1 "Terminating: Hi there" ;--- Change comment characters ---------------------------------------------- #comment 'REM ' ";;" REM --- Dump some stuff ----------------------------------------------------- debug on ;;An inline comment debug DumpVar debug filestate debug listpgm ═══ 6.2. Text Input ═══ Example Text Input - EXAMPLE.IN REM 1. **** Fred Fred Fred REM 2. **** Fred Fred Fred REM 3. **** FredFred Fred Fred REM 4. **** Fred Fred REM 5. **** Fred REM 6. **** REM *** Fix for DELL/MADGE Incompatibility if Power Management ON ***** DEVICE=C:\DB\FIXES\PNPENABL.OS2 REM *** PRJ STUFF ***************************************************** SET DBPVCSCMT=PVCSCMT SET PrjDir=C:\DB\PROJECTS\SUPPORT\SUPPORT SET PrjSystm=C:\DB\PROJECTS\SUPPORT\SUPPORT\SYSTEM SET VCSID=Dennis_Bareis SET _Vcscfg=Q:\SUPPORT\PRJPVCS.CFG SET _PrjSupportDir=Q:\SUPPORT SET _PrjInclude=Q:\SUPPORT;Q:\SUPPORT\CMLIB;Q:\SUPPORT\IBMLAN;Q:\SUPPORT\MUGLIB SET _PrjLib=Q:\SUPPORT;Q:\SUPPORT\CMLIB;Q:\SUPPORT\IBMLAN;Q:\SUPPORT\MUGLIB SET _VcscfgLocal=C:\SUPPORT\PRJPVCS.CFG SET _PrjSupportDirLocal=C:\SUPPORT SET _PrjIncludeLocal=C:\SUPPORT;C:\SUPPORT\CMLIB;C:\SUPPORT\IBMLAN;C:\SUPPORT\MUGLIB SET _PrjLibLocal=C:\SUPPORT;C:\SUPPORT\CMLIB;C:\SUPPORT\IBMLAN;C:\SUPPORT\MUGLIB REM *** Modified OS/2 stuff ******************************************* REM SWAPPATH=C:\ 2048 20480 SWAPPATH=C:\ 20480 20480 IFS=C:\OS2\HPFS.IFS /CACHE:4096 /CRECL:64 /AUTOCHECK:C REM *** The following variables are required by MY SUE TOFLOP disk *** SET TOFLOP_SUEDIR=Q:\PROD.EXP\SUE SET TOFLOP_SUEZIP=c:\DB\a_sue\out\sue.zip REM *** TEMPORARY DIRECTORY ENV VARS ********************************** SET TMP=C:\TMP SET TMPDIR=C:\TMP SET SMTMP=C:\TMP SET TEMP=C:\TMP REM *** REX to C INTERFACE DEBUGGING ********************************** REM SET REXANZ=DISPLAY SET REXANZ=C:\REXANZ.LOG REM SET SHELLEXCEPTIONHANDLER=OFF SET OS2DRV=C: SET BG-COLOUR=BLACK SET FG-COLOUR=BR_WHITE SET SORT-KEY=EXTN SET WOS2-COM9=C:\OS2\CMD.EXE /C C:\DB\BATCH\CMD\SHOWSTR.CMD SET WOS2-COM10=!Q:\PROD.EXP\SUE\VIEWFILE.EXE SET WOS2-COM11=!LF.EXE SET WOS2-COM12=!C:\OS2\CMD.EXE /C C:\DB\BATCH\CMD\EDIT.CMD SET Prompt=$e[1;33m{OS2} $e[0;32m$p$e[31m═$e[33m DEVICE=C:\OS2\MDOS\ANSI.SYS SET UTLINDEV=. SET GEN_PWHASH4=RETAIL_VARIENT SET SUCTRACE=0 SET SUCNOBAR=. REM set psslog=@W,u:\pss.log REM set psslog=@I,u:\pss.log REM ----- SUE Project stuff --------------- SET MSGPATH=C:\SUE\ SET AplDb=Q:\PROD.EXP\SUE\MAIN.MNU SET MSGTRACE=C:\SUE\OUT\MSG$TRC.ZZZ SET AplTrace=C:\SUE\OUT\COB.LOG SET ALR_LOGS=C:\SUE\OUT\ALERT.LOG SET LOGFILE=C:\SUE\OUT\STANDARD.LOG REM set RESTARTOBJECTS=NO,REBOOTONLY SET RESTARTOBJECTS=NO,STARTUPFOLDERSONLY SET SHUTDOWN=C:\SUE\OUT\SHUTDOWN.LOG SET VIEWFILE=Q:\PROD.EXP\SUE\VIEWFILE.INI REM **** SET UP ICU CONFIG **** SET _BSB_=0219 SET _IMSC_=1 SET _WSN_NO_=1 SET _WSN_ID_=DB_WSN SET _WSN_TYPE_=WSN_1 SET SUC_WSNTYPE_TABLE_FILE=C:\WSN_TYPE.TBL REM **** REM **** INSERTED BY DBCSYS.CMD *************************************** REM **** SET SQLNETB=32 PROTSHELL=C:\OS2\PMSHELL.EXE SET USER_INI=C:\OS2\OS2.INI SET SYSTEM_INI=C:\OS2\OS2SYS.INI SET OS2_SHELL=C:\OS2\CMD.EXE SET AUTOSTART=TASKLIST,FOLDERS,LAUNCHPAD SET RUNWORKPLACE=C:\OS2\PMSHELL.EXE SET COMSPEC=C:\OS2\CMD.EXE LIBPATH=.;C:\DB\UTILP;C:\OS2\MDOS;C:\;Z:\;C:\EXPORT\SUE;C:\DEVCON\DLL; SET PATH=C:\DB\BATCH\CMD;C:\DB\UTILP;C:\DB\UTILB;C:\OS2;C:\NETWARE;Z:\;Q:\SUPPORT;C:\SUPPORT;C:\SUE;Q:\TOOLS\OS2; BASEDEV=DETNE2.SYS SET HELP=C:\VACPP.30\HELP;;N:\OS2APPS\VXREXX;Q:\PROD.EXP\SUE;Q:\SUPPORT;C:\SUPPORT; SET GLOSSARY=C:\OS2\HELP\GLOSS SET IPF_KEYS=SHOWNAV+SBCS PRIORITY_DISK_IO=NO FILES=100 BASEDEV=IBMKBD.SYS DEVICE=C:\IBMCOM\PROTOCOL\LANPDD.OS2 DEVICE=C:\IBMCOM\PROTOCOL\LANVDD.OS2 DEVICE=C:\ibmcom\LANMSGDD.OS2 /I:C:\ibmcom DEVICE=C:\ibmcom\PROTMAN.OS2 /I:C:\ibmcom DEVICE=C:\OS2\BOOT\TESTCFG.SYS DEVICE=C:\OS2\BOOT\DOS.SYS DEVICE=C:\OS2\BOOT\PMDD.SYS BUFFERS=90 IOPL=YES DISKCACHE=D,LW MAXWAIT=3 MEMMAN=SWAP,PROTECT BREAK=OFF THREADS=512 PRINTMONBUFSIZE=134,134,134 COUNTRY=061,C:\OS2\SYSTEM\COUNTRY.SYS SET KEYS=ON SET BOOKSHELF=C:\VACPP.30\HELP;C:\CMLIB\BOOK;N:\OS2APPS\JBAGD330\DOC;Q:\PROD.EXP\SUE;Q:\SUPPORT;C:\SUPPORT; SET SOMIR=C:\VACPP.30\ETC\SOM.IR;C:\OS2\ETC\SOM.IR;C:\OS2\ETC\WPSH.IR;C:\OS2\ETC\WPDSERV.IR SET SOMDDIR=C:\OS2\ETC\DSOM REM SET DELDIR=C:\DELETE,512 BASEDEV=PRINT01.SYS BASEDEV=IBM1FLPY.ADD BASEDEV=IBM2FLPY.ADD BASEDEV=IBM1S506.ADD BASEDEV=XDFLOPPY.FLT BASEDEV=OS2DASD.DMD SET EPMPATH=C:\OS2\APPS PROTECTONLY=NO SHELL=C:\OS2\MDOS\COMMAND.COM C:\OS2\MDOS FCBS=16,8 RMSIZE=640 DEVICE=C:\OS2\MDOS\VEMM.SYS DOS=HIGH,UMB DEVICE=C:\OS2\MDOS\VXMS.SYS /UMB DEVICE=C:\OS2\MDOS\VDPMI.SYS DEVICE=C:\OS2\MDOS\VDPX.SYS DEVICE=C:\OS2\MDOS\VWIN.SYS DEVICE=C:\OS2\MDOS\VW32S.SYS BASEDEV=OS2SCSI.DMD BASEDEV=FD16-700.ADD DEVICE=C:\OS2\MDOS\VMOUSE.SYS DEVICE=C:\OS2\BOOT\POINTDD.SYS DEVICE=C:\OS2\BOOT\MOUSE.SYS DEVICE=C:\OS2\BOOT\COM.SYS DEVICE=C:\OS2\MDOS\VCOM.SYS CODEPAGE=437,850 DEVINFO=KBD,US,C:\OS2\KEYBOARD.DCP CALL=C:\ibmcom\PROTOCOL\NETBIND.EXE RUN=C:\ibmcom\LANMSGEX.EXE DEVICE=c:\IBMCOM\PROTOCOL\NETBEUI.OS2 DEVICE=C:\IBMLAN\NETPROG\RDRHELP.200 IFS=C:\IBMLAN\NETPROG\NETWKSTA.200 /I:C:\IBMLAN /N DEVICE=c:\IBMCOM\PROTOCOL\NETBIOS.OS2 DEVICE=c:\IBMCOM\MACS\MDGND.OS2 RUN=C:\ibmcom\PROTOCOL\LANDLL.EXE SET DIRCMD=/O:GN REM ******** CICS SET COBDIR=F:\COBOL;N:\OS2APPS\MF370\SMF370;N:\OS2APPS\MF370\TUTOR370 SET COBHNF=N:\OS2APPS\TX.30\FILES\SYS;N:\OS2APPS\MFCOBOL.32\ON-LINE SET COBCPY=N:\OS2APPS\TX.30\CPY\SYS;N:\OS2APPS\TX.30\CPY\USR;N:\OS2APPS\TX.30\SAMPLES;N:\OS2APPS\MFCOBOL.32\SOURCE SET COBDEMO=N:\OS2APPS\MFCOBOL.32\DEMO SET CWWORK=N:\OS2APPS\MFCOBOL.32\DEMO\COWRITER SET CWFILES=N:\OS2APPS\MFCOBOL.32\DEMO\COWRITER SET CWRSYSTEM=N:\OS2APPS\MFCOBOL.32\LBR SET COBFSTATCONV=HOSTSTAT SET MFORG=F:\COBOL\MFORG SET TXDIR=N:\OS2APPS\TX.30 SET MFEXTMAP=F:\COBOL\DATA REM ******** END CICS REM ******** APS REM SET APSISLV=OS2APPS REM SET APSLIB=APS.31 REM SET APSREL=V31 REM SET APSDRIVE=N: REM SET APSPGDRIVE=NULL REM SET APSDSNA=CARDS\CPSGRP\SHARE\APS REM SET APSPRJ=CPS REM SET APSGRP=APSDEV REM SET APSUSERDRIVE=F: REM SET APSPGDRIVE=S: REM SET APSUSRP=F:\APS REM SET APSDSNDE=NULL REM SET APSDEPRE=CARDS\CPSGRP\SHARE\APSDE REM SET APSNETWORK=NETBIOS REM SET CICSTYPE=VER30 REM ******* END - APS REM ******* MICRO FOCUS 370 ASSEMBLER SET DIR370=N:\OS2APPS\MF370\SMF370 REM ******* VX REXX SET VXREXX=N:\OS2APPS\VXREXX REM ******* MWB SET ICM=Q:\SHARE\MWB\ADMIN SET MASTERDATAPAGES=150 SET MASTERHASHPAGES=45 SET LOCALDATAPAGES=800 REM ******** HCO & CSDO SET HCODIR=N:\OS2APPS\MFHCO.11 SET CSDODIR=N:\OS2APPS\MFCSDO.11 SET CSDODAT=F:\MFCSDO SET CSDOCFG=F:\MFCSDO REM ******** PVCS 5.2 SET ISLVINI=F:\PVCS REM ******** Visualizer Query_for_OS/2_(Requester)* REM SET FTB1DIR=C:\FTW\WORK REM SET FTB1PATH=C:\FTW;N:\OS2APPS\FTW.12 REM SET FTBBASE=C:\FTW SET FTB1PRELOAD=30 SET DSSPATH=C:\FTW;N:\OS2APPS\FTW.12 SET SDPINI=S:\SDP\UTILS\GENERAL\SDP.INI SET INCLUDE=C:\VACPP.30\INCLUDE;C:\VACPP.30\INCLUDE\OS2;C:\VACPP.30\INCLUDE\SOM;N:\OS2APPS\JBAGD330\INCLUDE; SET LIB=C:\VACPP.30\LIB;C:\VACPP.30\DLL; DEVICE=C:\IBMCOM\PROTOCOL\LANDD.OS2 DEVICE=C:\IBMCOM\PROTOCOL\LANDLLDD.OS2 RUN=C:\IBMLAN\NETPROG\LSDAEMON.EXE SET NWDBPATH=C:\IBMLAN\NETPROG SET DLSINI=C:\IBMLAN\NETPROG\NETGUI.INI SET INIT_FILE_NAMES=netgui SET INIT_FILE_RANGES=200 SET WPS_COMMUNICATION=YES SET LOCPATH=C:\VACPP.30\LOCALE;C:\IBMLAN\XPG4\LOCALE SET LANG=ENUS437 DEVICE=C:\CMLIB\ACSLANDD.SYS DEVICE=C:\CMLIB\CMKFMDE.SYS SET CMPATH=C:\CMLIB DEVICE=C:\OS2\LOG.SYS RUN=C:\OS2\SYSTEM\LOGDAEM.EXE DEVICE=C:\OS2\EPWDD.SYS RUN=C:\OS2\EPWDDR3.EXE RUN=C:\OS2\EPWROUT.EXE 1 RUN=C:\OS2\EPW.EXE SET QRWDR=C: SET QRWINST=C:\SQLLIB SET VACPP_SHARED=FALSE SET CPPHELP_INI=C:\OS2\SYSTEM SET CPPLOCAL=C:\VACPP.30 SET CPPMAIN=C:\VACPP.30 SET CPPWORK=C:\VACPP.30 SET IWFHELP=IWFHDI.INF SET IWFOPT=C:\VACPP.30 SET IWF.DEFAULT_PRJ=CPPDFTPRJ SET IWF.SOLUTION_LANG_SUPPORT=CPPIBS30;ENG SET THREADS=512 SET SMINCLUDE=C:\VACPP.30\INCLUDE\OS2;C:\VACPP.30\INCLUDE;C:\VACPP.30\INCLUDE\SOM DEVICE=C:\VACPP.30\SYS\CPPOPA3.SYS SET VBPATH=.;C:\VACPP.30\DDE4VB SET LXEVFREF=EVFELREF.INF+LPXCREF.INF SET LXEVFHDI=EVFELHDI.INF+LPEXHDI.INF SET LPATH=C:\VACPP.30\MACROS SET CODELPATH=C:\VACPP.30\CODE\MACROS;C:\VACPP.30\MACROS SET CLREF=CPPCLRF.INF+CPPDAT.INF+CPPAPP.INF+CPPWIN.INF+CPPCTL.INF+CPPADV.INF+CPP2DG.INF+CPPDDE.INF+CPPDM.INF+CPPMM.INF+CPPCLRB.INF SET IPFC=C:\VACPP.30\IPFC SET SOMRUNTIME=C:\VACPP.30\DLL SET CPREF=CP1.INF+CP2.INF+CP3.INF SET GPIREF=GPI1.INF+GPI2.INF+GPI3.INF SET PMREF=PM1.INF+PM2.INF+PM3.INF+PM4.INF+PM5.INF SET WPSREF=WPS1.INF+WPS2.INF+WPS3.INF SET MMREF=MMREF1.INF+MMREF2.INF+MMREF3.INF SET SMADDSTAR=1 SET SMEMIT=h;ih;c SET SOMBASE=C:\VACPP.30 SET SMCLASSES=WPTYPES.IDL SET HELPNDX=EPMKWHLP.NDX+CPP.NDX+CPPBRS.NDX SET GUE=N:\OS2APPS\JBAGD330\GUE SET BmpPath=N:\OS2APPS\JBAGD330\Res REM BmpPath=N:\OS2APPS\JBAGD330\Res REM Beginning of Netware device statements REM Beginning of Netware device statements DEVICE=C:\NETWARE\LSL.SYS RUN=C:\NETWARE\DDAEMON.EXE DEVICE=C:\IBMCOM\PROTOCOL\ODI2NDI.OS2 DEVICE=C:\NETWARE\IPX.SYS DEVICE=C:\NETWARE\ROUTE.SYS DEVICE=C:\NETWARE\NWREQ.SYS DEVICE=C:\NETWARE\SPX.SYS RUN=C:\NETWARE\SPDAEMON.EXE IFS=C:\NETWARE\NWIFS.IFS RUN=C:\NETWARE\NWDAEMON.EXE DEVICE=C:\NETWARE\VIPX.SYS DEVICE=C:\NETWARE\VSHELL.SYS GLOBAL REM CE=C:\NETWARE\VSHELL.SYS GLOBAL DEVICE=C:\OS2\MDOS\LPTDD.SYS REM CE=C:\OS2\MDOS\LPTDD.SYS REM - NetWare Requester statements END -- DEVINFO=SCR,VGA,C:\OS2\BOOT\VIOTBL.DCP SET VIDEO_DEVICES=VIO_SVGA DEVICE=C:\OS2\MDOS\VSVGA.SYS DEVINFO=SCR,VGA,C:\OS2\VIOTBL.DCP SET VIO_SVGA=DEVICE(BVHVGA,BVHSVGA) DEVICE=C:\OS2\MDOS\VPRPMI.SYS Last LINE - 4 Last LINE - 3 Last LINE - 2 Last LINE - 1 Last LINE - 0 ═══ 6.3. Text Output ═══ Example Text Output - EXAMPLE.OUT ****** TOP ****** ****** TOP+1 ****** ****** TOP+2 ****** REM 1. **** Fred Fred Fred REM 3. **** DennisDennis Dennis Dennis REM 4. **** Dennis Dennis REM 5. **** Dennis REM 6. **** REM *** Fix for DELL/MADGE Incompatibility if Power Management ON ***** REM *** PRJ STUFF ***************************************************** SET DBPVCSCMT=PVCSCMT SET PrjDir=AT\START1;AT\START2;C:\DB\PROJECTS\SUPPORT\SUPPORT;AT\END SET PrjSystm=C:\DB\PROJECTS\SUPPORT\SUPPORT\SYSTEM SET VCSID=Dennis_Bareis SET _Vcscfg=Q:\SUPPORT\PRJPVCS.CFG SET _PrjSupportDir=Q:\SUPPORT SET _PrjInclude=Q:\SUPPORT;Q:\SUPPORT\CMLIB;Q:\SUPPORT\IBMLAN;Q:\SUPPORT\MUGLIB SET _PrjLib=Q:\SUPPORT;Q:\SUPPORT\CMLIB;Q:\SUPPORT\IBMLAN;Q:\SUPPORT\MUGLIB SET _VcscfgLocal=C:\SUPPORT\PRJPVCS.CFG SET _PrjSupportDirLocal=C:\SUPPORT SET _PrjIncludeLocal=C:\SUPPORT;C:\SUPPORT\CMLIB;C:\SUPPORT\IBMLAN;C:\SUPPORT\MUGLIB SET _PrjLibLocal=C:\SUPPORT;C:\SUPPORT\CMLIB;C:\SUPPORT\IBMLAN;C:\SUPPORT\MUGLIB REM *** Modified OS/2 stuff ******************************************* REM SWAPPATH=C:\ 2048 20480 SWAPPATH=C:\ 20480 20480 IFS=C:\OS2\HPFS.IFS /CACHE:4096 /CRECL:64 /AUTOCHECK:C REM *** The following variables are required by MY SUE TOFLOP disk *** SET TOFLOP_SUEDIR=Q:\PROD.EXP\SUE SET TOFLOP_SUEZIP=c:\DB\a_sue\out\sue.zip REM *** TEMPORARY DIRECTORY ENV VARS ********************************** SET TMP=C:\TMP SET TMPDIR=C:\TMP SET SMTMP=C:\TMP SET TEMP=C:\TMP REM *** REX to C INTERFACE DEBUGGING ********************************** REM SET REXANZ=DISPLAY SET REXANZ=C:\REXANZ.LOG REM SET SHELLEXCEPTIONHANDLER=OFF SET OS2DRV=C: SET BG-COLOUR=BLACK SET FG-COLOUR=BR_WHITE SET SORT-KEY=EXTN SET WOS2-COM9=C:\OS2\CMD.EXE /C C:\DB\BATCH\CMD\SHOWSTR.CMD SET WOS2-COM10=!Q:\PROD.EXP\SUE\VIEWFILE.EXE SET WOS2-COM11=!LF.EXE SET WOS2-COM12=!C:\OS2\CMD.EXE /C C:\DB\BATCH\CMD\EDIT.CMD SET Prompt=$e[1;33m{OS2} $e[0;32m$p$e[31m═$e[33m DEVICE=C:\OS2\MDOS\ANSI.SYS SET UTLINDEV=. SET GEN_PWHASH4=RETAIL_VARIENT SET SUCTRACE=0 SET SUCNOBAR=. REM set psslog=@W,u:\pss.log REM set psslog=@I,u:\pss.log REM ----- SUE Project stuff --------------- SET MSGPATH=C:\SUE\ SET AplDb=Q:\PROD.EXP\SUE\MAIN.MNU SET MSGTRACE=C:\SUE\OUT\MSG$TRC.ZZZ SET AplTrace=C:\SUE\OUT\COB.LOG SET ALR_LOGS=C:\SUE\OUT\ALERT.LOG SET LOGFILE=C:\SUE\OUT\STANDARD.LOG REM set RESTARTOBJECTS=NO,REBOOTONLY SET RESTARTOBJECTS=NO,STARTUPFOLDERSONLY SET SHUTDOWN=C:\SUE\OUT\SHUTDOWN.LOG SET VIEWFILE=Q:\PROD.EXP\SUE\VIEWFILE.INI REM **** SET UP ICU CONFIG **** SET _BSB_=0219 SET _IMSC_=1 SET _WSN_NO_=1 SET _WSN_ID_=DB_WSN SET _WSN_TYPE_=WSN_1 SET SUC_WSNTYPE_TABLE_FILE=C:\WSN_TYPE.TBL REM **** REM **** INSERTED BY DBCSYS.CMD *************************************** REM **** SET SQLNETB=32 PROTSHELL=C:\OS2\PMSHELL.EXE SET USER_INI=C:\OS2\OS2.INI SET SYSTEM_INI=C:\OS2\OS2SYS.INI SET OS2_SHELL=C:\OS2\CMD.EXE SET AUTOSTART=TASKLIST,FOLDERS,LAUNCHPAD SET RUNWORKPLACE=C:\OS2\PMSHELL.EXE SET COMSPEC=C:\OS2\CMD.EXE LIBPATH=ADDED\TO\START\WITH\RC;AFTER\NW;BEFORE\NW;C:\AT\START\OF\LIBPATH1;C:\AT\START\OF\LIBPATH2;.;C:\OS2\MDOS;C:\;Z:\;C:\DEVCON\DLL;C:\AT\END1;AT\END2 SET PATH=C:\DB\BATCH\CMD;C:\DB\UTILP;C:\DB\UTILB;C:\OS2;C:\NETWARE;Z:\;Q:\SUPPORT;C:\SUPPORT;C:\SUE;Q:\TOOLS\OS2; BASEDEV=DETNE2.SYS SET HELP=C:\VACPP.30\HELP;;N:\OS2APPS\VXREXX;Q:\PROD.EXP\SUE;Q:\SUPPORT;C:\SUPPORT; SET GLOSSARY=C:\OS2\HELP\GLOSS SET IPF_KEYS=SHOWNAV+SBCS PRIORITY_DISK_IO=NO FILES=100 BASEDEV=IBMKBD.SYS DEVICE=C:\IBMCOM\PROTOCOL\LANPDD.OS2 DEVICE=C:\IBMCOM\PROTOCOL\LANVDD.OS2 DEVICE=C:\ibmcom\LANMSGDD.OS2 /I:C:\ibmcom DEVICE=C:\ibmcom\PROTMAN.OS2 /I:C:\ibmcom DEVICE=C:\OS2\BOOT\TESTCFG.SYS DEVICE=C:\OS2\BOOT\DOS.SYS DEVICE=C:\OS2\BOOT\PMDD.SYS BUFFERS=90 IOPL=YES DISKCACHE=D,LW MAXWAIT=3 MEMMAN=SWAP,PROTECT BREAK=OFF THREADS=512 PRINTMONBUFSIZE=134,134,134 COUNTRY=061,C:\OS2\SYSTEM\COUNTRY.SYS SET KEYS=ON SET BOOKSHELF=C:\VACPP.30\HELP;C:\CMLIB\BOOK;N:\OS2APPS\JBAGD330\DOC;Q:\PROD.EXP\SUE;Q:\SUPPORT;C:\SUPPORT; SET SOMIR=C:\VACPP.30\ETC\SOM.IR;C:\OS2\ETC\SOM.IR;C:\OS2\ETC\WPSH.IR;C:\OS2\ETC\WPDSERV.IR SET SOMDDIR=C:\OS2\ETC\DSOM REM SET DELDIR=C:\DELETE,512 BASEDEV=PRINT01.SYS BASEDEV=IBM1FLPY.ADD BASEDEV=IBM2FLPY.ADD BASEDEV=IBM1S506.ADD BASEDEV=XDFLOPPY.FLT BASEDEV=OS2DASD.DMD SET EPMPATH=C:\OS2\APPS PROTECTONLY=NO SHELL=C:\OS2\MDOS\COMMAND.COM C:\OS2\MDOS FCBS=16,8 RMSIZE=640 DEVICE=C:\OS2\MDOS\VEMM.SYS DOS=HIGH,UMB DEVICE=C:\OS2\MDOS\VXMS.SYS /UMB DEVICE=C:\OS2\MDOS\VDPMI.SYS DEVICE=C:\OS2\MDOS\VDPX.SYS DEVICE=C:\OS2\MDOS\VWIN.SYS DEVICE=C:\OS2\MDOS\VW32S.SYS BASEDEV=OS2SCSI.DMD BASEDEV=FD16-700.ADD DEVICE=C:\OS2\MDOS\VMOUSE.SYS DEVICE=C:\OS2\BOOT\POINTDD.SYS DEVICE=C:\OS2\BOOT\MOUSE.SYS DEVICE=C:\OS2\BOOT\COM.SYS DEVICE=C:\OS2\MDOS\VCOM.SYS CODEPAGE=437,850 DEVINFO=KBD,US,C:\OS2\KEYBOARD.DCP CALL=C:\ibmcom\PROTOCOL\NETBIND.EXE RUN=C:\ibmcom\LANMSGEX.EXE DEVICE=c:\IBMCOM\PROTOCOL\NETBEUI.OS2 DEVICE=C:\IBMLAN\NETPROG\RDRHELP.200 IFS=C:\IBMLAN\NETPROG\NETWKSTA.200 /I:C:\IBMLAN /N DEVICE=c:\IBMCOM\PROTOCOL\NETBIOS.OS2 DEVICE=c:\IBMCOM\MACS\MDGND.OS2 RUN=C:\ibmcom\PROTOCOL\LANDLL.EXE SET DIRCMD=/O:GN REM ******** CICS REM **** COBOL LINE WAS HERE **** REM **** COBOL LINE WAS HERE **** REM **** COBOL LINE WAS HERE **** REM **** COBOL LINE WAS HERE **** REM **** COBOL LINE WAS HERE **** REM **** COBOL LINE WAS HERE **** REM **** COBOL LINE WAS HERE **** SET COBFSTATCONV=HOSTSTAT REM **** COBOL LINE WAS HERE **** SET TXDIR=N:\OS2APPS\TX.30 REM **** COBOL LINE WAS HERE **** REM ******** END CICS REM ******* MICRO FOCUS 370 ASSEMBLER SET DIR370=N:\OS2APPS\MF370\SMF370 REM ******* VX REXX SET VXREXX=N:\OS2APPS\VXREXX REM ******* MWB SET ICM=Q:\SHARE\MWB\ADMIN SET MASTERDATAPAGES=150 SET MASTERHASHPAGES=45 SET LOCALDATAPAGES=800 REM ******** HCO & CSDO SET HCODIR=N:\OS2APPS\MFHCO.11 SET CSDODIR=N:\OS2APPS\MFCSDO.11 SET CSDODAT=F:\MFCSDO SET CSDOCFG=F:\MFCSDO REM ******** PVCS 5.2 SET ISLVINI=F:\PVCS REM ******** Visualizer Query_for_OS/2_(Requester)* REM SET FTB1DIR=C:\FTW\WORK REM SET FTB1PATH=C:\FTW;N:\OS2APPS\FTW.12 REM SET FTBBASE=C:\FTW SET FTB1PRELOAD=30 SET DSSPATH=C:\FTW;N:\OS2APPS\FTW.12 SET SDPINI=S:\SDP\UTILS\GENERAL\SDP.INI SET INCLUDE=C:\VACPP.30\INCLUDE;C:\VACPP.30\INCLUDE\OS2;C:\VACPP.30\INCLUDE\SOM;N:\OS2APPS\JBAGD330\INCLUDE; SET LIB=C:\VACPP.30\LIB;C:\VACPP.30\DLL; DEVICE=C:\IBMCOM\PROTOCOL\LANDD.OS2 DEVICE=C:\IBMCOM\PROTOCOL\LANDLLDD.OS2 RUN=C:\IBMLAN\NETPROG\LSDAEMON.EXE SET NWDBPATH=C:\IBMLAN\NETPROG SET DLSINI=C:\IBMLAN\NETPROG\NETGUI.INI SET INIT_FILE_NAMES=netgui SET INIT_FILE_RANGES=200 SET WPS_COMMUNICATION=YES SET LOCPATH=C:\VACPP.30\LOCALE;C:\IBMLAN\XPG4\LOCALE SET LANG=ENUS437 DEVICE=C:\CMLIB\ACSLANDD.SYS DEVICE=C:\CMLIB\CMKFMDE.SYS SET CMPATH=C:\CMLIB DEVICE=C:\OS2\LOG.SYS RUN=C:\OS2\SYSTEM\LOGDAEM.EXE DEVICE=C:\OS2\EPWDD.SYS RUN=C:\OS2\EPWDDR3.EXE RUN=C:\OS2\EPWROUT.EXE 1 RUN=C:\OS2\EPW.EXE SET QRWDR=C: SET QRWINST=C:\SQLLIB SET VACPP_SHARED=FALSE SET CPPHELP_INI=C:\OS2\SYSTEM SET CPPLOCAL=C:\VACPP.30 SET CPPMAIN=C:\VACPP.30 SET CPPWORK=C:\VACPP.30 SET IWFHELP=IWFHDI.INF SET IWFOPT=C:\VACPP.30 SET IWF.DEFAULT_PRJ=CPPDFTPRJ SET IWF.SOLUTION_LANG_SUPPORT=CPPIBS30;ENG SET THREADS=512 SET SMINCLUDE=C:\VACPP.30\INCLUDE\OS2;C:\VACPP.30\INCLUDE;C:\VACPP.30\INCLUDE\SOM DEVICE=C:\VACPP.30\SYS\CPPOPA3.SYS SET VBPATH=.;C:\VACPP.30\DDE4VB SET LXEVFREF=EVFELREF.INF+LPXCREF.INF SET LXEVFHDI=EVFELHDI.INF+LPEXHDI.INF SET LPATH=C:\VACPP.30\MACROS SET CODELPATH=C:\VACPP.30\CODE\MACROS;C:\VACPP.30\MACROS SET CLREF=CPPCLRF.INF+CPPDAT.INF+CPPAPP.INF+CPPWIN.INF+CPPCTL.INF+CPPADV.INF+CPP2DG.INF+CPPDDE.INF+CPPDM.INF+CPPMM.INF+CPPCLRB.INF SET IPFC=C:\VACPP.30\IPFC SET SOMRUNTIME=C:\VACPP.30\DLL SET CPREF=CP1.INF+CP2.INF+CP3.INF SET GPIREF=GPI1.INF+GPI2.INF+GPI3.INF SET PMREF=PM1.INF+PM2.INF+PM3.INF+PM4.INF+PM5.INF SET WPSREF=WPS1.INF+WPS2.INF+WPS3.INF SET MMREF=MMREF1.INF+MMREF2.INF+MMREF3.INF SET SMADDSTAR=1 SET SMEMIT=h;ih;c SET SOMBASE=C:\VACPP.30 SET SMCLASSES=WPTYPES.IDL SET HELPNDX=EPMKWHLP.NDX+CPP.NDX+CPPBRS.NDX SET GUE=N:\OS2APPS\JBAGD330\GUE SET BmpPath=N:\OS2APPS\JBAGD330\Res REM BmpPath=N:\OS2APPS\JBAGD330\Res REM Beginning of Netware device statements REM Beginning of Netware device statements DEVICE=C:\NETWARE\LSL.SYS RUN=C:\NETWARE\DDAEMON.EXE DEVICE=C:\IBMCOM\PROTOCOL\ODI2NDI.OS2 DEVICE=C:\NETWARE\IPX.SYS DEVICE=C:\NETWARE\ROUTE.SYS DEVICE=C:\NETWARE\NWREQ.SYS DEVICE=C:\NETWARE\SPX.SYS RUN=C:\NETWARE\SPDAEMON.EXE IFS=C:\NETWARE\NWIFS.IFS RUN=C:\NETWARE\NWDAEMON.EXE DEVICE=C:\NETWARE\VIPX.SYS DEVICE=C:\NETWARE\VSHELL.SYS GLOBAL REM CE=C:\NETWARE\VSHELL.SYS GLOBAL DEVICE=C:\OS2\MDOS\LPTDD.SYS REM CE=C:\OS2\MDOS\LPTDD.SYS REM - NetWare Requester statements END -- DEVINFO=SCR,VGA,C:\OS2\BOOT\VIOTBL.DCP SET VIDEO_DEVICES=VIO_SVGA DEVICE=C:\OS2\MDOS\VSVGA.SYS DEVINFO=SCR,VGA,C:\OS2\VIOTBL.DCP SET VIO_SVGA=DEVICE(BVHVGA,BVHSVGA) DEVICE=C:\OS2\MDOS\VPRPMI.SYS Last LINE - 4 ****** END ****** ****** END+1 ****** ****** END+2 ****** ═══ 6.4. Console Output ═══ Example Console Output - EXAMPLE.CON []-------------------------------------------------------------[] | TEXTEDIT.CMD Version 99.107 (C)opyright Dennis Bareis 1997 | | http://www.labyrinth.net.au/~dbareis/index.htm (db0@anz.com) | []-------------------------------------------------------------[] LOADING FILES ~~~~~~~~~~~~~ * Text File : EXAMPLE.IN * Its FullName: E:\DB\PROJECTS\OS2\textedit\EXAMPLE.IN * Change File : EXAMPLE.TE * Its FullName: E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE PROCESSING ~~~~~~~~~~ COMMAND: debug ON 5 : COMMAND BEFORE: evaluate "SyntaxError" "x()" >Syntax Error : Evaluate at "E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(5)" failed with syntax error (Routine not found) 6 : COMMAND BEFORE: evaluate "UnknownVariable" "X + Y" >Syntax Error : Evaluate at "E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(6)" failed with unknown variable (Variable=X) 8 : COMMAND BEFORE: say 9 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 10 : COMMAND BEFORE: say '*** Make a BackUp of the file' *** Make a BackUp of the file 11 : COMMAND BEFORE: say 12 : COMMAND BEFORE: evaluate 'BackUpFileName' 'left("${TextFileIn}", lastpos(".", "${TextFileIn}")) || "BK"' 12 : COMMAND AFTER : evaluate 'BackUpFileName' 'left("EXAMPLE.IN", lastpos(".", "EXAMPLE.IN")) || "BK"' 13 : COMMAND BEFORE: say 'PROCESSING : ${TextFileIn}' 13 : COMMAND AFTER : say 'PROCESSING : EXAMPLE.IN' PROCESSING : EXAMPLE.IN 14 : COMMAND BEFORE: say 'BACKUP FILE: {BackUpFileName}' 14 : COMMAND AFTER : say 'BACKUP FILE: EXAMPLE.BK' BACKUP FILE: EXAMPLE.BK 15 : COMMAND BEFORE: checkpoint '{BackUpFileName}' 15 : COMMAND AFTER : checkpoint 'EXAMPLE.BK' >Checkpointing to "EXAMPLE.BK" 16 : COMMAND BEFORE: say "Checkpoint Rc = ${Rc} (${RcReason})" 16 : COMMAND AFTER : say "Checkpoint Rc = 0 (OK)" Checkpoint Rc = 0 (OK) 17 : COMMAND BEFORE: say 18 : COMMAND BEFORE: say 19 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 20 : COMMAND: #define Test1 '*** REPLACE SOME LINES' 21 : COMMAND BEFORE: say '{Test1}' 21 : COMMAND AFTER : say '*** REPLACE SOME LINES' *** REPLACE SOME LINES 22 : COMMAND BEFORE: top >Now at Location = 0 23 : COMMAND BEFORE: wildcard '~' 24 : COMMAND BEFORE: replacelines all "~COBOL~" "REM **** COBOL LINE WAS HERE ****" >Found match #1 at Location = 169 >Found match #2 at Location = 170 >Found match #3 at Location = 171 >Found match #4 at Location = 172 >Found match #5 at Location = 173 >Found match #6 at Location = 174 >Found match #7 at Location = 175 >Found match #8 at Location = 177 >Found match #9 at Location = 179 >WARNING: Rc=1174, We did not replace as many lines as you requested - replaced 9 out of 99999 25 : COMMAND BEFORE: say 26 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 27 : COMMAND: #define Test2 '"*** DELETE A BLOCK"' 28 : COMMAND BEFORE: say {Test2} 28 : COMMAND AFTER : say "*** DELETE A BLOCK" *** DELETE A BLOCK 29 : COMMAND BEFORE: bottom >Now at Location = 314 30 : COMMAND BEFORE: deleteblock '~ APS' "~END - APS" >WARNING: Rc=964, Could not find a line matching the starting specification (StartingPosn=314)! 31 : COMMAND BEFORE: say 'This should fail as we are past the start & end of this block (FindRc = ${Rc})' 31 : COMMAND AFTER : say 'This should fail as we are past the start & end of this block (FindRc = 964)' This should fail as we are past the start & end of this block (FindRc = 964) 32 : COMMAND BEFORE: top >Now at Location = 0 33 : COMMAND BEFORE: deleteblock 'REM ******** APS' "~END - APS" >Deleting lines 182 to 198 > Line #182 : "REM ******** APS" > Line #183 : "REM SET APSISLV=OS2APPS" > Line #184 : "REM SET APSLIB=APS.31" > Line #185 : "REM SET APSREL=V31" > Line #186 : "REM SET APSDRIVE=N:" > Line #187 : "REM SET APSPGDRIVE=NULL" > Line #188 : "REM SET APSDSNA=CARDS\CPSGRP\SHARE\APS" > Line #189 : "REM SET APSPRJ=CPS" > Line #190 : "REM SET APSGRP=APSDEV" > Line #191 : "REM SET APSUSERDRIVE=F:" > Line #192 : "REM SET APSPGDRIVE=S:" > Line #193 : "REM SET APSUSRP=F:\APS" > Line #194 : "REM SET APSDSNDE=NULL" > Line #195 : "REM SET APSDEPRE=CARDS\CPSGRP\SHARE\APSDE" > Line #196 : "REM SET APSNETWORK=NETBIOS" > Line #197 : "REM SET CICSTYPE=VER30" > Line #198 : "REM ******* END - APS" 34 : COMMAND BEFORE: say 'This should work (FindRc = ${Rc})' 34 : COMMAND AFTER : say 'This should work (FindRc = 0)' This should work (FindRc = 0) 35 : COMMAND BEFORE: deleteblock 'DEVICE=C:\DB\FIXES\PNPENABL.OS2' >Deleting lines 9 to 9 > Line #9 : "DEVICE=C:\DB\FIXES\PNPENABL.OS2" 36 : COMMAND BEFORE: say 'This should work (FindRc = ${Rc})' 36 : COMMAND AFTER : say 'This should work (FindRc = 0)' This should work (FindRc = 0) 37 : COMMAND BEFORE: wildcard '*' 38 : COMMAND BEFORE: say 39 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 40 : COMMAND BEFORE: say '*** Find some strings' *** Find some strings 41 : COMMAND BEFORE: top >Now at Location = 0 42 : COMMAND BEFORE: casesensitive ON 43 : COMMAND BEFORE: find -1 "Should fail can't search backwards from Top!" >WARNING: Rc=1063, We are at top so we can not search backwards! 44 : COMMAND BEFORE: casesensitive OFF 45 : COMMAND BEFORE: find 1 '*Prj*' >Found match #1 at Location = 10 46 : COMMAND BEFORE: say '1st "*Prj*" in file is on line #${CurrentPosn} - Case insensitive search - FindRc = ${Rc}' 46 : COMMAND AFTER : say '1st "*Prj*" in file is on line #10 - Case insensitive search - FindRc = 0' 1st "*Prj*" in file is on line #10 - Case insensitive search - FindRc = 0 47 : COMMAND BEFORE: top >Now at Location = 0 48 : COMMAND BEFORE: find 3 '*Prj*' >Found match #1 at Location = 10 >Found match #2 at Location = 12 >Found match #3 at Location = 13 49 : COMMAND BEFORE: say '3rd "*Prj*" in file is on line #${CurrentPosn} - Case insensitive search - FindRc = ${Rc}' 49 : COMMAND AFTER : say '3rd "*Prj*" in file is on line #13 - Case insensitive search - FindRc = 0' 3rd "*Prj*" in file is on line #13 - Case insensitive search - FindRc = 0 50 : COMMAND BEFORE: bottom >Now at Location = 296 51 : COMMAND BEFORE: casesensitive ON 52 : COMMAND BEFORE: find -1 '*Prj*' >Found match #1 at Location = 22 53 : COMMAND BEFORE: say 'Last "*Prj*" in file is on line #${CurrentPosn} - Case Sensitive search - FindRc = ${Rc}' 53 : COMMAND AFTER : say 'Last "*Prj*" in file is on line #22 - Case Sensitive search - FindRc = 0' Last "*Prj*" in file is on line #22 - Case Sensitive search - FindRc = 0 54 : COMMAND BEFORE: find -3 '*Prj*' >Found match #1 at Location = 22 >Found match #2 at Location = 21 >Found match #3 at Location = 20 55 : COMMAND BEFORE: say '3rd Last "*Prj*" in file is on line #${CurrentPosn} - Case Sensitive search - FindRc = ${Rc}' 55 : COMMAND AFTER : say '3rd Last "*Prj*" in file is on line #20 - Case Sensitive search - FindRc = 0' 3rd Last "*Prj*" in file is on line #20 - Case Sensitive search - FindRc = 0 56 : COMMAND BEFORE: find -999 '*Prj*' >Found match #1 at Location = 20 >Found match #2 at Location = 18 >Found match #3 at Location = 17 >Found match #4 at Location = 16 >Found match #5 at Location = 13 >Found match #6 at Location = 12 >WARNING: Rc=1097, We did not find what you wanted - found 6 out of 999 57 : COMMAND BEFORE: say 'Should not have move current position as search should fail. - CurrentLine = ${CurrentPosn}, FindRc = ${Rc}' 57 : COMMAND AFTER : say 'Should not have move current position as search should fail. - CurrentLine = 20, FindRc = 1097' Should not have move current position as search should fail. - CurrentLine = 20, FindRc = 1097 62 : COMMAND BEFORE: say 63 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 64 : COMMAND BEFORE: say '*** Adjust some paths' *** Adjust some paths 65 : COMMAND BEFORE: libpath DELETE "C:\DB\UTILP;Q:\PROD.EXP\SUE;C:\SUPPORT;C:\EXPORT\SUE" >Variable=LIBPATH was found on line #100 >Path Before=<.;C:\DB\UTILP;C:\OS2\MDOS;C:\;Z:\;C:\EXPORT\SUE;C:\DEVCON\DLL;> >Path After =<.;C:\OS2\MDOS;C:\;Z:\;C:\DEVCON\DLL> 66 : COMMAND BEFORE: libpath ADDSTART "C:\AT\START\OF\LIBPATH1;C:\AT\START\OF\LIBPATH2" >Variable=LIBPATH was found on line #100 >Path Before=<.;C:\OS2\MDOS;C:\;Z:\;C:\DEVCON\DLL> >Path After = 67 : COMMAND BEFORE: libpath ADDEND "C:\AT\END1;AT\END2" >Variable=LIBPATH was found on line #100 >Path Before= >Path After = 68 : COMMAND BEFORE: libpath ADDBEFORE 'C:\NETWARE' "BEFORE\NW" >Variable=LIBPATH was found on line #100 >Path Before= >WARNING: Rc=221, Can not find the relative directory "C:\NETWARE" - will add to start >Path After = 69 : COMMAND BEFORE: libpath ADDAFTER 'c:\netware' "AFTER\NW" >Variable=LIBPATH was found on line #100 >Path Before= >WARNING: Rc=221, Can not find the relative directory "C:\NETWARE" - will add to start >Path After = 70 : COMMAND BEFORE: libpath ADDAFTER 'c:\WontFind' "ADDED\TO\START\WITH\RC" >Variable=LIBPATH was found on line #100 >Path Before= >WARNING: Rc=221, Can not find the relative directory "C:\WONTFIND" - will add to start >Path After = 71 : COMMAND BEFORE: setpath 'PrjDir' ADDEND "AT\END" >Variable=PRJDIR was found on line #12 >Path Before= >Path After = 72 : COMMAND BEFORE: setpath 'PrjDir' ADDSTART "AT\START1;AT\START2" >Variable=PRJDIR was found on line #12 >Path Before= >Path After = 74 : COMMAND BEFORE: say 75 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 76 : COMMAND BEFORE: evaluate 'EnvVarPrompt' 'GetEnv("Prompt")' 77 : COMMAND BEFORE: say 'THE CURRENT PROMPT IS "{EnvVarPrompt}"' 77 : COMMAND AFTER : say 'THE CURRENT PROMPT IS "$e[0;1;35mBrief:$e[0m$e[1;33m{OS2} $e[0;32m$p$e[31m═$e[33m"' THE CURRENT PROMPT IS "$e[0;1;35mBrief:$e[0m$e[1;33m{OS2} $e[0;32m$p$e[31m═$e[33m" 79 : COMMAND BEFORE: say 80 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 81 : COMMAND BEFORE: execute 'dir e:\os2\bitmap /od' The volume label in drive E is OS2. The Volume Serial Number is 66DF:1C15. Directory of E:\os2\bitmap 13/06/96 14:54 49,584 0 a--- GMARBLE.BMP 13/06/96 14:56 83,452 0 a--- BIGBLU.BMP 13/06/96 14:56 24,508 0 a--- BUBBLPAD.BMP 13/06/96 14:56 36,596 0 a--- BURLAP.BMP 13/06/96 14:56 15,064 0 a--- CARVE.BMP 13/06/96 14:56 21,816 0 a--- CLOUD.BMP 13/06/96 14:56 61,556 0 a--- DIAM.BMP 13/06/96 14:56 10,796 0 a--- DOTS.BMP 13/06/96 14:56 15,924 0 a--- GOLD.BMP 13/06/96 14:56 4,892 0 a--- GRASS.BMP 13/06/96 14:56 40,796 0 a--- LOOFAH.BMP 13/06/96 14:56 21,532 0 a--- MATMAUV.BMP 13/06/96 14:56 82,588 0 a--- MULTI.BMP 13/06/96 14:56 39,420 0 a--- OS2WARP.BMP 13/06/96 14:56 24,660 0 a--- PAPER.BMP 13/06/96 14:56 54,388 0 a--- PLASTER.BMP 13/06/96 14:56 40,796 0 a--- PLASTIC.BMP 13/06/96 14:56 35,096 0 a--- POOL.BMP 13/06/96 14:56 45,740 0 a--- PURP.BMP 13/06/96 14:56 15,064 0 a--- RICEMAT.BMP 13/06/96 14:56 21,532 0 a--- SPONGER.BMP 13/06/96 14:56 38,624 0 a--- TIED.BMP 13/06/96 14:56 25,132 0 a--- TXTR_000.BMP 13/06/96 14:56 24,664 0 a--- TXTR_001.BMP 13/06/96 14:56 14,836 0 a--- TXTR_002.BMP 13/06/96 14:56 25,132 0 a--- TXTR_003.BMP 13/06/96 14:56 10,012 0 a--- TXTR_004.BMP 13/06/96 14:56 26,396 0 a--- TXTR_005.BMP 13/06/96 14:56 22,256 0 a--- TXTR_006.BMP 13/06/96 14:56 10,012 0 a--- TXTR_007.BMP 13/06/96 14:56 32,504 0 a--- TXTR_008.BMP 13/06/96 14:56 23,748 0 a--- TXTR_009.BMP 13/06/96 14:56 27,200 0 a--- TXTR_010.BMP 13/06/96 14:56 21,532 0 a--- TXTR_011.BMP 13/06/96 14:57 787,228 0 a--- WARP02.BMP 13/06/96 14:57 787,228 0 a--- WARP03.BMP 13/06/96 14:57 787,228 0 a--- WARP04.BMP 13/06/96 14:57 2,363,136 0 a--- WARPD.BMP 13/06/96 14:57 15,064 0 a--- WCOLOR.BMP 13/06/96 14:57 20,524 0 a--- WICKER2.BMP 13/06/96 14:57 787,228 0 a--- GARDEN.BMP 13/06/96 14:57 787,228 0 a--- GARDEN2.BMP 13/06/96 14:58 787,228 0 a--- OCEAN.BMP 13/06/96 14:58 787,228 0 a--- OCEAN2.BMP 13/06/96 14:58 787,228 0 a--- SPACE.BMP 13/06/96 14:58 787,228 0 a--- SPACE2.BMP 13/06/96 14:59 11,078 0 a--- FTPBKGRD.BMP 14/06/96 10:48 3,234 0 a--- OS2LOGO.BMP 9/08/96 0:46 75,347 0 a--- AAAAA.MET 27/08/96 7:50 20,629 61 a--- AAAAA.EXE 4/05/98 18:47 0 ---- . 4/05/98 18:47 0 ---- .. 52 file(s) 10,641,912 bytes used 837,368,832 bytes free COMMAND: #if 0 <> 0 #if: False 85 : COMMAND BEFORE: say 87 : COMMAND BEFORE: say 88 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 89 : COMMAND BEFORE: top >Now at Location = 0 90 : COMMAND BEFORE: down 13 >Now at Location = 13 91 : COMMAND BEFORE: evaluate 'SavedPosition' '${CurrentPosn}' 91 : COMMAND AFTER : evaluate 'SavedPosition' '13' 92 : COMMAND BEFORE: bottom >Now at Location = 296 93 : COMMAND BEFORE: say 'Now at current Position = ${CurrentPosn}' 93 : COMMAND AFTER : say 'Now at current Position = 296' Now at current Position = 296 94 : COMMAND BEFORE: moveto {SavedPosition} 94 : COMMAND AFTER : moveto 13 >Now at Location = 13 95 : COMMAND BEFORE: say 'After Posn Restore, current Position = ${CurrentPosn}' 95 : COMMAND AFTER : say 'After Posn Restore, current Position = 13' After Posn Restore, current Position = 13 97 : COMMAND BEFORE: say 98 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 99 : COMMAND BEFORE: say '*** Try a few quotes ***' *** Try a few quotes *** 100 : COMMAND BEFORE: say 'FRED - single' FRED - single 101 : COMMAND BEFORE: say "FRED - double" FRED - double 102 : COMMAND BEFORE: say FRED - double arrow FRED - double arrow 103 : COMMAND BEFORE: say 104 : COMMAND BEFORE: say 105 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 106 : COMMAND BEFORE: say '*** Trying a few movement commands ***' *** Trying a few movement commands *** 107 : COMMAND BEFORE: top >Now at Location = 0 108 : COMMAND BEFORE: say '"{CurrentPosn}" = "${CurrentPosn}"' 108 : COMMAND AFTER : say '"{CurrentPosn}" = "0"' "{CurrentPosn}" = "0" 109 : COMMAND BEFORE: say 'Return code = ${Rc} (${RcReason})' 109 : COMMAND AFTER : say 'Return code = 0 (OK)' Return code = 0 (OK) 110 : COMMAND BEFORE: down >Now at Location = 1 111 : COMMAND BEFORE: say █"{CurrentPosn}" = "${CurrentPosn}"█ 111 : COMMAND AFTER : say █"{CurrentPosn}" = "1"█ "{CurrentPosn}" = "1" 112 : COMMAND BEFORE: say █Return code = ${Rc} (${RcReason})█ 112 : COMMAND AFTER : say █Return code = 0 (OK)█ Return code = 0 (OK) 113 : COMMAND BEFORE: down 999 >WARNING: Rc=377, Can not move down 999 lines, moved to end - 295 lines >Now at Location = 296 114 : COMMAND BEFORE: say "Return code = ${Rc} (${RcReason})" 114 : COMMAND AFTER : say "Return code = 377 (Can not move down 999 lines, moved to end - 295 lines)" Return code = 377 (Can not move down 999 lines, moved to end - 295 lines) 115 : COMMAND BEFORE: say '"{CurrentPosn}" = "${CurrentPosn}"' 115 : COMMAND AFTER : say '"{CurrentPosn}" = "296"' "{CurrentPosn}" = "296" 116 : COMMAND BEFORE: say 117 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 118 : COMMAND BEFORE: say '*** Replace some text, die if we did not make 7 changes ***' *** Replace some text, die if we did not make 7 changes *** 119 : COMMAND BEFORE: say 120 : COMMAND BEFORE: say 121 : COMMAND BEFORE: top >Now at Location = 0 122 : COMMAND BEFORE: down >Now at Location = 1 123 : COMMAND BEFORE: down >Now at Location = 2 124 : COMMAND BEFORE: replacetext all 'Fred' 'Dennis' >4 changes made on line #3 >2 changes made on line #4 >1 changes made on line #5 COMMAND: #if '7' <> '7' #if: False 128 : COMMAND BEFORE: say ' Made 7 changes as expected...' Made 7 changes as expected... 130 : COMMAND BEFORE: say 131 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 132 : COMMAND BEFORE: say '*** Try some delete lines ***' *** Try some delete lines *** 134 : COMMAND BEFORE: moveto 2 >Now at Location = 2 135 : COMMAND BEFORE: deletelines >Deleting lines 2 to 2 > Line #2 : "REM 2. **** Fred Fred Fred" 136 : COMMAND BEFORE: bottom >Now at Location = 295 137 : COMMAND BEFORE: say 'Current Posn @Bottom = "${CurrentPosn}"' 137 : COMMAND AFTER : say 'Current Posn @Bottom = "295"' Current Posn @Bottom = "295" 138 : COMMAND BEFORE: deletelines >Deleting lines 295 to 295 > Line #295 : "Last LINE - 0" 139 : COMMAND BEFORE: say 'Deleted the last line, Rc = ${Rc} (${RcReason})' 139 : COMMAND AFTER : say 'Deleted the last line, Rc = 0 (OK)' Deleted the last line, Rc = 0 (OK) 140 : COMMAND BEFORE: say 'Current Posn @Bottom = "${CurrentPosn}" (should be 1 less than before)' 140 : COMMAND AFTER : say 'Current Posn @Bottom = "294" (should be 1 less than before)' Current Posn @Bottom = "294" (should be 1 less than before) 141 : COMMAND BEFORE: deletelines 4 >WARNING: Rc=516, Can not delete 4 lines (forwards), deleting to end >Deleting lines 294 to 294 > Line #294 : "Last LINE - 1" 142 : COMMAND BEFORE: say 'Deleted the last line (tried for 4), Rc = ${Rc} (${RcReason})' 142 : COMMAND AFTER : say 'Deleted the last line (tried for 4), Rc = 0 (OK)' Deleted the last line (tried for 4), Rc = 0 (OK) 143 : COMMAND BEFORE: say 'Current Posn @Bottom = "${CurrentPosn}" (should be 1 less than before)' 143 : COMMAND AFTER : say 'Current Posn @Bottom = "293" (should be 1 less than before)' Current Posn @Bottom = "293" (should be 1 less than before) 144 : COMMAND BEFORE: deletelines -2 >Deleting lines 292 to 293 > Line #292 : "Last LINE - 3" > Line #293 : "Last LINE - 2" 145 : COMMAND BEFORE: say 'The above DELETE should delete 2 lines (backwards & work), Rc = ${Rc} (${RcReason})' 145 : COMMAND AFTER : say 'The above DELETE should delete 2 lines (backwards & work), Rc = 0 (OK)' The above DELETE should delete 2 lines (backwards & work), Rc = 0 (OK) 146 : COMMAND BEFORE: say 'Current Posn @Bottom = "${CurrentPosn}" (should be 2 less than before)' 146 : COMMAND AFTER : say 'Current Posn @Bottom = "291" (should be 2 less than before)' Current Posn @Bottom = "291" (should be 2 less than before) 147 : COMMAND BEFORE: say 148 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 149 : COMMAND BEFORE: say '*** Go to Top & Bottom and insert 3 lines ***' *** Go to Top & Bottom and insert 3 lines *** 150 : COMMAND BEFORE: top >Now at Location = 0 151 : COMMAND BEFORE: InsertLine "****** TOP ******" >New line is being inserted as line #1 152 : COMMAND BEFORE: InsertLine "****** TOP+1 ******" >New line is being inserted as line #2 153 : COMMAND BEFORE: InsertLine "****** TOP+2 ******" >New line is being inserted as line #3 154 : COMMAND BEFORE: say 155 : COMMAND BEFORE: bottom >Now at Location = 294 156 : COMMAND BEFORE: InsertLine "****** END ******" >New line is being inserted as line #295 157 : COMMAND BEFORE: InsertLine "****** END+1 ******" >New line is being inserted as line #296 158 : COMMAND BEFORE: InsertLine "****** END+2 ******" >New line is being inserted as line #297 159 : COMMAND BEFORE: say 160 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 161 : COMMAND BEFORE: say '*** Checkpoint the file ***' *** Checkpoint the file *** 162 : COMMAND BEFORE: say 163 : COMMAND BEFORE: checkpoint >Checkpointing to "OUT\EXAMPLE.OUT" 164 : COMMAND BEFORE: say "Checkpoint Rc = ${Rc} (${RcReason})" 164 : COMMAND AFTER : say "Checkpoint Rc = 0 (OK)" Checkpoint Rc = 0 (OK) 165 : COMMAND BEFORE: say 166 : COMMAND BEFORE: say 167 : COMMAND BEFORE: say '*************************************************************************' ************************************************************************* 168 : COMMAND BEFORE: say '*** Display some standard variables ***' *** Display some standard variables *** 169 : COMMAND BEFORE: say 170 : COMMAND BEFORE: say '"{Rc}" = "${Rc}"' 170 : COMMAND AFTER : say '"{Rc}" = "0"' "{Rc}" = "0" 171 : COMMAND BEFORE: say '"{CurrentPosn}" = "${CurrentPosn}"' 171 : COMMAND AFTER : say '"{CurrentPosn}" = "297"' "{CurrentPosn}" = "297" 172 : COMMAND BEFORE: say '"{CurrentLine}" = "${CurrentLine}"' 172 : COMMAND AFTER : say '"{CurrentLine}" = "****** END+2 ******"' "{CurrentLine}" = "****** END+2 ******" 173 : COMMAND BEFORE: say '"{TextFileIn}" = "${TextFileIn}"' 173 : COMMAND AFTER : say '"{TextFileIn}" = "EXAMPLE.IN"' "{TextFileIn}" = "EXAMPLE.IN" 174 : COMMAND BEFORE: say '"{TextFileOut}" = "${TextFileOut}"' 174 : COMMAND AFTER : say '"{TextFileOut}" = "OUT\EXAMPLE.OUT"' "{TextFileOut}" = "OUT\EXAMPLE.OUT" 175 : COMMAND BEFORE: say '"{ChangeFile}" = "${ChangeFile}"' 175 : COMMAND AFTER : say '"{ChangeFile}" = "EXAMPLE.TE"' "{ChangeFile}" = "EXAMPLE.TE" 176 : COMMAND BEFORE: say '"{ChangeTime}" = "${ChangeTime}"' 176 : COMMAND AFTER : say '"{ChangeTime}" = "Saturday, 17 Apr 1999 9:14:30am"' "{ChangeTime}" = "Saturday, 17 Apr 1999 9:14:30am" 177 : COMMAND BEFORE: say '"{Parameters}" = "${Parameters}"' 177 : COMMAND AFTER : say '"{Parameters}" = ""' "{Parameters}" = "" 178 : COMMAND BEFORE: say '"{Version}" = "${Version}"' 178 : COMMAND AFTER : say '"{Version}" = "99.107"' "{Version}" = "99.107" 179 : COMMAND BEFORE: say '"{SyntaxErrorCount}" = "${SyntaxErrorCount}"' 179 : COMMAND AFTER : say '"{SyntaxErrorCount}" = "2"' "{SyntaxErrorCount}" = "2" 182 : COMMAND: #comment 'REM ' ";;" 184 : COMMAND BEFORE: debug on 185 : COMMAND BEFORE: debug DumpVar ■USER VARIABLES ■~~~~~~~~~~~~~~~~~ ■ 1 : {BackUpFileName} = EXAMPLE.BK ■ 2 : {Test1} = *** REPLACE SOME LINES ■ 3 : {Test2} = "*** DELETE A BLOCK" ■ 4 : {EnvVarPrompt} = $e[0;1;35mBrief:$e[0m$e[1;33m{OS2} $e[0;32m$p$e[31m═$e[33m ■ 5 : {SavedPosition} = 13 186 : COMMAND BEFORE: debug filestate |CURRENT STATE OF TEXT FILE |~~~~~~~~~~~~~~~~~~~~~~~~~~ | 1 : ****** TOP ****** | 2 : ****** TOP+1 ****** | 3 : ****** TOP+2 ****** | 4 : REM 1. **** Fred Fred Fred | 5 : REM 3. **** DennisDennis Dennis Dennis | 6 : REM 4. **** Dennis Dennis | 7 : REM 5. **** Dennis | 8 : REM 6. **** | 9 : | 10 : REM *** Fix for DELL/MADGE Incompatibility if Power Management ON ***** | 11 : | 12 : REM *** PRJ STUFF ***************************************************** | 13 : SET DBPVCSCMT=PVCSCMT | 14 : SET PrjDir=AT\START1;AT\START2;C:\DB\PROJECTS\SUPPORT\SUPPORT;AT\END | 15 : SET PrjSystm=C:\DB\PROJECTS\SUPPORT\SUPPORT\SYSTEM | 16 : SET VCSID=Dennis_Bareis | 17 : SET _Vcscfg=Q:\SUPPORT\PRJPVCS.CFG | 18 : SET _PrjSupportDir=Q:\SUPPORT | 19 : SET _PrjInclude=Q:\SUPPORT;Q:\SUPPORT\CMLIB;Q:\SUPPORT\IBMLAN;Q:\SUPPORT\MUGLIB | 20 : SET _PrjLib=Q:\SUPPORT;Q:\SUPPORT\CMLIB;Q:\SUPPORT\IBMLAN;Q:\SUPPORT\MUGLIB | 21 : SET _VcscfgLocal=C:\SUPPORT\PRJPVCS.CFG | 22 : SET _PrjSupportDirLocal=C:\SUPPORT | 23 : SET _PrjIncludeLocal=C:\SUPPORT;C:\SUPPORT\CMLIB;C:\SUPPORT\IBMLAN;C:\SUPPORT\MUGLIB | 24 : SET _PrjLibLocal=C:\SUPPORT;C:\SUPPORT\CMLIB;C:\SUPPORT\IBMLAN;C:\SUPPORT\MUGLIB | 25 : | 26 : REM *** Modified OS/2 stuff ******************************************* | 27 : REM SWAPPATH=C:\ 2048 20480 | 28 : SWAPPATH=C:\ 20480 20480 | 29 : IFS=C:\OS2\HPFS.IFS /CACHE:4096 /CRECL:64 /AUTOCHECK:C | 30 : | 31 : | 32 : REM *** The following variables are required by MY SUE TOFLOP disk *** | 33 : SET TOFLOP_SUEDIR=Q:\PROD.EXP\SUE | 34 : SET TOFLOP_SUEZIP=c:\DB\a_sue\out\sue.zip | 35 : | 36 : REM *** TEMPORARY DIRECTORY ENV VARS ********************************** | 37 : SET TMP=C:\TMP | 38 : SET TMPDIR=C:\TMP | 39 : SET SMTMP=C:\TMP | 40 : SET TEMP=C:\TMP | 41 : | 42 : REM *** REX to C INTERFACE DEBUGGING ********************************** | 43 : REM SET REXANZ=DISPLAY | 44 : SET REXANZ=C:\REXANZ.LOG | 45 : | 46 : REM SET SHELLEXCEPTIONHANDLER=OFF | 47 : SET OS2DRV=C: | 48 : SET BG-COLOUR=BLACK | 49 : SET FG-COLOUR=BR_WHITE | 50 : SET SORT-KEY=EXTN | 51 : SET WOS2-COM9=C:\OS2\CMD.EXE /C C:\DB\BATCH\CMD\SHOWSTR.CMD | 52 : SET WOS2-COM10=!Q:\PROD.EXP\SUE\VIEWFILE.EXE | 53 : SET WOS2-COM11=!LF.EXE | 54 : SET WOS2-COM12=!C:\OS2\CMD.EXE /C C:\DB\BATCH\CMD\EDIT.CMD | 55 : SET Prompt=$e[1;33m{OS2} $e[0;32m$p$e[31m═$e[33m | 56 : DEVICE=C:\OS2\MDOS\ANSI.SYS | 57 : | 58 : SET UTLINDEV=. | 59 : SET GEN_PWHASH4=RETAIL_VARIENT | 60 : | 61 : SET SUCTRACE=0 | 62 : SET SUCNOBAR=. | 63 : REM set psslog=@W,u:\pss.log | 64 : REM set psslog=@I,u:\pss.log | 65 : | 66 : REM ----- SUE Project stuff --------------- | 67 : SET MSGPATH=C:\SUE\ | 68 : SET AplDb=Q:\PROD.EXP\SUE\MAIN.MNU | 69 : SET MSGTRACE=C:\SUE\OUT\MSG$TRC.ZZZ | 70 : SET AplTrace=C:\SUE\OUT\COB.LOG | 71 : SET ALR_LOGS=C:\SUE\OUT\ALERT.LOG | 72 : SET LOGFILE=C:\SUE\OUT\STANDARD.LOG | 73 : REM set RESTARTOBJECTS=NO,REBOOTONLY | 74 : SET RESTARTOBJECTS=NO,STARTUPFOLDERSONLY | 75 : | 76 : SET SHUTDOWN=C:\SUE\OUT\SHUTDOWN.LOG | 77 : SET VIEWFILE=Q:\PROD.EXP\SUE\VIEWFILE.INI | 78 : | 79 : | 80 : REM **** SET UP ICU CONFIG **** | 81 : SET _BSB_=0219 | 82 : SET _IMSC_=1 | 83 : SET _WSN_NO_=1 | 84 : SET _WSN_ID_=DB_WSN | 85 : SET _WSN_TYPE_=WSN_1 | 86 : SET SUC_WSNTYPE_TABLE_FILE=C:\WSN_TYPE.TBL | 87 : | 88 : | 89 : REM **** | 90 : REM **** INSERTED BY DBCSYS.CMD *************************************** | 91 : REM **** | 92 : | 93 : | 94 : SET SQLNETB=32 | 95 : PROTSHELL=C:\OS2\PMSHELL.EXE | 96 : SET USER_INI=C:\OS2\OS2.INI | 97 : SET SYSTEM_INI=C:\OS2\OS2SYS.INI | 98 : SET OS2_SHELL=C:\OS2\CMD.EXE | 99 : SET AUTOSTART=TASKLIST,FOLDERS,LAUNCHPAD | 100 : SET RUNWORKPLACE=C:\OS2\PMSHELL.EXE | 101 : SET COMSPEC=C:\OS2\CMD.EXE | 102 : LIBPATH=ADDED\TO\START\WITH\RC;AFTER\NW;BEFORE\NW;C:\AT\START\OF\LIBPATH1;C:\AT\START\OF\LIBPATH2;.;C:\OS2\MDOS;C:\;Z:\;C:\DEVCON\DLL;C:\AT\END1;AT\END2 | 103 : SET PATH=C:\DB\BATCH\CMD;C:\DB\UTILP;C:\DB\UTILB;C:\OS2;C:\NETWARE;Z:\;Q:\SUPPORT;C:\SUPPORT;C:\SUE;Q:\TOOLS\OS2; | 104 : BASEDEV=DETNE2.SYS | 105 : SET HELP=C:\VACPP.30\HELP;;N:\OS2APPS\VXREXX;Q:\PROD.EXP\SUE;Q:\SUPPORT;C:\SUPPORT; | 106 : SET GLOSSARY=C:\OS2\HELP\GLOSS | 107 : SET IPF_KEYS=SHOWNAV+SBCS | 108 : PRIORITY_DISK_IO=NO | 109 : FILES=100 | 110 : BASEDEV=IBMKBD.SYS | 111 : DEVICE=C:\IBMCOM\PROTOCOL\LANPDD.OS2 | 112 : DEVICE=C:\IBMCOM\PROTOCOL\LANVDD.OS2 | 113 : DEVICE=C:\ibmcom\LANMSGDD.OS2 /I:C:\ibmcom | 114 : DEVICE=C:\ibmcom\PROTMAN.OS2 /I:C:\ibmcom | 115 : DEVICE=C:\OS2\BOOT\TESTCFG.SYS | 116 : DEVICE=C:\OS2\BOOT\DOS.SYS | 117 : DEVICE=C:\OS2\BOOT\PMDD.SYS | 118 : BUFFERS=90 | 119 : IOPL=YES | 120 : DISKCACHE=D,LW | 121 : MAXWAIT=3 | 122 : MEMMAN=SWAP,PROTECT | 123 : BREAK=OFF | 124 : THREADS=512 | 125 : PRINTMONBUFSIZE=134,134,134 | 126 : COUNTRY=061,C:\OS2\SYSTEM\COUNTRY.SYS | 127 : SET KEYS=ON | 128 : SET BOOKSHELF=C:\VACPP.30\HELP;C:\CMLIB\BOOK;N:\OS2APPS\JBAGD330\DOC;Q:\PROD.EXP\SUE;Q:\SUPPORT;C:\SUPPORT; | 129 : SET SOMIR=C:\VACPP.30\ETC\SOM.IR;C:\OS2\ETC\SOM.IR;C:\OS2\ETC\WPSH.IR;C:\OS2\ETC\WPDSERV.IR | 130 : SET SOMDDIR=C:\OS2\ETC\DSOM | 131 : REM SET DELDIR=C:\DELETE,512 | 132 : BASEDEV=PRINT01.SYS | 133 : BASEDEV=IBM1FLPY.ADD | 134 : BASEDEV=IBM2FLPY.ADD | 135 : BASEDEV=IBM1S506.ADD | 136 : BASEDEV=XDFLOPPY.FLT | 137 : BASEDEV=OS2DASD.DMD | 138 : SET EPMPATH=C:\OS2\APPS | 139 : PROTECTONLY=NO | 140 : SHELL=C:\OS2\MDOS\COMMAND.COM C:\OS2\MDOS | 141 : FCBS=16,8 | 142 : RMSIZE=640 | 143 : DEVICE=C:\OS2\MDOS\VEMM.SYS | 144 : DOS=HIGH,UMB | 145 : DEVICE=C:\OS2\MDOS\VXMS.SYS /UMB | 146 : DEVICE=C:\OS2\MDOS\VDPMI.SYS | 147 : DEVICE=C:\OS2\MDOS\VDPX.SYS | 148 : DEVICE=C:\OS2\MDOS\VWIN.SYS | 149 : DEVICE=C:\OS2\MDOS\VW32S.SYS | 150 : BASEDEV=OS2SCSI.DMD | 151 : BASEDEV=FD16-700.ADD | 152 : DEVICE=C:\OS2\MDOS\VMOUSE.SYS | 153 : DEVICE=C:\OS2\BOOT\POINTDD.SYS | 154 : DEVICE=C:\OS2\BOOT\MOUSE.SYS | 155 : DEVICE=C:\OS2\BOOT\COM.SYS | 156 : DEVICE=C:\OS2\MDOS\VCOM.SYS | 157 : CODEPAGE=437,850 | 158 : DEVINFO=KBD,US,C:\OS2\KEYBOARD.DCP | 159 : CALL=C:\ibmcom\PROTOCOL\NETBIND.EXE | 160 : RUN=C:\ibmcom\LANMSGEX.EXE | 161 : DEVICE=c:\IBMCOM\PROTOCOL\NETBEUI.OS2 | 162 : DEVICE=C:\IBMLAN\NETPROG\RDRHELP.200 | 163 : IFS=C:\IBMLAN\NETPROG\NETWKSTA.200 /I:C:\IBMLAN /N | 164 : DEVICE=c:\IBMCOM\PROTOCOL\NETBIOS.OS2 | 165 : DEVICE=c:\IBMCOM\MACS\MDGND.OS2 | 166 : RUN=C:\ibmcom\PROTOCOL\LANDLL.EXE | 167 : SET DIRCMD=/O:GN | 168 : | 169 : REM ******** CICS | 170 : REM **** COBOL LINE WAS HERE **** | 171 : REM **** COBOL LINE WAS HERE **** | 172 : REM **** COBOL LINE WAS HERE **** | 173 : REM **** COBOL LINE WAS HERE **** | 174 : REM **** COBOL LINE WAS HERE **** | 175 : REM **** COBOL LINE WAS HERE **** | 176 : REM **** COBOL LINE WAS HERE **** | 177 : SET COBFSTATCONV=HOSTSTAT | 178 : REM **** COBOL LINE WAS HERE **** | 179 : SET TXDIR=N:\OS2APPS\TX.30 | 180 : REM **** COBOL LINE WAS HERE **** | 181 : REM ******** END CICS | 182 : | 183 : | 184 : REM ******* MICRO FOCUS 370 ASSEMBLER | 185 : SET DIR370=N:\OS2APPS\MF370\SMF370 | 186 : | 187 : REM ******* VX REXX | 188 : SET VXREXX=N:\OS2APPS\VXREXX | 189 : | 190 : REM ******* MWB | 191 : SET ICM=Q:\SHARE\MWB\ADMIN | 192 : SET MASTERDATAPAGES=150 | 193 : SET MASTERHASHPAGES=45 | 194 : SET LOCALDATAPAGES=800 | 195 : | 196 : REM ******** HCO & CSDO | 197 : SET HCODIR=N:\OS2APPS\MFHCO.11 | 198 : SET CSDODIR=N:\OS2APPS\MFCSDO.11 | 199 : SET CSDODAT=F:\MFCSDO | 200 : SET CSDOCFG=F:\MFCSDO | 201 : | 202 : REM ******** PVCS 5.2 | 203 : SET ISLVINI=F:\PVCS | 204 : | 205 : REM ******** Visualizer Query_for_OS/2_(Requester)* | 206 : REM SET FTB1DIR=C:\FTW\WORK | 207 : REM SET FTB1PATH=C:\FTW;N:\OS2APPS\FTW.12 | 208 : REM SET FTBBASE=C:\FTW | 209 : SET FTB1PRELOAD=30 | 210 : SET DSSPATH=C:\FTW;N:\OS2APPS\FTW.12 | 211 : | 212 : SET SDPINI=S:\SDP\UTILS\GENERAL\SDP.INI | 213 : SET INCLUDE=C:\VACPP.30\INCLUDE;C:\VACPP.30\INCLUDE\OS2;C:\VACPP.30\INCLUDE\SOM;N:\OS2APPS\JBAGD330\INCLUDE; | 214 : SET LIB=C:\VACPP.30\LIB;C:\VACPP.30\DLL; | 215 : DEVICE=C:\IBMCOM\PROTOCOL\LANDD.OS2 | 216 : DEVICE=C:\IBMCOM\PROTOCOL\LANDLLDD.OS2 | 217 : RUN=C:\IBMLAN\NETPROG\LSDAEMON.EXE | 218 : SET NWDBPATH=C:\IBMLAN\NETPROG | 219 : SET DLSINI=C:\IBMLAN\NETPROG\NETGUI.INI | 220 : SET INIT_FILE_NAMES=netgui | 221 : SET INIT_FILE_RANGES=200 | 222 : SET WPS_COMMUNICATION=YES | 223 : SET LOCPATH=C:\VACPP.30\LOCALE;C:\IBMLAN\XPG4\LOCALE | 224 : SET LANG=ENUS437 | 225 : | 226 : DEVICE=C:\CMLIB\ACSLANDD.SYS | 227 : DEVICE=C:\CMLIB\CMKFMDE.SYS | 228 : SET CMPATH=C:\CMLIB | 229 : DEVICE=C:\OS2\LOG.SYS | 230 : RUN=C:\OS2\SYSTEM\LOGDAEM.EXE | 231 : DEVICE=C:\OS2\EPWDD.SYS | 232 : RUN=C:\OS2\EPWDDR3.EXE | 233 : RUN=C:\OS2\EPWROUT.EXE 1 | 234 : RUN=C:\OS2\EPW.EXE | 235 : SET QRWDR=C: | 236 : SET QRWINST=C:\SQLLIB | 237 : SET VACPP_SHARED=FALSE | 238 : SET CPPHELP_INI=C:\OS2\SYSTEM | 239 : SET CPPLOCAL=C:\VACPP.30 | 240 : SET CPPMAIN=C:\VACPP.30 | 241 : SET CPPWORK=C:\VACPP.30 | 242 : SET IWFHELP=IWFHDI.INF | 243 : SET IWFOPT=C:\VACPP.30 | 244 : SET IWF.DEFAULT_PRJ=CPPDFTPRJ | 245 : SET IWF.SOLUTION_LANG_SUPPORT=CPPIBS30;ENG | 246 : SET THREADS=512 | 247 : SET SMINCLUDE=C:\VACPP.30\INCLUDE\OS2;C:\VACPP.30\INCLUDE;C:\VACPP.30\INCLUDE\SOM | 248 : DEVICE=C:\VACPP.30\SYS\CPPOPA3.SYS | 249 : SET VBPATH=.;C:\VACPP.30\DDE4VB | 250 : SET LXEVFREF=EVFELREF.INF+LPXCREF.INF | 251 : SET LXEVFHDI=EVFELHDI.INF+LPEXHDI.INF | 252 : SET LPATH=C:\VACPP.30\MACROS | 253 : SET CODELPATH=C:\VACPP.30\CODE\MACROS;C:\VACPP.30\MACROS | 254 : SET CLREF=CPPCLRF.INF+CPPDAT.INF+CPPAPP.INF+CPPWIN.INF+CPPCTL.INF+CPPADV.INF+CPP2DG.INF+CPPDDE.INF+CPPDM.INF+CPPMM.INF+CPPCLRB.INF | 255 : SET IPFC=C:\VACPP.30\IPFC | 256 : SET SOMRUNTIME=C:\VACPP.30\DLL | 257 : SET CPREF=CP1.INF+CP2.INF+CP3.INF | 258 : SET GPIREF=GPI1.INF+GPI2.INF+GPI3.INF | 259 : SET PMREF=PM1.INF+PM2.INF+PM3.INF+PM4.INF+PM5.INF | 260 : SET WPSREF=WPS1.INF+WPS2.INF+WPS3.INF | 261 : SET MMREF=MMREF1.INF+MMREF2.INF+MMREF3.INF | 262 : SET SMADDSTAR=1 | 263 : SET SMEMIT=h;ih;c | 264 : SET SOMBASE=C:\VACPP.30 | 265 : SET SMCLASSES=WPTYPES.IDL | 266 : SET HELPNDX=EPMKWHLP.NDX+CPP.NDX+CPPBRS.NDX | 267 : SET GUE=N:\OS2APPS\JBAGD330\GUE | 268 : SET BmpPath=N:\OS2APPS\JBAGD330\Res | 269 : REM BmpPath=N:\OS2APPS\JBAGD330\Res | 270 : REM Beginning of Netware device statements | 271 : REM Beginning of Netware device statements | 272 : DEVICE=C:\NETWARE\LSL.SYS | 273 : RUN=C:\NETWARE\DDAEMON.EXE | 274 : DEVICE=C:\IBMCOM\PROTOCOL\ODI2NDI.OS2 | 275 : DEVICE=C:\NETWARE\IPX.SYS | 276 : DEVICE=C:\NETWARE\ROUTE.SYS | 277 : DEVICE=C:\NETWARE\NWREQ.SYS | 278 : DEVICE=C:\NETWARE\SPX.SYS | 279 : RUN=C:\NETWARE\SPDAEMON.EXE | 280 : IFS=C:\NETWARE\NWIFS.IFS | 281 : RUN=C:\NETWARE\NWDAEMON.EXE | 282 : DEVICE=C:\NETWARE\VIPX.SYS | 283 : DEVICE=C:\NETWARE\VSHELL.SYS GLOBAL | 284 : REM CE=C:\NETWARE\VSHELL.SYS GLOBAL | 285 : DEVICE=C:\OS2\MDOS\LPTDD.SYS | 286 : REM CE=C:\OS2\MDOS\LPTDD.SYS | 287 : REM - NetWare Requester statements END -- | 288 : DEVINFO=SCR,VGA,C:\OS2\BOOT\VIOTBL.DCP | 289 : SET VIDEO_DEVICES=VIO_SVGA | 290 : DEVICE=C:\OS2\MDOS\VSVGA.SYS | 291 : DEVINFO=SCR,VGA,C:\OS2\VIOTBL.DCP | 292 : SET VIO_SVGA=DEVICE(BVHVGA,BVHSVGA) | 293 : DEVICE=C:\OS2\MDOS\VPRPMI.SYS | 294 : Last LINE - 4 | 295 : ****** END ****** | 296 : ****** END+1 ****** | 297 : ****** END+2 ****** | |OTHER INFO |~~~~~~~~~~ |Current Posn : 297 |Current Line : ****** END+2 ****** |# Syntax Errors: 2 187 : COMMAND BEFORE: debug listpgm *PROGRAM BEING RUN *~~~~~~~~~~~~~~~~~ * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(1) : ;saylevel 0 * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(2) : debug ON * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(4) : ;--- Try some EVALUATE calls which will fail badly! ------------------------- * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(5) : evaluate "SyntaxError" "x()" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(6) : evaluate "UnknownVariable" "X + Y" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(8) : ;--- Make a BACKUP of the file (use .BK extension) -------------------------- * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(9) : @say * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(10) : @say '*************************************************************************' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(11) : @say '*** Make a BackUp of the file' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(12) : @say * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(13) : @evaluate 'BackUpFileName' 'left("${TextFileIn}", lastpos(".", "${TextFileIn}")) || "BK"' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(14) : @say 'PROCESSING : ${TextFileIn}' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(15) : @say 'BACKUP FILE: {BackUpFileName}' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(16) : @checkpoint '{BackUpFileName}' //Creating BackUp file * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(17) : @say "Checkpoint Rc = ${Rc} (${RcReason})" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(18) : @say * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(22) : @say * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(23) : @say '*************************************************************************' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(24) : #define Test1 '*** REPLACE SOME LINES' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(25) : @say '{Test1}' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(26) : @top * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(27) : wildcard '~' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(28) : replacelines all "~COBOL~" "REM **** COBOL LINE WAS HERE ****" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(31) : @say * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(32) : @say '*************************************************************************' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(33) : #define Test2 '"*** DELETE A BLOCK"' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(34) : @say {Test2} * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(35) : bottom * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(36) : deleteblock '~ APS' "~END - APS" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(37) : @say 'This should fail as we are past the start & end of this block (FindRc = ${Rc})' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(38) : top * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(39) : deleteblock 'REM ******** APS' "~END - APS" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(40) : @say 'This should work (FindRc = ${Rc})' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(41) : deleteblock 'DEVICE=C:\DB\FIXES\PNPENABL.OS2' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(42) : @say 'This should work (FindRc = ${Rc})' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(43) : wildcard '*' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(46) : @say * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(47) : @say '*************************************************************************' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(48) : @say '*** Find some strings' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(49) : top * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(50) : casesensitive ON * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(51) : find -1 "Should fail can't search backwards from Top!" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(52) : casesensitive OFF * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(53) : find 1 '*Prj*' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(54) : @say '1st "*Prj*" in file is on line #${CurrentPosn} - Case insensitive search - FindRc = ${Rc}' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(55) : @top * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(56) : find 3 '*Prj*' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(57) : @say '3rd "*Prj*" in file is on line #${CurrentPosn} - Case insensitive search - FindRc = ${Rc}' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(58) : bottom * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(59) : casesensitive ON * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(60) : find -1 '*Prj*' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(61) : @say 'Last "*Prj*" in file is on line #${CurrentPosn} - Case Sensitive search - FindRc = ${Rc}' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(62) : find -3 '*Prj*' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(63) : @say '3rd Last "*Prj*" in file is on line #${CurrentPosn} - Case Sensitive search - FindRc = ${Rc}' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(64) : find -999 '*Prj*' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(65) : @say 'Should not have move current position as search should fail. - CurrentLine = ${CurrentPosn}, FindRc = ${Rc}' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(66) : ;#if ${Rc} <> 0 * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(67) : ; exit 255 "Could not locate the required string" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(68) : ;#endif * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(71) : ;--- Add C:\XYZ to 'PrjDir' path -------------------------------------------- * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(72) : @say * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(73) : @say '*************************************************************************' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(74) : @say '*** Adjust some paths' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(75) : libpath DELETE "C:\DB\UTILP;Q:\PROD.EXP\SUE;C:\SUPPORT;C:\EXPORT\SUE" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(76) : libpath ADDSTART "C:\AT\START\OF\LIBPATH1;C:\AT\START\OF\LIBPATH2" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(77) : libpath ADDEND "C:\AT\END1;AT\END2" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(78) : libpath ADDBEFORE 'C:\NETWARE' "BEFORE\NW" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(79) : libpath ADDAFTER 'c:\netware' "AFTER\NW" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(80) : libpath ADDAFTER 'c:\WontFind' "ADDED\TO\START\WITH\RC" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(81) : setpath 'PrjDir' ADDEND "AT\END" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(82) : setpath 'PrjDir' ADDSTART "AT\START1;AT\START2" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(84) : ;--- Get some environment variables ----------------------------------------- * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(85) : @say * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(86) : @say '*************************************************************************' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(87) : @evaluate 'EnvVarPrompt' 'GetEnv("Prompt")' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(88) : @say 'THE CURRENT PROMPT IS "{EnvVarPrompt}"' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(90) : ;--- Execute a command which should work ------------------------------------ * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(91) : @say * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(92) : @say '*************************************************************************' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(93) : execute 'dir e:\os2\bitmap /od' * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(94) : #if ${Rc} <> 0 * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(95) : exit ${Rc} "Dir command failed with RC = ${Rc}" * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(96) : #endif * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(97) : @say * E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(99) : ;--- Test remember current location an go back to it ------------------------ *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(100) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(101) : @say '*************************************************************************' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(102) : @top *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(103) : @down 13 *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(104) : @evaluate 'SavedPosition' '${CurrentPosn}' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(105) : @bottom *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(106) : @say 'Now at current Position = ${CurrentPosn}' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(107) : @moveto {SavedPosition} *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(108) : @say 'After Posn Restore, current Position = ${CurrentPosn}' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(110) : ;--- Try different quote characters ----------------------------------------- *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(111) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(112) : @say '*************************************************************************' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(113) : @say '*** Try a few quotes ***' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(114) : @say 'FRED - single' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(115) : @say "FRED - double" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(116) : @say FRED - double arrow *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(117) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(119) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(120) : @say '*************************************************************************' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(121) : @say '*** Trying a few movement commands ***' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(122) : top *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(123) : @say '"{CurrentPosn}" = "${CurrentPosn}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(124) : @say 'Return code = ${Rc} (${RcReason})' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(125) : down *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(126) : @say █"{CurrentPosn}" = "${CurrentPosn}"█ *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(127) : @say █Return code = ${Rc} (${RcReason})█ *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(128) : down 999 *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(129) : @say "Return code = ${Rc} (${RcReason})" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(130) : @say '"{CurrentPosn}" = "${CurrentPosn}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(133) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(134) : @say '*************************************************************************' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(135) : @say '*** Replace some text, die if we did not make 7 changes ***' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(136) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(137) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(138) : top *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(139) : down *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(140) : down *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(141) : replacetext all 'Fred' 'Dennis' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(142) : #if '${ReplaceCount}' <> '7' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(143) : @exit 255 'Invalid Number of replacements, expected to make 7...' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(144) : #elseif *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(145) : @say ' Made 7 changes as expected...' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(146) : #endif *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(150) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(151) : @say '*************************************************************************' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(152) : @say '*** Try some delete lines ***' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(153) : ;--- Delete the 2nd line ---- *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(154) : moveto 2 *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(155) : deletelines *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(156) : bottom *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(157) : @say 'Current Posn @Bottom = "${CurrentPosn}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(158) : deletelines *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(159) : @say 'Deleted the last line, Rc = ${Rc} (${RcReason})' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(160) : @say 'Current Posn @Bottom = "${CurrentPosn}" (should be 1 less than before)' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(161) : deletelines 4 *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(162) : @say 'Deleted the last line (tried for 4), Rc = ${Rc} (${RcReason})' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(163) : @say 'Current Posn @Bottom = "${CurrentPosn}" (should be 1 less than before)' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(164) : deletelines -2 *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(165) : @say 'The above DELETE should delete 2 lines (backwards & work), Rc = ${Rc} (${RcReason})' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(166) : @say 'Current Posn @Bottom = "${CurrentPosn}" (should be 2 less than before)' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(169) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(170) : @say '*************************************************************************' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(171) : @say '*** Go to Top & Bottom and insert 3 lines ***' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(172) : top *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(173) : InsertLine "****** TOP ******" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(174) : InsertLine "****** TOP+1 ******" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(175) : InsertLine "****** TOP+2 ******" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(176) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(177) : bottom *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(178) : InsertLine "****** END ******" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(179) : InsertLine "****** END+1 ******" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(180) : InsertLine "****** END+2 ******" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(182) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(183) : @say '*************************************************************************' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(184) : @say '*** Checkpoint the file ***' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(185) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(186) : checkpoint *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(187) : @say "Checkpoint Rc = ${Rc} (${RcReason})" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(188) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(190) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(191) : @say '*************************************************************************' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(192) : @say '*** Display some standard variables ***' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(193) : @say *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(194) : @say '"{Rc}" = "${Rc}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(195) : @say '"{CurrentPosn}" = "${CurrentPosn}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(196) : @say '"{CurrentLine}" = "${CurrentLine}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(197) : @say '"{TextFileIn}" = "${TextFileIn}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(198) : @say '"{TextFileOut}" = "${TextFileOut}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(199) : @say '"{ChangeFile}" = "${ChangeFile}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(200) : @say '"{ChangeTime}" = "${ChangeTime}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(201) : @say '"{Parameters}" = "${Parameters}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(202) : @say '"{Version}" = "${Version}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(203) : @say '"{SyntaxErrorCount}" = "${SyntaxErrorCount}"' *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(205) : ;exit 1 "Terminating: Hi there" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(207) : ;--- Change comment characters ---------------------------------------------- *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(208) : #comment 'REM ' ";;" *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(210) : REM --- Dump some stuff ----------------------------------------------------- *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(211) : debug on ;;An inline comment *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(212) : debug DumpVar *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(213) : debug filestate *E:\DB\PROJECTS\OS2\textedit\EXAMPLE.TE(214) : debug listpgm TEXTEDIT completed with RC = 2 ═══ 7. Change History ═══ Change History 1. Version 99.107  New #comment command. 2. Version 99.086  At some stage TEXTEDIT was modified to use new multi platform header file, unfortunately this also meant that TEXTEDIT then required PM to be up or it could fail. We do not want TEXTEDIT to require PM and it no longer does. This allows it to be used early in a CID build of a machine. 3. Version 99.076  New "#define+" command, this is an extremely important variant of the existing "#define" command.  Fixed documentation for "${ReplacedLine}", variable incorrectly named in old doco. 4. Version 99.068  The second parameter of the "DELETEBLOCK" command is now optional. If not supplied its taken to be identical to the first parameter (ie new shorthand). 5. Version 99.041  Searching for "Before*After" (where '*' in middle) was not working.  As per feedback, the case of filenames is no longer modified (translated to upper case).  This program should now run much noticably faster. 6. Version 98.233  Minor fix to allow it to work in Windows 95. 7. Version 98.133  Fixed small bug which prevented "evaluate" command's contents from having leading or trailing whitespace if thats what you were trying to get.  Minor improvement to compare function to speed up slightly. 8. Version 98.085  Found minor "feature" where before a line was compared whitespace was being stripped, I believe that this is wrong for a default action. May make this an option in future. 9. Version 97.305  Initial release on my web page.