# 'BX' BBx Emulation

> Source: https://manual.pvxplus.com/parameters/bx

## Description

Sets the system to BBx® emulation mode.

Setting or resetting this parameter will affect a variety of other system parameters to establish an environment that is fundamentally compatible with running programs designed for BBx®.

The system parameters affected by setting the 'BX' system parameter are as follows:

|  |  |  |
| --- | --- | --- |
| **Parameter** | **Setting** | **Effect** |
| **['AD'](https://manual.pvxplus.com/parameters/ad)** | On | Indicates that the system should auto-dimension arrays when used in assignments and the array size can be determined due to usage. |
| **['B0'](https://manual.pvxplus.com/parameters/b0)** | On | Sets the base number to one for level and window identifiers. |
| **['BT'](https://manual.pvxplus.com/parameters/bt)** | On | Sets binary test for serial files on first read. If a size is indicated (**ISZ**=*option*), then the file is treated as binary. Otherwise, the file is treated as record-oriented. |
| **['BY'](https://manual.pvxplus.com/parameters/by)** | =0 | This parameter defines the base year for the [JUL( )](https://manual.pvxplus.com/functions/jul) and [DTE( )](https://manual.pvxplus.com/functions/dte) functions. By setting this parameter to zero, the **JUL( )** and **DTE( )** functions operate under the Julian calendar where day 0 is around ***4713 BC***. |
| **['CD'](https://manual.pvxplus.com/parameters/cd)** | On | Checks the current directory first before checking the prefix list for a file. |
| **['DC'](https://manual.pvxplus.com/parameters/dc)** | On | Sets destructive cursor. (Moving from left to right replaces intervening characters with spaces up to the new cursor position). |
| **['EX'](https://manual.pvxplus.com/parameters/ex)** | On | Sets **[EXECUTE](https://manual.pvxplus.com/directives/execute)** directive to affect the program at level 0, thus commands that would alter the program contents will alter the program at the top level of the execution stack. |
| **['FF'](https://manual.pvxplus.com/parameters/ff)** | =3 | Defines the format of information returned by the **[FID( )](https://manual.pvxplus.com/functions/fid)** function to return a BBx® style format. |
| **['I0'](https://manual.pvxplus.com/parameters/i0)** | On | Allows the program to access substring (0,0) of an empty string without generating an error. Normally, accessing offset 0 of a string will result in an Error #47. |
| **['KR'](https://manual.pvxplus.com/parameters/kr)** | On | Special Keyed file I/O module for BBx® emulation mode.  <br>  <br>When ***On***, the [KEP( )](https://manual.pvxplus.com/functions/kep) function returns the key of the record just read instead of the key of the record prior the record just read. In addition, specifying KNO= on any of the **[KEY( )](https://manual.pvxplus.com/functions/key)** functions will ***not*** switch key numbers; only the KNO= on a READ will switch the current key number. |
| **['MP'](https://manual.pvxplus.com/parameters/mp)** | On | To have the **[MOD( )](https://manual.pvxplus.com/functions/mod)** function always return a positive number, even when dealing with negative numbers. |
| **['NR'](https://manual.pvxplus.com/parameters/nr)** | On | Prevents intermediate rounding on division. (This only affects division, not other operations such as multiplication.) |
| **['OP'](https://manual.pvxplus.com/parameters/op)** | On | Sets the **[PGM( )](https://manual.pvxplus.com/functions/pgm)** function to return the original program name as opposed to the resolved program pathname. |
| **['QS'](https://manual.pvxplus.com/parameters/qs)** | On | When a **[START](https://manual.pvxplus.com/directives/start)** command includes the name of a program to run, the system will effectively only execute a **[BEGIN](https://manual.pvxplus.com/directives/begin)** and then **[RUN](https://manual.pvxplus.com/directives/run)** the program specified. |
| **['RS'](https://manual.pvxplus.com/parameters/rs)** | On | Enables automatic rounding of numeric data when processed by the **[STR( )](https://manual.pvxplus.com/functions/str)** function. |
| **['WK'](https://manual.pvxplus.com/parameters/wk)** | On | Prevents **['WINDOW'](https://manual.pvxplus.com/mnemonics/window)** and **['DIALOGUE'](https://manual.pvxplus.com/mnemonics/dialogue)** boxes from being automatically dropped when you use a **[BEGIN](https://manual.pvxplus.com/directives/begin)** (or **[END](https://manual.pvxplus.com/directives/end)** in Command mode) or a **[CLOSE](https://manual.pvxplus.com/directives/close)**. |
| **['XF'](https://manual.pvxplus.com/parameters/xf)** | On | Sets extended file mode where the channels range from 1 - 32767 for local files and 32768 - 65000 for global files. |

In addition to the above, the following logic changes are controlled by the setting of the 'BX' system parameter:

- The **['TR'](https://manual.pvxplus.com/mnemonics/tr)** mnemonic will return information from location 0,0 to the current location instead of the full screen.
- The size specified on the START command and returned by TCB(15) will be in 256 byte logical pages.
- The **[ADDR](https://manual.pvxplus.com/directives/addr)** directive will return an error if the used against a program that has already been ADDR'ed.
- The value returned by the **[TIM](https://manual.pvxplus.com/variables/tim)** system variable will be rounded to the current precision.
- The system will return an error if attempting to issue a 'DROP' or 'POP' against the primary window.
- The **[WRITE](https://manual.pvxplus.com/directives/write)** directive will ignore the KEY= option when used against a file that does not have an external key. (This functionality was added in PxPlus v6.30.)

## Default

***Off*** - PxPlus is in standard mode.

BBx® is a registered trademark of BASIS International Ltd.
