Detailed Descriptions

ASFLAG

Updated July 2008

xcall ASFLAG, flag

ASFLAG.SBR allows a program to set various internal A-Shell options that do not fall conveniently under another category. The flag parameter is treated as a bitmap whose options are listed below.

Symbol

Value

Meaning

 

 

Same as 1 if omitted (i.e. xcall ASFLAG equals xcall ASFLAG,1)

 

&h00000

Turn off all flags

AF_READONLY

&h00001

Turn on Read Only

AF_SYNCWRITE

&h00002

Turn on Synchronized Write mode for D-ISAM

AF_DIVIDEBY0

&h00004

Allow divide by zero. Treats a division by zero as equal to zero, rather than generating a BASIC error. This is the runtime equivalent of the BASIC Plus compile-time source directives DIVIDE’BY’0 and NO’DIVIDE’BY’0.

AF_EXITSBX

&h00008

Force exit to dot from sbx.

AF_MMAP

&h00010

Memory Mapping

AF_NOIDXLOK

&h00020

No IDX Lock

AF_LOCALCOPY

&h00040

Make Local Copy of file (Windows only)

AF_SETCTRLC

&h00080

May be used within an SBX subroutine to force a Force Ctrl+C to Parent program (on return from the SBX)

AF_NOMMAP

&h00100

Turn off memory mapping (overriding the MMAPLIST in the miame.ini) for any files subsequently opened in the current program.

AF_CRYPT

&h00200

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

&h00400

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

&h00800

Disables all special handling of double-quote characters (ASCII 34, or "), treating them as ordinary data characters.

AF_CSVSMARTQUOTE

&h01000

Obsolete as of A-Shell build 1163.2 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.

 

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. Refer to the A-Shell Development Guide for more details about that.

Note that 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.

Note also that all flags are reset at the start of each RUN program. Otherwise, unless modified by a subsequent XCALL ASFLAG operation, they remain set for the duration of the current program.

Subtopics