Emulation


Emulation support is provided by the Config_EMULATE file in the "config" subdirectory of the jBASE release directory. All text in the file is case insensitive.

The format of that file is:

#

Denotes a comment and the line is ignored.

x:

Denotes a label, signifying the start of an emulation definition.

any

Denotes an emulation definition.

Labels must be alpha-numeric, i.e. no periods, underlines, etc. If one label directly follows another then the label is synonym for the same emulation definition. The emulation definition ends when another label or the end of file encountered.

Multiple emulation definitions can be defined on the same line with each definition delimited by a comma or a semicolon. Emulation definitions can be interrupted by blank lines and can contain any amount of white space, i.e. one or more spaces or tab characters.

Emulation definitions can be declared 'on', 'yes' or 'true' to mean the emulation is enabled or similarly use the strings 'off', 'no' or 'false' to mean the emulation effect is disabled.

To use a different set of emulation definitions from the default set, set the environment variable JBCEMULATE in your current environment to the required emulation label. When the environment variable is not configured then the emulation definition defined by the default label is in effect. If the default label is not present then the first label detected will be used for the default emulation.

Generally any emulation definitions which affect BASIC, (like the @(-n) codes), use the JBCEMULATE environment variable when the programs are compiled, whereas the other definitions tend to be used at runtime, when the program is executed.

 

DEFINITION SYNTAXES

