Built-In Text Editor: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[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 [[:Category:Utilities_Third_Party|editor]] for a faster editing experience:
[[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 [[:Category:Utilities_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 [[:Category:Commands|Command Category]] and [[:Category:Statements|Statement Category]] for details on each. Below is a simple description of basic actions in BR.
===Changing a program line===
===Changing a program line===


Line 18: Line 22:


===Cut And Paste===
===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:
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)===
===F7 (Mark/Copy)===
Line 91: Line 94:


==Conventions Used In This Wiki==
==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]].


===<Help>===
The symbol <HELP> is used to represent the key that accesses the Help facility. Business Rules is set up to access help with Ctrl-Y. Since this combination will frequently be remapped, however, we have chosen to use <HELP> to refer to the appropriate key.
===Uppercase VS Lowercase Letters===
Throughout this manual, uppercase letters are generally used to denote the names of commands, statements, functions and other specifications. Uppercase is also used with the names of most files or programs except where the file or program being referred to is exclusively used with the Unix or Linux operating system. Regardless of your operating system, Business Rules accepts both uppercase and lowercase letters as identical except when they are used in a literal string. It defaults to displaying all but literal strings in uppercase (see the BRConfig.sys STYLE specification to change this default).
===Diagram Rules===
;Syntax diagrams show the optional and required parameters for statements, commands and specifications. The following LINPUT statement diagram will serve as an example for the set of rules, which applies to all Business Rules syntax diagrams:<br>
[[Image:linput.png]]
;Read from left to right
The logic and order of the syntax always flows from left to right.
;Uppercase parameters are exact keywords
Items in solid uppercase letters (LINPUT) are keywords and must be typed in either letter-for-letter as they appear or with an allowable abbreviation (see  [[keyword abbreviation]]s for a complete list).
;Lowercase parameters must be replaced
Items in lowercase letters (string-var) are specifically defined in the "Parameters" section, which follows each syntax diagram. When specified, these parameters must be replaced with a specification that fits the requirements of the definition.
;Include special characters
Special characters, such as commas, colons and slashes (the colon in filenum:) must be included in the written statement.
;Items on the main line are required
Items that appear on the main line of the diagram (string-var) must be included in the written statement. If you can follow the line of the diagram to the end without passing a parameter, it is optional.
;Items above or below the line are optional
Items that appear above or below the main line of the diagram (error-cond line-ref) are optional.
;Dotted line items with an arrow can be repeated
Items with a returning dotted line may be repeated. When multiple items are indicated, they must be separated with the punctuation mark (usually a comma or semi-colon).
;Defaults are listed in brackets
Numbers that are enclosed in brackets (<1>) identify the default action or value, which is taken when nothing is specified for an optional parameter. These numbers correlate to the "Defaults" section of the text that describes the default action.
;Insertable diagrams
Some of Business Rules commands and statements are so powerful that it is difficult to show all the available options in a single diagram. In cases such as this, a section of the diagram may be shown separately as an "insertable syntax". An example of this usage is the "[[helpstring]]" parameter that appears in several diagrams, including [[INPUT FIELDS]]. Another example is the "[[share spec]]" parameter (shown below). Insertable diagrams do not have start and end circles to prevent them from being confused with full syntax diagrams.<br>
[[Image:sharespec.png]]
;End of statement
The circle at the end of the diagram identifies the end of the statement.
==Starting Business Rules - The BR Command==
{{: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 [[Business Rules!|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 [[:Category:Release 3.8|3.8]]-[[:Category:Release 4.0|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.  This much is unchanged.
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. See the Installation instructions that came with your system for the proper procedure.
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.
The BR start-up command accepts some useful specifications that are outlined in the next section. If you are impatient to get started, however, the following commands show the shortest possible way to start Business Rules.
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 shortcut.
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$]]
===Message Area===
The message area portion of the status line (columns 9- 37) contains information about what action is required from the programmer or operator in a particular situation.
===Program Name===
The program name portion of the status line (columns 49-56) displays the last eight characters of the name of the currently executing program.
===Procedure Status===
The procedure status portion of the status line (columns 58-59) displays information about the currently active procedure file. A "P" followed by a number that represents the nested level of the currently active procedure will appear in this position whenever a procedure or sub-procedure is being executed. When a program calls a procedure, or when a procedure is initiated with the [[PROC]]]] command, "P1" is displayed. If that procedure then calls another procedure, "P2" is displayed, and so on. When no procedure file is running this portion of the status line is blank.
===Serial Number===
The serial number portion of the status line (columns 61-69) always displays the serial number of the Business Rules system in use.
===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.
===Row and Column / Release Number===
On Windows versions of Business Rules, the row and column numbers of the cursor's current location appear in the ninth field (columns 75-79). The row number is displayed first, then a colon and the column number.
On Unix / Linux versions of [[Business Rules!]] (columns 76-79) display the Business Rules release number.
===Special Syntax Consideration===
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 (!).
===The Status Line===
Once you have entered Business Rules, you will see the Business Rules sign-on screen and some licensing information. You may press ENTER to hurry the presentation of the licensing information if you wish.
When the licensing information has left the screen, the status line will appear. The status line is the bottom or 25th line on the screen. Some Unix / Linux terminals do not fully support 25-line displays; if you are using one of these terminals, you will need to press the Esc key to see the status line except when an error occurs in which case the status line is displayed automatically.
For information about how to alter the information or attributes in the status line, see the [[STATUSLINE]] and [[SCREEN]] specifications on the [[BRConfig.sys]] page. See also the [[MSG$]] function.
===Interrupting a Procedure===
Procedure files may be interrupted in the same manner as identified above for a program. 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===
{{:Operating Mode}}
==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:<br>
line-number (that caused the change)  variable-name  new-value
===Program Flow===
In STEP mode GO indicates GO RUN.  Enter indicates GO STEP.
===Break  variable-name / line / label:    [ OFF ]===
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.<br>
e.g.  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:===
{|
|-valign="top"
|width="10%"|'''Shift-F1'''||Step Into Clause - Processes only the next clause.
|-valign="top"
|width="10%"|'''Shift-F2'''||Step Over Clause - Processes the next clause plus all routines called by it.
|-valign="top"
|width="10%"|'''Shift-F3'''||Step Into Line - Processes up to the next line number encountered.
|-valign="top"
|width="10%"|'''Shift-F4'''||Step Over Line - Processes the next line plus all routines called by it.
|-valign="top"
|}
<br>
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]].


<noinclude>
[[Category:Basics]]
[[Category:Basics]]
</noinclude>

Latest revision as of 04:30, 20 May 2014

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.