Built-In Text Editor

From BR Wiki
Jump to navigation Jump to search

Business Rules! utilizes a very simple text editor for program entry. The editor is available in the system as soon as you start up; all you need to do is type. The options and features of the text editor can be summarized as follows, however, it is recommended that you use a third party editor for a faster editing experience. The options and features of the built-in text editor are summarized below:

Basic Actions

See the Command Category and Statement Category for details on each. Below is a simple description of basic actions in BR.

Changing a program line

Typing in the new line, beginning with the line number, can change program lines. You can use the List command to list and edit the line you wish to change; the change becomes permanent when you push Enter. Since Business Rules is interactive, you can even change most lines while execution of a program is temporarily stopped during ATTN, ERROR or STEP mode. In most cases, the change in the program line will take effect as soon as program execution has been resumed.

Clearing memory

Before starting anything new, we recommend that you type in the command CLEAR ALL to erase everything (programs and data) from temporary memory.

Clearing the screen

If you wish to work from a clean screen, type in the command Print Newpage (or, if you prefer, just NEWPAGE). This immediate mode statement will erase the contents of the screen without affecting anything in memory. Pressing the F4 key when Business Rules is in READY mode has the same effect.

Cursor movement

See Control Keys and Predefined Functions for a list of control keys and their functions.

Cut And Paste

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.

Deleting a program line

Once a program line has been entered, the only way to remove it from temporary memory is to use the DEL command. Contrary from what you might expect, typing over a statement with a statement of a different line number does not delete the original; character-by-character deletion of a program line also does not remove it from memory. (In both cases, the line will reappear in a LIST of the program.)

Editing programs with an external editor

Requires Business Rules! 4.15+

In Business Rules! versions 4.15 or later, in addition to the built-in Business Rules! editor, you may optionally use an external text editor to enter and edit your programs. For complete details on using external text editors with Business Rules! programs see Edit.

"Entering" an instruction

Business Rules will not check the syntax, enter any statement, or execute any command until the typed-in instruction has been entered by the pressing of ENTER. Likewise, a change to a statement will not be retained unless the changed statement is entered by the pressing of ENTER.

Generating line numbers

Every program line must have a line number, but it isn't necessary for you to type in your own line numbers if you don't want to. The AUTO command can be used to automatically generate line numbers.

Listing the program

Business Rules LIST command allows you to view the complete contents of a program. This feature can be used both while Business Rules is in READY mode and while execution of a program has been temporarily stopped during ATTN, ERROR or STEP mode.

Merging programs

Use the MERGE command to combine all or part of a program on disk with the one in memory.

Moving program lines

Use the RENUM command to move several program lines from one part of the program to another.

Renumbering program lines

The RENUM command allows you to renumber all or some of the lines in a program. If you wish to change line numbers for the purpose of combining one program with another, see the MERGE command.

Repeating program lines

It is not necessary to repeatedly type in program lines which are very similar or which are identical except for their line numbers. Simply change the line numbers of the lines to be repeated (remembering always to press ENTER after each change). The old lines will be retained and the new lines will be entered; you can use the LIST command to Verify that each line was entered as you expected.

Saving a file

Use the SAVE command to save a file under a new name. Use the Replace (REP) command to replace an existing file with a newly edited version.

Save font size and position

The ability is now provided to save the font size and position for each session number. To access this feature, click on the upper left corner of the BR window.

Type-over vs. Insert mode

Business Rules defaults to the type-over mode, which means that typed characters replace the characters, which previously occupied the same position. If you wish to use insert mode (where typed characters are inserted between existing characters) you have to press the INS key. However, insert mode will remain in effect only until an up or down arrow or ENTER is pressed.

Interrupting a Program

The only way to interrupt a program while it is in execution is to press Ctrl-A (BR versions 3.9+)

Pressing Ctrl-A causes the program to go into ATTN mode. Other commands and immediate mode statements, including the STOP (St) and END (En) statements, may be executed from ATTN mode. The use of many debugging features -such as the LIST command, PRINT statements, editing of programming lines, STEP or TRACE modes and changing values of variables -are supported in ATTN mode. If the program is not ended with a command or immediate statement, entering GO causes program execution to resume.

Conventions Used In This Wiki

Commands, statements, and other BR tools described in the wiki often have a diagram to illustrate the syntax. For a list of conventions used in this wiki, see Diagram Conventions.

Starting Business Rules - The BR Command

Under DOS and UNIX the BR startup command is simply br, under Windows the command is the name of your particular Business Rules executable file. For instance, if your Business Rules! program is BR32.exe, then you'd type in BR32 to start Business Rules!. This command can be connected to a desktop or folder shortcut.

For more information, see the section on BR32.exe.

Installing Business Rules

The Installation procedures for Business Rules! vary according to the operating system and hardware you will be using. See the Installation instructions that came with your Business Rules system for the appropriate procedure.

Location

The Windows icon Working Directory path specifies where the Windows BR32.EXE file resides. The location of the BR executable file is also the default location of BRCONFIG.SYS. The startup parameters on the Windows icon or the DOS or Unix command line can specify an alternate pathname for BRCONFIG.SYS. Simply begin the config filename with a minus sign. Br interprets it as a config file if it begins with a letter and is not a recognizable parameter.

WBSERVER.DAT
BRCONFIG.SYS can also specify the location of a WBSERVER.DAT file, which is created by BR!, and used for tracking workstation IDs. A BRCONFIG.SYS statement example
WBSERVER F:\\CENTRAL\\

The WBSERVER.DAT file must be common among the various workstations on a network in order for file sharing to work properly. BR produces error 4175 when a file is opened by the second of two workstations that use different WBSERVER.DAT files.

Fonts

In versions 3.8-4.0 BR requires its own font to be installed. This is available in the Other Utilities section of the web site. If you don't install it you may notice horizontal lines, like underlines on your screen, especially when you resize the window. To install a font, go to the Control Panel Font Manager and add the font.

Printer Spool Settings

Windows clients that print to a local printer should go to Start Settings Printers File Properties Details Spool-Settings and set the Spool Data Format (default EMF) to RAW. Otherwise all data spooled through the Windows print manager will be dropped. The print manager can also be bypassed with "SUBSTITUTE PRN:/10 LPT1:".


INSTALL SHIELD CHANGES

After the License Approval, the installation location is confirmed with a browse option and the automatic creation of any missing directories.

If the user selects a new location, it is now properly honored by the installation setup. However, no changes are made to any user provided configuration files. This means YOU ARE RESPONSIBLE TO PROVIDE THE PROPER DRIVE STATEMENTS IN A BRCONFIG.SYS FILE PLACED ON THE INSTALLATION MEDIA prior to installation. These must specify the directories to be used AFTER installation.


To support updating with Install Shield
If a BRConfig.sys file HAS BEEN PROVIDED by the programmer

If a pre-existing BRConfig.sys file is found at the target location, the operator is asked if the new file should replace the existing file. THE DEFAULT ANSWER IS TO RETAIN THE CURRENT FILE. If the operator requests REPLACE then a backup (.BAK) copy is made before installing the new file.

If no pre-existing BRConfig.sys file is found the provided configuration file is installed.

If a BRConfig.sys file IS NOT PROVIDED by the programmer

If a pre-existing BRConfig.sys file is found, no configuration file changes are made by the installation process.

If no pre-existing BRConfig.sys file is found, the installation process creates a BRConfig.sys file consisting of only one drive statement.

Installshield now permits retention of a pre-existing BRConfig.sys file. During installation, the user will be asked if it should be overwritten.

Using Business Rules

Business Rules! must be installed on your system before you can start it.

Once Business Rules! has been installed, you should make sure that the system is accessing the directory within which Business Rules resides.

Business Rules must be started from the host operating system with the br start-up command. Since the Unix and Linux operating systems are case sensitive, the command must be entered in lowercase on these systems. See the above section for details.

Version and Station Number

Information you should have at hand when you call for support
1.) What version of BR are you using: WBVERSION$ or STATUS
2.) What operating system version are you using
3.) What is your workstation id - WSID$
4.) What NetWork are you using
5.) What platform are you using?
6.) Serial number - serial
7.) Session Id - Session$

Status Line

Once you start Business Rules, you will notice that the bottom row contains information about the mode, message area, Error Code, line number, program name, procedure status, BR license serial number, and cursor position by row and column number. See Status Line for details.


Quitting Business Rules

The only proper way to exit Business Rules is with the SYSTEM command. Use of this command returns all control to the operating system. Remember to save all important programs or data before using this command.

The SYSTEM command followed by an executable name can also be used to temporarily "SHELL OUT" to another program and then return to Business Rules.

If no programs are running or in error mode, you can also exit BR by simply closing the main window.

Comments

In addition to the syntax described by syntax diagrams, Business Rules! commands may include a comment at the end of the command. At least one space and an exclamation point must separate the comment from the rest of the command (!).

Interrupting a Program or Procedure

Procedure files may be interrupted in the same manner as programs, by pressing Ctrl-A. However, one difference is that pressing Ctrl-A causes a procedure file to interrupt and cancel the currently executing command. Typing CLEAR PROC ONLY while a procedure is interrupted will end it; typing GO will cause it to continue executing with the next command in the procedure.

Operating Mode

When you press Ctrl-A, BR will enter ATTN mode. The operating mode portion of the status line (columns 1-7) contains information about what Business Rules is currently doing. For details on each see Operating Mode or the Mode Category.

Program debugging extensions

Display

DISPLAY     variable-name / ALL     [ OFF / PRINT ]  [ >filename ]
Shows the value of 'variable' or all variables, after any changes, plus the line number associated with the change(s), in the format

line-number (that caused the change)   variable-name   new-value

Simply typing the name of the variable into BR will display its current value. Combing this with STEP mode can help the debugging process.

Program Flow

In STEP mode GO indicates GO RUN. Pressing <Enter> indicates GO STEP.

Break variable-name / line / label: [ OFF ]

The BREAK command causes the program to go into step mode when the variable contents are changed or the specified line is encountered. Both "BREAK variable" and "DISPLAY variable" may be active on the same variable concurrently.

DISPLAY and BREAK debug commands work with specific array elements. For example, BREAK CUSTOMER$(6) will cause a program break whenever CUSTOMER$(6) is changed.

1.) Debug data can be redirected to a file.
2.) Debug commands will generate errors 1006 and 1070 instead of ignoring commands with errors.
3.) Debug now displays up to 240 characters of scalar or array element data instead of just 80 characters.


Extended Function Key [Shift F1 - Shift F4] Stepping:

Shift-F1 Step Into Clause - Processes only the next clause.
Shift-F2 Step Over Clause - Processes the next clause plus all routines called by it.
Shift-F3 Step Into Line - Processes up to the next line number encountered.
Shift-F4 Step Over Line - Processes the next line plus all routines called by it.


Note Shift F1 - F4 increases Fkey number as scope of step increases.

Screen Restore

The command RUN STEP NORESTORE suppresses the restoration of the screen after the initial restoration. This enables DOS and Windows models to work like Unix in this regard when stepping through a program.

The command RUN STEP RESTORE causes the application screen to be refreshed before processing each execution step, even in Unix.

GO RUN does not reset the NORESTORE option.


Duplicate Label Checking

Duplicate label checking has been relocated to SAVE/RUN processing. So EDIT will not fail when merging duplicate labels.

Speed improvements have been made when resorting via AIDX.