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.
You can create your own custom emulation sections in the Config_EMULATE file but it is recommended to use Alternate Emulations for this purpose.
An Alternate Emulation has the general form:
where name is the name of the emulation. These emulations are also stored in the config directory under $JBCRELEASEDIR. and follow the exact same rules. The file name of the alternate emulation must be the same as the label, i.e. the x: line.
Alternate Emulations can contain any combination of configuration options except dup entries. If you require the behavior of a dup entry then all configuration settings in that section must be explicitly added to the Alternate Emulation.
For example, to create an alternate jbase emulation called jcustom,which changes the value of the old_jql_output_style setting, would be:
File name: Config_EMULATE_jcustom jcustom: @(-1) = clear_screen ; @(-2) = cursor_home ; @(-3) = clear_eos ; @(-4) = clear_eol @(-5) = blink_on ; @(-6) = blink_off @(-7) = prot_on ; @(-8) = prot_off ; @(-9) = cursor_left ; @(-10) = cursor_up ; @(-20) = cursor_down ; @(-19) = cursor_right @(-13) = reverse_on ; @(-14) = reverse_off @(-15) = underline_on ; @(-16) = underline_off @(-17) = printer_on ; @(-18) = printer_off @(-33) = background white ; @(-34) = background yellow ; @(-35) = background magenta ; @(-36) = background red @(-37) = background cyan ; @(-38) = background green ; @(-39) = background blue ; @(-40) = background black @(-41) = foreground white ; @(-42) = foreground yellow ; @(-43) = foreground magenta ; @(-44) = foreground red @(-45) = foreground cyan ; @(-46) = foreground green ; @(-47) = foreground blue ; @(-48) = foreground black @(-57) = foreground white ; @(-58) = foreground yellow ; @(-59) = foreground magenta ; @(-60) = foreground red @(-61) = foreground cyan ; @(-62) = foreground green ; @(-63) = foreground blue ; @(-64) = foreground black @(-200) = cursor_on , @(-201) = cursor_off list_keys = true reality_video = true jbase_field = true named_common = null readv0 = key treat_with_as_or_with = true dates_upper_case = yes use_sql_syntax_for_select = false old_jql_output_style = true itype_trans_replace_delim = false itype_unquoted_numeric_literal = true enter_keeps_common_data = false error_numbers_are_single_attribute = false
To use this definition, set the JBCEMULATE environment variable to jcustom, e.g.
export JBCEMULATE=jcustom [Linux] set JBCEMULATE=jcustom [Windows]
Note that you can't use the dup option with alternate emulations. In other words, you can't do something like this:
jcustom: dup = jbase old_jql_output_style = true
You must expand all of the entries explicitly.
allow_bad_day_of_month = true|false
If set, allows invalid date conversions like 31 Sep to convert to valid dates (1st Oct).
allow_unassigned_assignment = true|false
Suppress "UNASSIGNED VARIABLE" message where "X=Y" and Y has not been assigned.
alternate_chain_exit = true|false
If set then under certain circumstances drops an extra run level on returning from a CHAIN command. This is an emulation of jBASE 3.4 behaviour. Current behaviour is believed to be preferable. Only set this if necessary for backwards compatibility.
alternative_oconv = true|false
If set then for the "DD" and "DM" output conversions, single digit results are prefixed by zero. Default for Sequoia.
breakon_l_suppresses_blank_line = true|false
If set then "L" in a "BREAK-ON" clause means suppress the blank line before the data line. The default is to skip the break line, i.e. only output a blank line.
byexp_mv_dup_like_d3 = true|false
If set, when using BY-EXP, reuse the first, and only, value in single valued attributes. The default behaviour, i.e. with "byexp_mv_dup_like_d3" unset or false, is to assume a null value for the 2nd and subsequent values. Currently, this option is not set under any emulation in the "Config_EMULATE" file supplied with the jBASE Installation.
case_insensitive_file_ids = true|false
If set, try and ignore the case of file names, default behaviour will be to open the first UPPER CASE version of the file name.
case_insensitive_md = true|false
If set, the MD does not care about case, everything should end up as UPCASE.
case_insensitive_queries = true|false
If set, verbs used in jQL queries and dictionaries ignore case.
case_insensitive_runtime_strings = true|false
If set, any jBASE functions which accept a VAR as a parameter will UPCASE it.
compiler_case_insensitive_subroutines = true|false
If set, all SUBROUTINE names are case insensitive.
compiler_case_insensitive_variables_keywords = true|false
If set, the compiler ignores the case on variable names and keywords. [Not currently implemented]
chk_typeahead_on_inputminus = true|false
If set then check for typeahead when INPUT x,-1 syntax is used.
conv_mct_uv_compat = true|false
Universe compatible capitalisation after non-alpha characters.
conv_old_mct = true|false
Capitalise character following non-alpha character, e.g. "-" (hyphen).
dates_upper_case = yes|no
If "yes" then date conversions (e.g. "DM" and "DW") force the text to uppercase format, e.g. "March" is forced to "MARCH". Without this option, the casing for dates is dependent upon the operating system.
defer_header_output = true|false
Set by default under Ultimate emulation. Any Basic HEADER will be output at the next natural page break. Normally the HEADER is issued immediately. The output of the HEADER can also be deferred, to the next natural page break, by prefixing the HEADER data with an Attribute Mark (@AM).
dict_sub_call = true|false
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 "true".
dot_not_numeric = true|false
Set to true for compatibility with systems that expect ".", "+" and "-" to be treated as non-numeric characters.
dup = name
Duplicates the definition "name", where "name:" is a previously defined "label:", i.e. this "definition" inherits the behaviour defined for "name:", "option" settings following a "dup" override the inherited behaviour for that "option".
enter_keeps_common_data = true|false
Set if you want the ENTER statement to retain global common when "(I" option is used.
error_numbers_are_single_attribute = true|false
If set, check that the first value is a number, if so use it as the error message, (i.e., return 401 instead of 401]QLSELNO) (Could be problematic).
ext_pattern_match = true|false
For systems which use extended pattern matching.
format_defaults_no_decimals = true|false
If set, a format mask that does not specify decimal places will not output any decimals. Default is to output all decimal places.
generic_pick = true|false
The emulation will otherwise behave as if coming from a Pick environment.
generic_prime = true|false
The emulation will otherwise behave as if coming from a Prime environment.
generic_reality = true|false
The emulation will otherwise behave as if coming from a Reality Operating System environment.
generic_universe = true|false
The emulation will otherwise behave as if coming from a Universe system.
The emulation will otherwise behave as if coming from a Unidata environment.
header_with_s = yes|no
For systems (Sequoia) S-types with null "header" WILL use the default column heading.
hush_input_and_output = true|false
If set then control both input and output on HUSH.
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.
insert_default_zero_to_one = true|false
If set, treat a param value of zero as one for INSERT function.
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
itype_trans_replace_delim = true|false
Set to replace delimiters with spaces in the TRANS() function ( ITYPES only ).
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.
jbase_field = yes|no
For systems (jBASE and Prime), FIELD function will use the entire delimiter not just the first character.
jpqn_replace_semicolon = true|false
Set by default under Ultimate emulation. When moving data from the Input buffer to the Primary Output buffer using the A command in PQN Procs, any semicolons are replaced with specified delimiter, e.g. : A' changes abc;def;xyz to abc"def"xyz.
For systems (as yet unknown) which assume unquoted numerics (inside substring extraction) should be treated as Numeric literals (NOT attribute references as expected by default).
Set for systems (Reality, R83, Universe) where integer only arithmetic is performed in calculations within "A;" correlatives/conversions.
jql_divide_by_zero_zero = true|false
For systems (R91), division by zero in conversions/correlatives will return zero. (The default behaviour is to return the numerator unchanged).
jql_mv_subcall = true|false
For systems (Sequoia) the user subroutine will be called for each multivalue and subvalue in data being processed by jQL. Default is false
length_field_formatting = true|false
For systems that preceed formatting with a length field.
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 indicates that record keys should be displayed
locate_null_only_in_array = yes|no
Set for systems requiring null to only match within the real array, not the implied array, e.g. : FIND "" IN "abc" will return 'true' under the default mode.
long_who = yes|no
If set, the WHO command is extended to give the node name and UNIX account name.
log_runtime_errors = true|false
If true, runtime errors such as divide by zero are logged in the $JBCRELEASEDIR/runtime-errors directory, assuming the error message in $JBCRELEASEDIR/jbcmessages contains the string ^LOGERRORS^.
make_locate_dr_like_dn = true|false
Set for systems requiring the DR of the LOCATE statement to act like DN.
match_last_delimiter = true|false
If set to 'true' then the last delimiter in pattern match string is used within the pattern to match, e.g.: "a]b]c]" will match "c]".
matread_assigns_to_end = true | false
Additional attributes are appended to the last element of a DIMensioned array by 'MATREAD'. By default additional attributes are returned in element '0' of the DIMensioned array. Set 'true' under Sequoia emulation. [Runtime]
md_int_only = true | false
If set, only integers will be allowed in MD or MR conversions. If a decimal number is used then it will be treated as non-numeric, returning the original value, e.g. OCONV(12.99,'MD2') returns '12.99' instead of '0.13' .
multiple_cmd_execution = true | false
For systems that allow execution of multiple commands if provided as a dynamic array to 'PERFORM'/'EXECUTE' statements.
named_common = unassigned|null|zero
Indicates how to set named common when first referenced. Default is unassigned.
no_equate_on_call = true | false
If set, inhibit the Equate processing on the 'Subroutine' name specified in CALL statements but not CALL @ statements.
no_extra_delimiter = true|false
For systems ( currently Sequoia and R83 ) which do not insert a delimiter (AM/VM/SVM) if the current string being appended to ( by specifying '-1' as the parameter to append/insert before ) has a 'trailing' delimiter (AM/VM/SVM ) already. This behaviour is true for all of :
no_id_prompt = true|false
For systems (Sequoia) which do NOT 'prompt for ids' when using 'QSELECT' (for example) and no items are specified. If 'no_id_prompt' is set do NOT 'prompt' for the item ids but assume '*' (i.e. ALL items) are required.
no_value_maths = true|false
If set to 'true' then jBASE will NOT perform automatic multi-value maths on a non-numeric string, e.g. : A = "12":@AM:"3" + 1 will fail with a 'NON_NUMERIC' error.
nopage_null_header = true|false
For systems (as yet unknown) which do NOT expect a pause at the end of Page when a Null HEADING is requested in Basic. The default behaviour is to leave this 'flag' unset.
null_eq_zero = true|false
For systems (Universe) right justified null fields will sort equal to zero.
oconv_format_null = true|false
For systems whose OCONV functions force formatting of null values.
oconv_no_mask_formatting = true|false
For systems that do not use OCONV mask formatting when value is null or nonnumeric.
oconv_no_scale_formatting = true|false
For systems that do not using a scaling factor by default for OCONV formatting.
old_jql_output_style = true|false
If set then the number of spaces between columns, for the jQL LIST and SORT commands, is always 1.
If not set then jQL adjusts the spacing between columns depending on the number of columns and the width setting of the TERM command. The maximum number of spaces between columns is 4.
This option is only effective when the jQL display is in columnar format.
openseq_creates = true|false
When set, the jBC OPENSEQ statement will create the specified file if it does not exist. This parameter is set by default for Sequoia.
page_0_header = true|false
For systems (Sequoia) PAGE 0 will clear any existing HEADINGs and FOOTINGs.
para_stacked_data = true|false
Set by default under Unidata emulation.
pq_Aquote_prepends_space = true|false
( Currently not enabled under any emulation by default).
pq_backslash = true|false
If set, PQ procs will use backslash delimiters when extending past the end of input buffer with Sn or Rin. Default for Sequoia.
pq_indirection = true|false
If set then PQ procs can execute PQN proc commands (Universe).
prime_runtime_errors = true|false
'ZERO_USED' , 'DIVIDE_ZERO' and 'NON_NUMERIC' errors generate message ids appended with '_PRIME', eg 'ZERO_USED_PRIME' , 'DIVIDE_ZERO_PRIME' and 'NON_NUMERIC_PRIME' etc.
print_initial_formfeed = true|false
Set by default under Ultimate emulation.
prt_video = true|false
Support the following extensions, mainly for printer definitions : @(-27) to @(-33) , @(-47) to @(-55) and @(-59) to @(-126) , and @(-220) through @(-239).
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.
read_reset_as_null = true|false
For systems which, when a read fails, reset the read variable to a null string.
readnext_dont_null_last_key_on_eof = true|false
If set, then retain the value of the last key on a READNEXT instead of setting it to NULL when EOF is reached.
readv0 = binary|dcount|key
When a READV (or READVU) is performed and attribute 0 is specified, this defines what to return:
reality_video = true|false
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.
reformat_append = true|false
By default the REFORMAT command overwrites existing attributes. With this set, then the REFORMAT command will append a multi-value to existing attributes.
report_bad_tapeblksz = true|false
Attempting to write a 'NULL' tape block or a block which is larger than the attached tape block size will return the appropiate error code in SYSTEM(0).
resize_array = true|false
If true then the re-DIMensioning of arrays is permitted. Set to 'true' under 'Universe', 'Prime', 'Unidata' and 'Ultimate' emulations.
returning_am_delimited = true|false
If set then data returned from the RETURNING/SETTING clause of the EXECUTE statement will be attribute mark delimited. Otherwise the data will be value mark delimited.
round_neg_tozero = true|false
Round -0.5 to 0 instead of to -1. This does not affect 0.5.
scale_masked_string = true|false
For systems (Reality) where formatted strings are descaled by the specified scaling factor, e.g.:
selected_count_not_binary = true|false
SYSTEM(11), which returns the status of the default select list will, by default, return 1 if a default select list is present, or 0 if no default select list is present. If this option is set, 'SYSTEM(11)' returns the number of items in the default select list.
single_space_timedate = true|false
The TIMEDATE() function uses a single space separator (default is two spaces).
skip_pib_on_ip_null = true|false
If set, leave PIB unchanged when null entered at IP command in PQ proc.
skip_spaces_and_tabs = true|false
For systems which ignore leading and trailing spaces when handling values for maths.
sline_with_heading = true|false
For systems (Prime), specifying a heading in jQL will NOT suppress the "n Records listed." messages.
For systems (Reality), where SP-ASSIGN without a 'channel' number will assign the specified form to ALL 'channels'. By default SP-ASSIGN without a specified 'channel' number only assigns to 'channel 0 (zero).
spooler4_only_recent_jobs = true|false
Set by default under Reality emulation.
stacked_input_global = true|false
Set if the DATA stack operates globally or traditionally i.e. : determines whether 'unused' stacked DATA is still available on return from 'EXECUTE'.
substring_zero_eq_one = true|false
For systems (Reality) which treat a starting position of '0' as '1' in substring assignment, e.g. : x[0,1] = bla is equivalent to x[1,1] = bla.
system_19_timedate = true|false
SYSTEM(19) will return a unique 'date + time' stamp, e.g. '1103361234' when compiled under this emulation, (rather than the 'account name'). (Sequoia emulation).
tconv_no_replace = true|false
By default the T conversion in OCONV will replace system delimiters. This causes that effect not to happen.
time_is_hours = true|false
For systems (Reality and Sequoia) ICONV(1,"MTS") will return 3600 (not 60).
treat_with_as_and_with = true|false
If set treat jQL WITH <Clause> WITH <Clause> as AND WITH - default is OR WITH.
treat_with_as_or_with = true|false
If set treat jQL WITH <Clause> WITH <Clause> as OR WITH - [ this is the default behaviour].
unnamed_common = unassigned|null|zero
Indicates how to set un-named common when first referenced. Same as 'named_common'.
use_id_lptr_reporting = true|false
For systems (Prime) that use @ID and @LPTR for default listings.
use_sql_syntax_for_select = true|false
Use SQL syntax in SELECT commands.
use_uv_locate = true|false
When set to 'true', use the Universe syntax for the Basic 'LOCATE' function, i.e. 'search string' and 'array to search' parameters are interposed.
ux1ad_use_four_digits = true|false
If set, user exits U11AD, U21AD and U31AD will generate four digit rather than two digit numbers. i.e. nnnnP vs nnP
wrap_r_just = true|false
For systems (Universe and Prime), right justified data will wrap in jQL.
writelist_on_select_from_var = true|false
If set then write any select list, generated by basic "SELECT Var" to the default select list.
some of the "generic" emulation behavior will change at run-time, but for a complete change, the code should be recompiled.
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 in 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.
Move cursor to position 0,0 and clear to end of screen
Move cursor to position 0,0
Clear the screen from current position to end of screen
Clear the screen from current position to end of line
Turn on blinking video
Turn off blinking video
Turn on protected fields
Turn off protected fields
Turn on reverse video
Turn off reverse video
Turn on underline video
Turn off underline video
Turn on bold video
Turn off bold video
Turn on the slave printer
Turn off the slave printer
Dump the entire screen to the printer
Turn the line 25 status line on
Turn the line 25 status line off
Move the cursor down one position
Move the cursor up one position
Move the cursor one position to the right
Move the cursor one position to the left
Turn the visible cursor on
Turn the visible cursor off
Delete a single line
Insert a single line
Scroll the screen display up one line
Scroll the screen display down one line
Delete a single character at present cursor position
Insert a blank character at present cursor position
Begin insert mode
End insert mode
Turns off ALL the video effects
Turn on the alternate character set
Turn off the alternate character set
In graphics mode a vertical bar
In graphics mode a horizontal bar
In graphics mode a top left hand corner
In graphics mode a top right hand corner
In graphics mode a bottom left hand corner
In graphics mode a bottom right hand corner
In graphics mode + intersection character
In graphics mode a left hand tee character
In graphics mode a right hand tee character
In graphics mode a top tee character
In graphics mode a bottom tee character
Set the background to one of the supported colors , where "colorname" is one of: black , blue , green , cyan, red , magenta , yellow , white
Set the foreground to one of the supported colors , where "colorname" is one of: black , blue , green, cyan , red , magenta , yellow , white