In F mode, EDT can display the content of work files in hexadecimal form and make it available for editing in this format. This display mode is known as hexadecimal mode or HEX
mode for short. It is activated using the statement @PAR HEX=ON or the @HEX ON statement which is only available in F mode. @PAR HEX=OFF or @HEX OFF deactivates HEX
mode again. The statement code H
can also be used to display an individual line in hexadecimal form and make it available for editing in this format.
The HEX
mode display is dependent on the character set in which the data in the work file is coded. In the case of 7-bit and 8-bit character sets, each character is coded by two hexadecimal digits. UTF16
requires four hexadecimal digits for each character while in UTF8
the number of digits required per character varies between two, four and six and in UTFE
the number varies between two and eight. In addition, the printable form of the line is always displayed.
The first screen line displays the record content in printable form. Below each printable character in this screen line, the character's hexadecimal code is displayed vertically over multiple screen lines. These screen lines are referred to as hex lines below. There are two hex lines when displaying 7 and 8-bit character sets, four when displaying UTF16
, six for UTF8
and eight for UTFE
. They are followed by a column counter as in the case of @PAR SCALE=ON. Any column counter which may have been activated for a data window using @PAR SCALE=ON is not output in HEX
mode.
Only hexadecimal values (0..9,A..F
) and NULL
characters are displayed in the hex lines and these, together with blanks, are also the only values permitted for input. Null bytes at the end of a record are not removed and records which are still empty after the end of the file and which are still displayed in the data window are also displayed by means of NULL
characters in the hex lines.
HEX
mode applies to the current work file independently of the work window, i.e. if the same work file is displayed in different work windows then the same display is used in both work windows.
HEX
mode is also deactivated by specifying @PAR EDIT-LONG=ON.
Modifying records in HEX mode
Modifications can be made both in the first screen line (printable form) or in the hex lines. If characters are entered in both the character display and in the hex lines in the same record in a single dialog step then the changes in the character display are ignored.
In the case of 7 or 8-bit character sets, only hexadecimal characters (0..9, A..F
) may be entered in the hex lines and, in the case of Unicode character sets, the characters must present a legal coding.
If invalid characters or codings are entered then a correction dialog opens, i.e. the screen is output again with the invalid character or coding overwritten with a question mark. The cursor is located in the first invalid screen line. The remaining, valid characters or codings are displayed in modified form on the screen but are not yet taken over into the work file. If the user does not want to correct the invalid character then it is possible to exit the correction dialog by sending the screen unchanged with [DUE]. The old content of the invalid line is then restored and the VALID lines are taken over into the work file. In contrast, [K3] does not exit the correction dialog but simply cancels the last change made by means of keyboard input. Hexadecimal characters may also be deleted (overwritten with NULL
characters) or removed. When removing such characters, it is important to make sure that the half-bytes in the character codings are not disarranged.
Split screen display
When the screen is split (@PAR SPLIT), the display in HEX
mode depends on the number of data lines (screen lines in the data window) in the relevant screen:
If only one screen line is missing then the column counter line is not output.
If there is not sufficient space to display all the hex lines then only the character display line is displayed. Unlike in the compatibility mode display, the column counter line is not output in this display mode since it is not of use here.
Any remaining screen lines are used for the display of the following records. These rules then apply recursively to such lines.
Since in HEX
mode, records are always displayed by means of multiple screen lines, this mode is only of any value if at least one record can be displayed together with all its hex lines. If this is not the case, the message EDT2404
is output when HEX
mode is activated. However, HEX
mode is activated nevertheless. The user can then enlarge the data window to view the hex lines.
Special considerations when displaying UTFE and UTF8
In the subsets of UTF8
and UTFE
supported in BS2000, characters are coded using one to three or one to four bytes per character respectively. Despite this, each record is displayed with six or eight hex lines. In the case of characters that are coded with fewer than six or eight bytes respectively, the remaining hex lines contain NULL
characters.
Example
The data in the example is coded in UTF8
.