Updated March 2015; see History
xcall ASFLAG, flag
ASFLAG allows a program to set various internal A-Shell options that do not fall conveniently under another category.
Parameters
flag (Num) [in]
One or more flags to set from the following table. Note that if flag is mapped as B,2 (or B,4, see History note below), then the previous flag settings will be returned in the variable; this is useful when you want to temporarily change the flags and then restore them.
Symbol |
Value |
Meaning |
---|---|---|
|
|
Same as 1 if omitted (i.e. xcall ASFLAG equals xcall ASFLAG,1). |
|
&h00000 |
Turn off all flags. |
AF_READONLY |
&h000001 |
Turn on Read Only. |
AF_SYNCWRITE |
&h000002 |
Turn on Synchronized Write mode for D-ISAM. |
AF_DIVIDEBY0 |
&h000004 |
Allow divide by zero. Treats a division by zero as equal to zero, rather than generating an ASB error. This is the runtime equivalent of the BASICplus compile-time source directives DIVIDE’BY’0 and NO’DIVIDE’BY’0. |
AF_EXITSBX |
&h000008 |
Force exit to dot from SBX. |
AF_MMAP |
&h000010 |
|
AF_NOIDXLOK |
&h000020 |
|
AF_LOCALCOPY |
&h000040 |
Make Local Copy of file (Windows only). |
AF_SETCTRLC |
&h000080 |
May be used within an SBX subroutine to force a Force Ctrl+C to Parent program (on return from the SBX). |
AF_NOMMAP |
&h000100 |
Turn off memory mapping (overriding the MMAPLIST setting in miame.ini) for any files subsequently opened in the current program. |
AF_CRYPT |
&h000200 |
Encrypt on allocate, disam create. Only applies to versions of A-Shell which support the Encrypted File System (EFS). Contact MicroSabio for more info. |
AF_NOCRYPT |
&h000400 |
Override m1.crypt flags. Only applies to versions of A-Shell which support the Encrypted File System (EFS). Contact MicroSabio for more info." |
AF_CSVNOQUOTE |
&h000800 |
Disables all special handling of double-quote characters (ASCII 34, or "), treating them as ordinary data characters. |
AF_CSVSMARTQUOTE |
&h001000 |
Obsolete as of A-Shell 5.1.1163 of October 09. In prior versions: Enables "smart" handling of double-quote characters. A-Shell looks at the context of the line to guess whether a double-quote character is being used to enclose a field (that may contain special characters, including line breaks), or it is simply an ordinary data character. |
AF_NOSTREAMEFS |
&h004000 |
Bypass EFS for stream functions (EFS only) |
AF_ISAMNODUPERRS |
&h008000 |
Modifies the behavior of the ISAM-A CREATE'RECORD statement. Normally, if the record already exists (and duplicates not allowed), it returns ASB error 208 (attempt to add duplicate key). With the AF_ISAMNODUPERRS flag set, CREATE'RECORD will instead just return FSTAT=2 but no ASB error. The motivation is mainly to improve performance of certain specialized file build operations where you want to add a record if it doesn't exist but do nothing if the record does exist. Setting the flag allows the program to eliminate a FIND operation prior to each CREATE'RECORD, which may significantly increase the build speed. |
AF_SBXASRUN |
&h010000 |
Set SBX as Run. |
AF_SQLPERSIST |
&h020000 |
Don't auto-close SQL connections. |
Definition file: ashell.def |
Comments
• | This subroutine was first introduced as SETRO since its only function was the "Set Read Only" mode. ASFLAG is backward compatible with SETRO, so you can either change the name in your source code or alias it in miame.ini (e.g. ALIAS=SETRO:ASFLAG). |
• | A technique related to the memory mapping and local file schemes described above for speeding up single-user or read-only access to a file is that of loading a file into user memory (with LOAD.LIT or MX_USRLOD) and then accessing it via the MEM: device. |
• | If the flag parameter is mapped as B,2 then the previous flag settings will be returned in the variable. This is useful when you want to temporarily change the flags and then restore them. |
• | All flags are reset at the start of each RUN program. Otherwise, unless modified by a subsequent ASFLAG operation, they remain set for the duration of the current program. |
• | The ASFLAGs are not cleared at the start of SBXs. Thus changes during the execution of a RUN or SBX will be passed down to lower level subroutines, but they do not percolate back up. |
Subtopics
•