Get the most out of
your Robelle Tools
More Improvements to Qedit
By Bob Green and
substitution on both HP-UX and MPE/iX
When the new Varsub option
is enabled (Set Varsub On), Qedit parses entered commands looking for
variable names. If a variable name is found and currently exists, its
value is substituted before the command is executed. If the variable
does not exist, the variable name is left unchanged.
Variable names are identified by a leading dollar sign $. For example, $HOME is replaced with the current value of the HOME environment variable. Some Qedit commands such as List have an extensive series of $-options which, as their name implies, also start with a dollar sign. These options have precedence over environment variables. In other words, if a variable has the same name as a $-option, the substitution does not occur. The only workaround is to change the name of the variable to something that does not conflict.
If you wish to prevent variable substitution and have Qedit interpret the dollar sign at face value, insert a backslash immediately in front of it as in \$HOME.
The tilde is a special character with different meanings in Qedit. Among other things, it can be a string delimiter or a shortcut pointing to the most recent current line in full-screen mode. In HP-UX shells, its also commonly used to designate the users home directory.
Heres how Qedit
handles the tilde character. If its still part of the string
delimiter list (Verify Stringdelimiter), it is used as such. If
its not part of the list and is entered by itself on a line,
its interpreted as the most recent current line of full-screen
mode. If its not part of the list, Set Varsub is enabled and is
used anywhere else in a command, its replaced with $HOME. The
Varsub feature would then substitute the appropriate value. Set
Varsub On automatically removes the tilde from the string delimiter
Variable names are identified by a leading exclamation point !. For example, !HPACCOUNT is replaced with the current value of the HPACCOUNT system variable. Since the exclamation point is normally a valid Qedit string delimiter (Verify Stringdelimiter), Set Varsub On automatically removes it from the string delimiter list.
If you wish to prevent
variable substitution and have Qedit interpret the exclamation point
at face value, put 2 exclamation points as in !!HPACCOUNT.
Qedit commands are added to the Redo stack before the substitution occurs i.e., with the variable name. So, if the variable value changes between the time the command is entered and the time it is retrieved from the stack, the results may be different. Its also important to note that commands related to Redo stack operations such as Listredo, Do, and Before cannot have trailing comments enclosed in curly braces anymore. The comments are not removed and likely cause a syntax error.
Warning: The trailing
comments limitation is an incompatibility with older versions.
Up until now, Qedit was padding lines with spaces in fixed-length files (Set Keep Var Off) or removing trailing spaces in variable-length files (Set Keep Var On). However, users-specified trailing spaces in some HP-UX and POSIX files are significant and are not supposed to vary during the edit session. In order to fix this, Qedit 5.4.11 offers the TrailingSpaces feature. The new option is disabled by default on MPE and enabled (by default) on HP-UX.
Set Work Trailingspaces ON
requests that Qedit preserves trailing spaces and makes them
significant characters. The option also allows creation of odd-length
lines. Once enabled, all workfiles created or opened from that point
will have trailing spaces preserved. To check the current status, do:
Qedits Merge command brings two versions of the same file together. It tries to match lines in the current workfile with lines from the merged file based on the line numbers.
By default, if a line number exists in both files, the line from the merged file is copied into the current workfile, replacing the existing line. Extra lines in the merged file (line number does not exist in the current workfile) are inserted at appropriate locations.
In Qedit version
5.4.12, the new Justified option appends the corresponding line from
the merged file instead of replacing it. Text is appended immediately
after the last non-blank character if Set Work Trailingspaces is
disabled. If Trailingspaces is enabled, text is appended immediately
after the last significant trailing space.
If we use the two
files above and set the maximum length to 5, the resulting file would
Copyright The 3000 NewsWire. All rights reserved.