The Business Rules! program editor now has cut and paste capability. The F7 and F8 keys are used to accomplish the tasks of marking, copying, moving and pasting all or a portion of a program line or command. Their functions are described in detail below:
F7 (Mark/Copy)
Mark - Pressing F7 causes Business Rules! to mark the starting point of the text to be copied or moved. Business Rules! highlights the starting position and mark is said to be active when F7 is pressed.
Copy - Pressing F7 when mark is active causes Business Rules! to copy the marked text into a scratch buffer. To help you confirm that the marked text has been copied, the message "x Bytes Saved" (where "x" represents the number of bytes) is displayed in the message area of the status line.
F8 (Move/Paste)
Move - Pressing F8 when mark is active causes Business Rules! to move the marked text into a scratch buffer, deleting the marked text from the current line. To help you confirm that the marked text has been copied to the buffer, the message "x Bytes Saved" (where "x" represents the number of bytes) is displayed in the message area of the status line. Note that Business Rules! does not enter the change to the current line. If a portion of the current line was deleted, you must press <ENTER> to save the deletion. If you wish to delete the entire line, you must still use the DEL command.
Paste - Pressing F8 when mark is not active causes Business Rules! to insert the buffered text at the current cursor position. There is no limit to the number of times that buffered text may be pasted into a program.
Description
The FMT (format) specification is now supported for use with FIELDS processing for
validating and formatting of entered string or numeric data. It is similar to PIC as used
for screen I/O, but more powerful, and more suited to use with strings.
One of the advantages of FMT is that it handles simple error checking of entered data
(beeping when any character entered is in the wrong format) and it can fully format a
field for input by forcing uppercase/lowercase, flush right and zero fill formatting.
Another advantage is that it can display a single field (from the programmer's
perspective) as two or more fields for the user.
FMT vs. PIC Release 3.53
With some exceptions, FMT is best suited to handling strings, whereas PIC is generally used with numeric data only.
FEATURE FMT
PIC
Available for file I/O (READ, WRITE, FORM) no yes Available for screen I/O (INPUT/PRINT FIELDS) yes yes
Formats/verifies data output to screen no yes Formats/verifies data input from keyboard yes yes Fields can be protected yes yes Individual positions within field can be protected yes no Presents field parts (separated by insertion characters)
as separate fieldsyes no
Works with numeric data yes yes Allows zero suppression no yes Allows zero fill yes yes Allows floating dollar symbol ($) N/A yes Allows floating asterisk (*) N/A yes Allows floating minus symbol (-) N/A yes Allows floating plus symbol (+) N/A yes Allows exponential format no yes Allows insertion characters yes yes
Works with string data yes no Forces upper/lowercase yes no
Syntax:
The FMT spec can be used in the same places that PIC is allowed in INPUT FIELDS, RINPUT
FIELDS and PRINT FIELDS statements. The FMT keyword must be followed by up to 40 character
identifiers and/or insertion characters.
Character identifiers tell the system which characters are allowed in the current
position, and they identify the way in which the data part should be formatted for input.
(Business Rules! considers any section of a FMT spec which is separated from other
sections by one or more insertion characters to be a data part.) The following character
identifiers are currently available:
P or p - Protected. Business Rules! will not allow the cursor to rest on or change any data that is displayed in this position.
X - Allow any character; force it to uppercase if alphabetic.
x - Allow any character; leave case as entered.
A - Allow any character from A to Z or a to z; force it to uppercase.
a - Allow any character from A to Z or a to z; leave case as entered.
Y - Allow Y, y, N or n only; force it to uppercase.
y - Allow Y, y, N or n only; leave all case as entered.
G - Allow any character from A to Z or 0 to 9; force it to uppercase if alphabetic.
g - Allow any character from A to Z, a to z or 0 to 9; leave all case as entered.
9 - Allow any character from 0 to 9.
R - Right flush this part from current position to end of this part or next #, whichever comes first; allow format and force case as designated by next character identifier within this part. (If R is the only character identifier used within a FMT part, error 0805 will result.)
# - Right flush and zero fill from current position to end of this part or next R, whichever comes first; allow format and force case as designated by next character identifier within this part. (If # is the only character identifier used within a FMT part, error 0805 will result.)
Insertion characters are displayed exactly as they appear in the FMT specification. Business Rules! treats any keyboard character that is not a character identifier (listed above) as an insertion character. Insertion characters are inserted for the operator's benefit. They will not be in the data. Note that "P" can be used to protect characters that you want to appear in the data.
Input and cursor characteristics Release 3.53
The first field specification in the following example displays to the user what looks and
acts like two fields which are separated by a dash. Insert, delete, erase and field plus
will modify only one part of the field. Pressing the down arrow will move the cursor from
any position in the first part to the first position in the second part. However, when the
cursor is positioned at the first field after the field specified by a FMT spec (at row
12, column 10 in the following example), pressing the up arrow will cause the cursor to
move to the first position in the first part of the FMT field.
Only numeric data will be allowed, even though the entered value is to be assigned to a string variable. A beep will sound if an invalid character is typed for any position. Once entered, the data will be right justified.
INPUT FIELDS "10,10,FMT(R999-R9);12,10,C 12,AE":X$,Y$
Examples
The following INPUT FIELDS statement will display two field parts separated by a dash. The
first field part will accept any character, leaving case as entered. It will also be right
justified upon field part exit. The second field part will accept any character but force
it to uppercase if alphabetic. No right flush formatting will be done on field exit.
INPUT FIELDS "10,10,FMT(Rxxx-XXX),AE":X$
The next INPUT FIELDS statement displays two field parts separated by a dash. The first four characters must be alphabetic, and they will be forced to uppercase. The second four characters must be numeric.
If fewer than four characters are entered, the entered data will be right justified and, within the second group of four characters, positions to the left of the first entered character will be filled with zeros.
INPUT FIELDS "10,10,FMT(RAAA-#999),AE":X$
Examples of values that could be entered for the above code fragment are as follows:
ABCD-1234
ACB-0001
B-1000
Conversion errors on G, N and PIC formats can now be avoided on output to display files
when the CONV= parameter is used in the OPEN DISPLAY statement. Also, when CONV= is used,
PIC processing will first try removing the commas from the output if doing so will prevent
an overflow condition. See "OPEN DISPLAY" in the statements section for more
information.
The GF (generic, floating point) format specification has been added for use by the FORM statement and by INPUT/PRINT FIELDS. It is the same as G in that it can be used with either string or numeric data, and in all other ways it is identical to L as used with INPUT/PRINT FIELDS. Note the following code fragment:
PRINT USING "2*GF 10":333, 444.44
output:
333 444.44
Conversion errors on G, N and PIC formats can now be avoided on output to display files
when the CONV= parameter is used in the OPEN DISPLAY statement. Also, when CONV= is used,
PIC processing will first try removing the commas from the output if doing so will prevent
an overflow condition. See "OPEN DISPLAY" in the Statements section for more
information.
Release 3.53
Conversion errors on G, N and PIC formats can now be avoided on output to display files
when the CONV= parameter is used in the OPEN DISPLAY statement. Also, when CONV= is used,
PIC processing will first try removing the commas from the output if doing so will prevent
an overflow condition. See "OPEN DISPLAY" in the Statements section for more
information.
Release 3.53
PIC((ZZZ,ZZZ.##)) now supports parentheses as digit identifiers (left side of the number only) and insertion characters, with the rule that parentheses will be output only if the number is negative. The left parenthesis that is closest to the number but not replaced with a digit will be output when the number is negative.
PRINT USING "FORM C 4,PIC((((ZZ,ZZZ.##))":"xxxx",-200
output:
xxxx ( 200.00)
PRINT USING "FORM C 4,PIC((((ZZ,ZZZ.##))":"xxxx",-200000
output:
xxxx (200,000.00)
The ZD format specification is now valid for use with display files (PRINT). This was
done mainly for S/36 compatibility.