Main Menu

KB#00321-Manual: SETOPTS function

Title:

Manual: SETOPTS function

Description:

SETOPTS (v) 

Syntax: 
SETOPTS string 

Purpose: 
SETOPTS is used to place BBx into non-standard modes of operation. BBx internally keeps a string called the options vector. Different bytes and bits within the options vector may be set to enable various optional modes. The current value of the options vector may be accessed with the OP TS function. The length of the options vector is initially implemented as 16 bytes. Future releases of BBx may expand, but will never shorten, this length. SETOPTS is not shared between tasks and is not affected by BEGIN, RESET, CLEAR or START. The string argument for SETOPTS may be any leng th not exceeding the size of the options vector. If string is shorter than the options vector, then the remaining bytes in the options vector are unchanged. The following bits are currently recognized: 

Byte Bit Meaning 

1 $80$          When this bit is set, BBx will issue an !ERROR=63 anytime a variable is referenced that has not been explicitly assigned a value. Because BBx provides both long variable names and default values, it is easy to misspell a variable and not know it until it is too late. Setting this bit while developing and testing software will help control this problem. This bit will not be useful for any programs that depend on default values. 

1 $40$ This bit, when set, will turn off all error traps. This may help when debugging an application that has already been made user-proof. 

1 $20$ When set, this bit places the EDIT window in insert mode. 

1 $10$ When set, this bit disables the pause feature of LIST and DUMP. 

1 $08$ This bit enables console mode and debugging in public programs. If not set, an attempt to enter console mode from a public program will result in an error. When set, it may also enable other language features. For more information on public programs, see the Program and Workspace Management section of Chapter 1. 

1 $02$ If this bit is set, program listings using the LST() function or LIST command will appear with the variable names in lower case. 

1 $01$ Setting this bit will cause the output of the LST() function and LIST command to have lower case commands and keywords. 

2 $80$ This bit will cause a non-destructive cursor advance when using the @(X) column positioning mnemonic. Normally, when using column positioning to advance the cursor on the current line of a terminal screen, BBx will use spaces, causing existing characters to be overwritt en. Many existing applications depend on this while others will fail depending on which Business BASIC the application came from. 

2 $40$ When set, this bit causes BBx to output a line feed on a PRINT statement that has no iolist. The rules say that a line feed is output only at the end of a field; therefore, a simple PRINT statement would do nothing. However, some Business BASIC's make an exception for a PRINT statement with no iolist; therefore, some older applications may depend on this. 

2 $20$ This bit will cause numeric rounding of intermediate results immediately after multiplication, division, and exponentiation. See Rounding in the Language Concepts section of Chapter 1 for the official BBx rules for rounding. This should be used only in older applications programs that may be sensitive to rounding methods. 

2 $10$ This bit will cause embedded spaces to be stripped from the string argument to the NUM function. For example, NUM( 1 2 3 ) would normally return an error, because its argument does not meet the rules for numeric constants. Some older Business BASIC's do allow the embed ded spa- ces. Application programs that depend on there being no embedded spaces, should set this bit. 

2 $08$ Setting this bit causes BBx to ignore mask overflows in PRINT, WRITE, and STR(), otherwise an !ERROR=43 is issued when a numeric value exceeds a format mask. When this bit is set, BBx will simply output the number without a format. 


2 $04$ This bit will cause BBx to reject WRITEs to a DIRECT or MKEYED file (in single key mode) or to an unEXTRACTed record when the WRITE does not specify a key. MKEYED files being used in multi-key mode contain the key specification in the data record and thus always contain a key clause. This bit is for compatibility with other Business BASIC's. 

2 $02$ Setting this bit will cause BBx to disable math coprocessor use. On machines with math coprocessors, BBx may be able to use the coprocessor to enhance the speed and accuracy of the SIN(), COS(), ATN(), SQR(), and LOG() functions, as well as the exponentiation (^) operat or. The exact speed and accuracy depend on the type of coprocessor used, so the results of identical computations may not be identical, to the very last decimal place, on all platforms supporting BBx. Applications requiring the results of these functions to be exactly the same on all machines should set this bit. 

2 $01$ While this bit is set, BBx attempts to force MS-DOS to update the length of an dynamic file such as an MKEYED file after any growth in the file. 

3 $80$ This bit will allow program loading (RUN, LOAD) from the public program space (ADDR). Because a significant amount of the time to perform a normal LOAD or RUN is used by the host operating system, this option substantially reduces the time required to overlay the worksp ace program. 

3 $40$ This bit tells BBx to use advisory locking in data files. When BBx is using advisory locking, an EXTRACT will block another EXTRACT or REMOVE, and a READ operation will be allowed to access data EXTRACTed by another user. After enabling this bit on all terminals, you s hould test this capability by attempting to read and write a record extracted by another process. Special conditions exist for advisory locking on Novell systems. See the Installation and Configuration Guide for details. 


