Jbase JED
Jbase JED
INVOKING jED
Call the jED editor from the UNIX or Windows command line.
SYNTAX
jed pathname {pathname..}
jed {DICT} filename{,filesection} {record-list} {(options)}}
If you simply issue the command jed, the editor will open the last file that was used, and the cursor
will be positioned wherever it was when the last edit session was closed. In other words, you can carry
on from exactly where you left off. The command, jed pathname, will either open an existing file or
create a new one if the file referenced by pathname does not exist. The will contents of the file will be
displayed in the edit window. If you specify a list files, the editor will present the next file as you finish
with each one.
When the editor is supplied with the name of a file resident in a database (such as a j-file), it scans the
rest of the command line looking for a list of records keys. If no record keys were specified, the jED
editor will prompt for a list. Otherwise the list of record keys will be edited one after the other.
Note that because the editor uses the jEDI interface to access the records, it can be used to edit
records in any file system that jEDI recognizes.
DICT This modifier is only required if you wish to edit records in the DICTionary of a j-file.
filename This is the name of the "file" containing the records.
filesection This is the file section name, as used in a j-file.
record-list It is possible to furnish a list of records to be successively edited. This can be a list of
records separated by a space, or "\*" to indicate all records in the file. Note that the \ is the shell
escape character to stop the * being treated as a wild card that would otherwise be expanded.
Additionally, the record-list can be fed to this command by preceding the jed command with a jBASE
list generating command such as SELECT or SSELECT. In this case, the record-list is ignored.
EXAMPLES
jed test.b
Opens the test.b file for editing, initially in insert mode with automatic indentation turned on. If the
file does not exist, it is created and the text New Record is shown at the top of the screen.
jed test.b (B5,2
The jBC program test.b is edited with automatic indentation set. The initial indent is set at 10 spaces
for all lines, and each additional indentation level is set at 5 spaces.
jed invoices.b subs.c
The jBC program invoices.b will be edited, followed by the "C" program subs.c.
COMMAND MODE
When the editor is invoked, the record or text file is displayed, and the user is placed in input mode
with the cursor at the input position.
To change to command mode simply press the <Esc> key on the keyboard. The cursor now moves to the
top portion of the screen and the editor awaits input of a command. Once a valid command has been
executed, control passes back to the Edit mode if appropriate.
EDIT MODE
Edit mode is used when entering or modify data. This is the default mode for an editor session.
Keyboard control sequences are available to perform a variety of functions such as cursor positioning,
scrolling and marking text for a subsequent action.
Some command line operations are also available from keyboard control sequences.
KEYBOARD PERSONALIZATION
The jED editor allows a considerable number of functions and commands to be performed whilst in edit
mode, mostly by combining the <Ctrl> key and one other key.
Most keys have a default value (which can be reset using the E option when invoking jED). These can be
reconfigured for each command. The keystroke sequence can be chosen to suit the keyboard, the
installation environment or personal preference.
The keystroke environment is usually be set up by modifying the UNIX terminfo file parameters. The
default editor commands can also be overriden by configuring the .jedrc file.
<F10>
<Ctrl
A>/<Home>
Function
scrolls the screen up one line.
scrolls the screen down one line.
scrolls the screen up half a page.
scrolls the screen down half a page.
scrolls the screen up one page.
scrolls the screen down one page.
displays the first page of the record or file.
displays the last page of the record or file.
pressing <F9> when the cursor is positioned on a line of source code that begins a
structured statement (IF, BEGIN CASE etc.), will cause the editor to locate the closing
statement for the structure. If the cursor line is an IF statement then the editor will
attempt to find the END statement that closes this structure. If there is no matching
END statement then the editor will display a message to this effect.
the <F10> key is complement of the <F9> key. Therefore if the cursor is positioned on
an END statement, then the editor will attempt to find the start of the structure that
it is currently terminating. If the END has been orphaned (it matches no structure),
then the editor will display a message to this effect.
moves cursor to start of the current line.
<Ctrl E>/<End>
Left Arrow
Right arrow
Up arrow
Down arrow
<Tab>
<Shift Tab>
<Esc>
<Ctrl W>
<Ctrl K>
<Back Space>
<Delete>
<Ctrl D>
<Ctrl G>
<Ctrl L>
<Ctrl N>
<Ctrl
O>/<Insert>
<Ctrl P>
<Ctrl R>
<Ctrl T>
<Ctrl V>
<Ctrl X>
<Ctrl ]>
<Ctrl \>
<Enter>
COMMAND OPTIONS
R specifies that, after the file has been written to disk, it should be executed. Additional parameters
can be added to this option and passed to the program. The editor issues the command filename
{parameters} to execute the program. Note that the .b suffix is removed.
K or T option specifies that if the editor was working from a list of records, the list should be discarded
and that the editor should exit directly to the shell (or to the calling process).
O specifies that the confirmation request normally issued with the FD and EX commands should be
suppressed.
The R option is particularly useful to jBC programmers.
EXAMPLES
FIK
Exits the record and writes it to disk. If in the middle of a list of records being edited, the list is
abandoned and the editing session is terminated.
FDO
Delete the current record being edited. The normal confirmation of this action is not given.
LOCATING STRINGS
The editor allows the user to search and locate any string held in the body of the text being edited.
There is also a keystroke command sequence (default <Ctrl N>) to allow the user to find the next
occurrence of the string used in the previous locate command.
The locate command syntax is as follows:
L{nnn}dstring{doption}
nnn is the numeric value of the number of lines to search from the cursor position. If omitted, the
search continues to the end of the file or record. If this optional parameter has been specified then all
occurrences of the string will be located over the specified number of lines. If only a single occurrence
is found then the cursor is placed at this point in the file. If multiple occurrences of the string are
found then each one is listed below the editing screen.
d is the delimiter used to enclose the string to be located. It can be any character that does not form
part of the string.
string is the string to locate.
EXAMPLES
L/report
Searches the record from the current position for the string "report" and halts at the first occurrence
found, with the cursor at the start.
L9 FORM
Search the next 9 lines and locate all occurrences of the string "FORM".
L/STARS/F
Searches from the first line of the file to find the first occurrence of the string "STARS". This line is
placed at the top of the screen.
L/acropolis/C
Locates the first occurrence of the string "acropolis" with the letters in upper or lower case.
REPLACING STRINGS
The editor allows the user to replace any occurrence of a string on any line with another from the
command line. This is in addition to the overwrite mode.
The command syntax is as follows:
R{U}{nnn}dstring1dstring2{doption}
U replaces ALL occurrences of string1 with string2 on the current line only.
nnn is a numeric value for the number of lines, starting from the current one, over which to perform
the replace operation. If this optional parameter is specified and more than a single occurrence of
string1 is found then all replacements are listed beneath the current editing screen. d is the delimiter
character used to separate the string values. It can be any character not in either of the strings.
string1 is the string that is to be replaced.
string2 is the replacement string. This can be shorter or longer than the original.
option can be one or more of the following:
F executes the replace command from the first line of the file or record.
EXAMPLES
R/ABC/DEF
Replaces the first occurrence (reading from the left) of ABC in the current line with DEF.
R9/*/!
Replace on the next 9 lines, the first occurrence on the line of "*" with a "!". The changed lines are
displayed before moving on.
RU9/*/!
Replace any occurrence of "*" with "!" over 9 lines (the current line and the next 8).
R999//*/F
Place a "*" character at the start of every line starting from the first. All lines changed are shown
before returning to the original line.
R/^/AM/*
All occurrences of the "^" character on the line are replaced with "AM".
R9/*//
Removes (replaces with null) the first occurrence of "*" on the next 9 lines.
R/x//10
Removes the first 10 "x" characters on the current line.
MARKING TEXT
Text can be marked whilst in edit mode by using the appropriate keystroke command (default <Ctrl G>)
to mark the start and end of the block.
To highlight a block, move the cursor to the first line to be highlighted and press <Ctrl G> (or the
reassigned ones). Then move the cursor to the last line to be highlighted and again press the <Ctrl G>
The start and end lines can be marked in any order.
To cancel the marked text, simply press <Ctrl G> again, which will remove the markers.
Once the text is marked the cursor should be positioned on the line to which the text is to be copied or
moved before invoking the command line or key sequence required.
MISCELLANEOUS COMMANDS
DE{nnn}
Deletes the number of lines specified by nnn, starting from the current cursor position. If nnn is
omitted it defaults to a value of one line.
S?
Displays the size of the record being edited in bytes. It includes field delimiter marks in the body of the
record.
!{command}
Executes command. Can be any valid UNIX or jBASE command.
!!
Re-executes the command specified in the most recent ! command executed.
U{nn}
Scrolls the screen up by nn lines. If omitted, nn defaults to one line.
D{nn}
Scrolls the screen down by nn lines. If omitted, nn defaults to one line.
I{nn}
Inserts nn blank lines after the line holding the cursor. If omitted, nn defaults to one line.
nn
Positions the cursor on line nn, which is positioned at the top of the screen if the number of remaining
lines still allows a screen"s worth of data to be displayed.
IN
Equivalent to the <F10> key.
IP
Equivalent to the <F9> key.
?
Displays the main help screen menu.