The config.bbx Configuration File - BBj
For this topic's original documentation, see The config.bbx Configuration File.
BBj-Specific Information
Locating the Configuration File
BBj goes through the following steps to locate the configuration file:
-
If the -cpath/file option is used in the command line (see Invoking BBj, Command Line Options), BBj will try only path/file.
-
If an environment variable BBCONFIG=path/file exists, BBj will try only path/file.
-
Finally, if neither the -c option nor an environment variable BBCONFIG is set, BBj will try to locate config.bbx in the current directory and then in the ../cfg directory. Note that BBj is usually run from the <bbj>/bin directory, therefore the .. translates to <bbj>/cfg directory.
FCBCACHE
FCBCACHE does not affect the behavior of an OPEN in BBj if the filename given is not a fully qualified path and if a similarly named file exists in the cache.
PRECISION
In BBj 9.00 and higher, the following applies:
Option/Syntax | Description | Default |
---|---|---|
PRECISION[=]int[,int] | Default precision. The second integer, if specified, determines the cutoff point, in digits, at which BBj will display numbers in scientific notation. | 2, 16 |
USE
In BBj 17.00 and higher, USE directives, specified exactly like the USE verb, define items to be scanned by the type system when attempting to resolve unqualified type references. At runtime, this list is checked after checking USE verbs in the program itself, and after scanning the program for BBj custom classes.
Option/Syntax |
Description |
---|---|
USE java.class.name | The complete name of a Java class, including the full package name (e.g. java.util.HashMap). |
USE ::filename::bbjclassname |
The filename portion is the path to a file that contains the BBj Custom Object class definition. BBj locates this file using its normal file resolution procedures, checking the current working directory and prefix. The bbjclassname portion is the name of a BBj Custom Object class defined in the specified file. |
Serial Device Aliases
Serial devices, only supported on Linux and Windows ports, must be aliased in the config.bbx file. The first character for the aliased device must start with a "C", and the list of modes is as follows:
baud=integer, mode=5|6|7|8 + E|O|N|M+ 1|2 dsr | -dsr, cts | -cts, xon | -xon, xoff | -xoff, xon/xoff | -xon/xoff
For example:
ALIAS C1 COM1 "comport1" BAUD=9600,MODE=8N1,XON/XOFF
Mode String Substitution
Prior to BBj 4.01, the variables on command lines for pipes expanded before running the actual pipe command. This allowed the substitution of an empty string for variables not defined in the environment. When a command in the pipe changes a variable, subsequent commands do not recognize the change because the substitution for the variables occurred before it executed the pipe.
In BBj 4.01 and higher, there are no substitutions from the environment for any variables on the pipe's command line. Instead, BBjServices pass the current environment to the Runtime.exec() command. This allows the various commands in the pipe to expand (and/or change) the variables, however, it removes the side effect of defining undefined variables as empty strings. To force the variable to expand before executing the pipe command, use a MODE setting to set the variable.
BUI MINI Console
Business BASIC started as a development environment for character-oriented applications, originally on 80x24 dumb terminals (TermConsole), then later on graphics-oriented devices (SysConsole/SysWindow). A character-oriented device is central to the language structure. It's assumed that there is always a character-oriented device available on channel 0; I/O verbs like PRINT and INPUT that don't explicitly specify a channel are assumed to refer to this character-oriented console. The BUI client has a different focus; it's a browser-based implementation of the BBx SYSGUI. BUI implements a very minimal channel 0 console with no mnemonic support at all. This "mini console" is oriented towards extremely basic debugging, not for deployment of end-user applications. It supports the PRINT and INPUT verbs; the expectation is that it will be used to print simple debug messages during program development. The default MiniConsole allocates a minimal 80x24 buffer, and only becomes visible if the program drops to console (an action that is itself disabled by default). The config.bbx file can include BUI MINI console terminal aliases, which must start with "T", and which can be specified in the BUI application configuration. These aliases support just a few basic configuration settings, ROWS= and COLS= to define a larger buffer, VISIBLE to make the console visible right away (the default is INVISIBLE), and FLOAT to make the console a floating window, as opposed to the default, docked to the top of the browser.
For example:
ALIAS TMINI MINI "Debug console" ROWS=255,COLS=255,VISIBLE,FLOAT