Data Types

Updated July 2016; see History

ASB supports the data types shown in the tables below.

Scalar Types

Type

Source

Code

Description

Floating Point

BASIC Plus

F,4

32 bit IEEE float

AlphaBASIC

F,6

48 bit AMOS float

BASIC Plus

F,8

64 bit IEEE float

Binary, little endian

AlphaBASIC

B,1

8 bit unsigned

B,2

16 bit unsigned

B,3

24 bit unsigned

B,4

32 bit unsigned

B,5

40 bit signed (two's complement)

A-Shell

B,6

48 bit unsigned

I,6

48 bit signed (two's complement)

Integer, AMOS format

BASIC Plus

I,1

8 bit signed (two’s complement)

I,2

16 bit signed (two’s complement, little-endian)

I,4

32 bit signed (two’s complement, 2301 order)

String

AlphaBASIC

S,#

fixed length string of # bytes [AB]

A-Shell

S,0

variable length string (dynamically sized, always with trailing null)

Unformatted
(raw bytes)

AlphaBASIC

X,#

fixed length raw bytes

(none)

May be declared implicitly by leaving type,size specifier in MAP statement blank and defining lower-level MAP statements.

 

Compound Types

Type

Source

Example

See Note #

Multi-level MAPs

AlphaBASIC

MAP1 CUST
    MAP2 NAME,S,30
    MAP2 CUSNO,B,4
    MAP2 TOTSALES,F,6

1, 2

Defined Structures

A-Shell

DEFSTRUCT ST_CUST       ! define structure layout
    MAP2 NAME,S,30
    MAP2 CUSNO,B,4
    MAP2 TOTSALES,F,6
ENDSTRUCT
...
MAP1 CUSREC,ST_CUST    ! define instance of structure
...
READ #CH, CUSREC       ! read/write entire struct at once
? CUSREC.NAME          ! use structvar.member notation for fields

 

 

Table Notes:

1 Also known as "records"

2 Any MAPn level with higher-numbered levels defined within it

History

2016 June, A-Shell 6.3.1516, compiler edit 763:  Added variable types B6 and I6. See following topic.