Variable Description Set At:
alternative_oconv = true|false If set then for the "DD" and "DM" output conversions, single digit results are prefixed by zero. Default for Sequoia. Run Time
dates_text = yes|no If "yes" then date conversions (e.g. "DM" and "DW") are in text format e.g. "March". Without this option, the case of the dates is dependent upon the operating system. Compile Time 
defer_header_output = true|false For compatibility with Ultimate to obviate the need to precede a HEADING expression with an attribute mark (3.4.6 and above) Run Time
dict_sub_call = yes|no On some emulations when calling a SUBROUTINE from a DICT item, a parameter will be passed to the SUBROUTINE which is the current item -- if this is the case, set this to "yes". Run Time
dot_not_numeric = true|false Set to true for compatibility with systems that expect  ".", "+" and "-" to be treated as non-numeric characters. Compile Time
dup = name Duplicate the definition "name". You can then add definitions using "xx=true" or remove definitions with "xx=false" to make subtle changes to the definition. N/A
ext_pattern_match = true|false Set to allow extended pattern matching. Compile Time
generic_pick = true|false The emulation will otherwise behave as if coming from a Pick environment. Compile Time1
generic_prime = true|false The emulation will otherwise behave as if coming from a Prime environment. Compile Time1
generic_reality = true|false The emulation will otherwise behave as if coming from a Reality Operating System environment. Compile Time1
generic_universe = true|false The emulation will otherwise behave as if coming from a Universe system that may in turn be emulating other environments. Compile Time1
generic_unidata The emulation will otherwise behave as if coming from a Unidata environment. Compile Time1
header_with_s = yes|no For systems (Sequoia) S-types with null "header" WILL use the default column heading. Run Time
iconv_nonnumeric_return_null = true|false If true then ICONV will return null instead of the original value when that value is non-numeric and numeric is expected. Run Time
invert_F_correl = yes|no Set this for systems (Reality) where the F correlative operates on the top stack elements in the reverse order to that expected for certain operators Run Time
itype_unquoted_numeric_literal = true|false Set for systems (Universe/Unidata ) where the 3rd and 4th parameters of the 'FIELD' function can be specified as an unquoted numeric. The unquoted numeric will be treated as a numeric literal in these cases, rather than an attribute reference. Run Time
jbase_field = yes|no For systems (jBASE and Prime) FIELD function will use the entire delimiter not just the first character. Run Time
jql_A_substring_literal For systems which assume unquoted numerics (inside substring extraction) should be treated as Numeric literals (NOT attribute references as expected by default). Run Time
jql_acalc_int_only Forces integer only arithmetic in calculations specified in A correlatives/conversions. Run Time
jql_divide_by_zero_zero = true|false When division by zero is attempted in jQL the value of the numerator is returned however, when this parameter is set (default for r91), zero is returned. Run Time
jql_mv_subcall = true|false If set then subroutines calls in jQL (B Correlatives) will be done for each multi-value processed; default is false. Run Time
jql_replace_semicolon = true|false For compatibility with systems that replace semi-colons with the surround character in a proc A command (3.4.6 and above) Run Time
jqlcommand_default_heading = true|false If set then the jQL command line is included in the default HEADING with page number, time and date. Set by default for PRIME emulation. Run Time
length_field_formatting = true|false If formatting preceeded by length field then manipulate format Compile Time
list_keys = yes|no If set then commands such as T-DUMP , T-LOAD , COPY will by default display all the record keys and use the (I) option to suppress this. Without this option then by default the reverse is true e.g. T-DUMP will not list any record keys but the (I) option show that record keys should be displayed Run Time2
locate_null_only_in_array = yes|no If set then a LOCATE for a null string will take the ELSE clause if the arguments for the target dynamic array specify a non-existent location. Run Time
long_who = yes|no If set the WHO command is extended to give the node name and Unix account name. Run Time
make_locate_dr_like_dn If set will cause the LOCATE statement to treat 'DR' or 'AR' (sort right justified) the same as 'DN' or 'AN' (sort numerically), in other words 'R' will sort numerically. This emulation option is effective on release 3.4. Compile Time
match_last_delimiter = true|false If set then a pattern match test will include a trailing multi-value as part of the test pattern. Run Time
multiple_cmd_execution = true | false Allows multiple commands in a dynamic array (one per attribute) to be executed with a single EXECUTE statement. Run Time
named_common = unassigned|null|zero Defines the initial state of named common. The default is unassigned. Run Time2
no_extra_delimiter = true|false Do not insert a system delimiter (AM, VM, SVM) when appending ( var<-1> etc.) to an attribute, multivalue or sub-multivalue which currently ends in the same system delimiter. Compile Time
no_id_prompt = true|false If set then commands which prompt for item ids when the item ids are not specified on the command line will assume all items are to be processed. This parameter is set by default for Sequoia. Run Time
no_value_maths = true | false If set to true then jBASE does not perform arithmetic on dynamic arrays. For example,
A = 3:@AM:7
A += 4
will fail with: "Invalid or uninitialized variable -- ZERO USED"
Run Time
nopage_null_header For systems which do NOT expect a pause at the end of Page when a Null HEADING is requested in jBC. The default behavior is to leave this flag unset. Run Time
null_eq_zero = yes|no For systems (Universe) right justified null fields will sort equal to zero. Run Time
oconv_date_to_non_numeric = true|false When set to true will cause date output conversions to use only up to the first non-numeric character of the source value. Default for Sequoia. Hang your head if your code relies on this. Run Time
oconv_no_mask_formatting = true|false If set then then oconv mask formatting is not applied to null and non-numeric values. Run Time
oconv_no_scale_formatting = true|false If set then the scaling factor is not applied for oconv formatting. Compile Time
openseq_creates = true|false The jBC OPENSEQ statement will create the specified file if it does not exist. This parameter is set by default for Sequoia. Run Time
page_0_header = yes|no For systems (Sequoia) PAGE 0 will clear any existing HEADINGs and FOOTINGs. Run Time
pq_backslash = true|false Forces null parameters in the proc input buffer to become backslashes when the Rn or Sn command is executed and 'n' causes an extension beyond the current input buffer. Default for Sequoia. Run Time
pq_indirection = yes|no If set then PQ procs can execute PQN proc commands (Universe). Run Time
preserve_default_list = yes|no If set then the default select list is preserved when executing commands which do not modify the default select list. Run Time
print_initial_formfeed = true|false Set by default under Ultimate emulation. Under normal circumstances the leading form feed, from a HEADER, is suppressed in PRINT'd output. This emulation mode causes a form feed to be PRINT'd at the start of each PRINT jobs.  
prt_video = yes|no Support the extensions mainly for printer definitions : @(-27) to @(-33) , @(-47) to @(-55) and @(-59) to @(-126) , and @(-220) through @(-239). Run Time 
quit_eq_end = true|false Quit (or Stop) from the debugger has the same effect as End or Abort, meaning any calling proc or paragraph is terminated. Run Time
read_reset_as_null = true | false Set the read variable to null when a READ fails. Run Time
readv0 = binary|dcount|key When a READV or READVU specifies zero (0) as the field to read, this setting defines what is returned in the read variable:
binary 0 if the record does not exist, 1 if the record exists
dcount the number of attributes in the record if the record exists
key the record key if the record exists
Run Time
reality_video = yes|no Support the Reality video extensions from @(-128) through @(-191) for video effects such as combinations of reverse, underline, flashing and so on. These can usually be added to all emulations without harmful effects. Run Time
reformat_append = yes|no By default the REFORMAT command overwrites existing attributes. With this set, then the REFORMAT command will append a multi-value to existing attributes. Run Time
report_bad_tapeblksz = yes|no Causes an error to be returned in SYSTEM(0) when attempting to write NULL data or more data than currently attached blocksize to tape. Run Time
resize_array = yes|no If set then re-dimensioning of arrays in jBC is permitted. Compile Time
returning_am_delimited = true|false If set then data returned from the RETURNING/SETTING clause of the EXECUTE statement will be attribute delimited. Otherwise the data will be value mark delimited. The default is true for Sequoia, otherwise false. Run Time
round_neg_tozero = true|false Round -0.5 to 0 instead of to -1. This does not affect 0.5. Run Time
scale_masked_string = true|false For systems (Reality) where formatted strings are descaled by the specified scaling factor. Compile Time
skip_pib_on_ip_null When IH is used with a single space then it will delete the current Proc Input Buffer (PIB) entry. Also, the U01AD user exit has been modified to skip modification of the Proc Input Buffer (PIB) if the source attribute is null.  Run Time
skip_spaces_and_tabs = true|false Ignore leading and trailing spaces and tabs in numeric expressions Run Time
sline_with_heading = yes|no For systems (Prime) specifying a heading in jQL will NOT suppress the "n Records listed." messages. Run Time
sp_assign_all = true|false When SP-ASSIGN is used without specifying a report channel number, this parameter when enabled will assign the specified print queue to all report channels, not just the default report channel. Run Time
substring_zero_eq_one = true|false If set then x[0,1]=variable is treated as x[1,1]=variable in jBC. Run Time
suppress_non_totalled = true|false If set then the display of non TOTALled columns is suppressed on BREAK lines when the DET-SUPP modifier is used with the jQL command. Run Time
system_19_timedate = true|false Programs compiled with this emulation set will cause SYSTEM(19) to return the internal time (seconds since midnight December 31st, 1967) rather than the account name. Run Time
tconv_no_replace = yes|no By default the T conversion in OCONV will replace system delimiters. This causes the effect not to happen. Run Time
time_is_hours = yes|no For systems (Reality and Sequoia) ICONV(1,"MTS") will return 3600 (not 60). Run Time
unnamed_common = unassigned|null|zero Defines the initial state of unnamed common. The default is unassigned. Run Time
use_id_lptr_reporting = yes|no If set then the dictionary item @ is used for "default output" with jQL LIST and SORT when no other output criteria is specified. The dictionary item @LPTR is used if the report is directed to a printer. If not set, then default output is generating by using dictionary items with sequentially numbered item ids starting at 1. Run Time
ux1ad_use_four_digits = yes|no If set user exits U11AD, U21AD and U31AD will use four digit rather than two digit numbers. i.e. nnnnP vs nnP Run Time
wrap_r_just = yes|no For systems (Universe and Prime) right justified data will wrap in jQL. Run Time
write_default_list = yes|no Allows the default select-list to be available as the active select-list in a jBC program. Useful for retaining SYSTEM(11) when doing things like FORMLIST or SELECTINDEX. (Available in 3.4.4) Run Time
Notes:
1 Note that some of the "generic" emulation behavior will change at run-time, but for a complete change, the code should be recompiled.
2 Despite being set at Run-time, if running from jshell, requires that a new jshell be invoked before the behavior will change.