3 $20$ This bit allows multiple read processes to access the key region of a keyed file while blocking write processes. The cost is that a system might have enough read operations that a write operation would never gain exclusive access to the file. This is affected by the ty pe of locks the system uses and the locking technique used by the host operating system. In addition, this feature may not be available, and may not have a positive impact on performance. Special conditions exist for advisory locking on Novell systems. See the Installation and Configuration Guide for details. 

3 $10$ This bit may be set if your operating system supports only advisory locking. Setting this bit can improve overall file reading operations, especially in conjunction the $40$ advisory locking bit described above. 

3 $08$ This bit may be set in a production environment where the reliability of the data storage is proven. It will disable the hash check of a program on the loading of that program. BBx uses the hash check to be sure that the program loaded is the same as that saved. If the program has been corrupted in storage, the setting of this bit will prohibit detection of the corruption and a later failure of BBx. 

3 $04$ This bit tells BBx not to access a file that has a non-zero count in the access count stored in the header of the file. This should only be manipulated in the utility system when cleaning up after a system crash. 

3 $02$ This bit enables the replacement of mask characters in masks being printed to output devices, and in data used in the CVS() function when the mask conversion bit is specified in that function. The , character is replaced with the contents of the options vector byte 5, and the . is replaced with the contents of the options vector byte 6. Failure to set this bit, or failure to load values into the opts positions will disallow replacement of those characters. 

3 $01$ This bit is set by BBx when it is running under MS-DOS and Novell. It may be reset by the application. 

4 $80$ This limits the search performed during an attempt to open a file. Normally all available disks are tried with all available PREFIX values that don't include disks. With this option, the PREFIX is scanned only once, and any entries that have no disk are attempted with the current disk only. 

4 $40$ This is the Network Lock bit for standard access of files across the network. This bit enables the older, slower file locking scheme. It is necessary when accessing files that may also be accessed by a non-BBx task or by a BBx task running on a remote host by any process other than the BBx Data Server. 

4 $20$ This bit allows access to the BBx Data Server software. Activating this capability may cause error reports on systems not having a TCP/IP interface or on systems whose interface differs significantly from the porting system. You will not be able to set this bit if BBx is not prepared to work with a remote BBx Data Server. 

4 $10$ When set, this bit enables those systems that support the C-ISAM file type to recognize C-ISAM files. 

4 $08$ This bit has been added to select compatibility with BBxPROGRESSION/4 in these areas: 
a) Without the SETOPTS bit, PRO/5 can read BBx/4 template data correctly but might possibly write out numerical data with extra precision, so that BBx/4 can no longer retrieve the data. If BBx/4 continues to share data files with PRO/5, it is necessary to keep this bit on. 
b) Without the SETOPTS bit, keys with the "B" flag set in data files written from BBx/4 will read out-of-order. Turning the bit on will maintain compatibility with BBx/4's business math ("B" flagged) keys. 
c) If files with any "B" keys and/or template data with "B" fields in them are to be shared between BBx/4 and PRO/5, turn this SETOPTS bit on. If you plan to make a clean switch from BBx/4 to PRO/5, you do not need to worry about any template data with "B" fields in them, as PRO/5 will read the old data correctly. "B" flagged keys are still a concern, since they will read out-of-order without conversion. To solve this problem, you can either not have the extra precision in the keys (often this is acceptable), by just turning on the SETOPTS bit. Or, if you need the full 16-digit precision in your "B" keys, follow one of two procedures: 
1. Copy all the data to a new file, keeping the 
SETOPTS bit off. 
or 
2. Use a key chain without the "B" flag, 
For each record... 
Turn SETOPTS bit on 
Read record 
Remove record 
Turn SETOPTS bit off 
Write record 
Move to next record. 

4 $02$ This bit tells BBx to adjust the number of leading spaces for lines printed in expanded ('EP') mode. 

5 all This character is used in replacement of numeric mask character when permitted by OPTS byte 3, bit $02$, above. 

6 all This character is used in replacement of the numeric mask character when permitted by OPTS byte 3, bit $02$, above. 

BBx reserves bytes 7 through 10. Bytes 11 through 16 are for application use. BBx will never use these bytes. 

Examples: 

1000 LET A$=OPTS 
1010 LET A$(2,1)=IOR(A$(2,1),$80$) 
1020 SETOPTS A$ 

This example turns on non-destructive cursor advance while leaving the rest of the options vector unmodified. 





Last Modified: 02/23/2004 Product: PRO/5 Operating System: All platforms

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN Profile Visit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel