Built-In Text Editor

From Br Wiki
Jump to: navigation, 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.