On many platforms, @(-n) codes are used to control special terminal characteristics. However the definition of these codes differs between platforms. Rather than "hard coding" the @(-n) codes, jBASE allows their definition the Config_EMULATE file. This allows legacy applications to use existing @(-n) codes and so reduces the time required to port an application to jBASE. A knowledge of terminfo capabilities can be useful when defining these codes.

@(-n) clear_screen Move cursor to position 0,0 and clear to end of screen
@(-n) cursor_home Move cursor to position 0,0
@(-n) clear_eos Clear the screen from current position to end of screen
@(-n) clear_eol Clear the screen from current position to end of line
@(-n) blink_on Turn on blinking video
@(-n) blink_off Turn off blinking video
@(-n) prot_on Turn on protected fields
@(-n) prot_off Turn off protected fields
@(-n) reverse_on Turn on reverse video
@(-n) reverse_off Turn off reverse video
@(-n) underline_on Turn on underline video
@(-n) underline_off Turn off underline video
@(-n) bold_on Turn on bold video
@(-n) bold_off Turn off bold video
@(-n) printer_on Turn on the slave printer
@(-n) printer_off Turn off the slave printer
@(-n) print_screen Dump the entire screen to the printer
@(-n) status_line_on Turn the line 25 status line on
@(-n) status_line_off Turn the line 25 status line off
@(-n) cursor_down Move the cursor down one position
@(-n) cursor_up Move the cursor up one position
@(-n) cursor_right Move the cursor one position to the right
@(-n) cursor_left Move the cursor one position to the left
@(-n) cursor_on Turn the visible cursor on
@(-n) cursor_off Turn the visible cursor off
@(-n) delete_line Delete a single line
@(-n) insert_line Insert a single line
@(-n) scroll_forward Scroll the screen display up one line
@(-n) scroll_backward Scroll the screen display down one line
@(-n) delete_char Delete a single character at present cursor position
@(-n) insert_char Insert a blank character at present cursor position
@(-n) insert_on Begin insert mode
@(-n) insert_off End insert mode
@(-n) effects_off Turns off ALL the video effects
@(-n) graphics_on Turn on the alternate character set
@(-n) graphics_off Turn off the alternate character set
@(-n) graphics_vertical In graphics mode a vertical bar
@(-n) graphics_horizontal In graphics mode a horizontal bar
@(-n) graphics_upper_left In graphics mode a top left hand corner
@(-n) graphics_upper_right In graphics mode a top right hand corner
@(-n) graphics_bottom_left In graphics mode a bottom left hand corner
@(-n) graphics_bottom_right In graphics mode a bottom right hand corner
@(-n) graphics_intersection In graphics mode + intersection character
@(-n) graphics_tee_left In graphics mode a left hand tee character
@(-n) graphics_tee_right In graphics mode a right hand tee character
@(-n) graphics_tee_up In graphics mode a top tee character
@(-n) graphics_tee_down In graphics mode a bottom tee character
@(-n) background colorname Set the background to one of the supported colors , where "colorname" is one of: black , blue , green , cyan, read , magenta , yellow , white
@(-n) foreground colorname Set the foreground to one of the supported colors , where "colorname" is one of: black , blue , green, cyan , read , magenta , yellow , white

Porting