Please enable JavaScript to view this site.

thinBasic Help Manual

* * HELP & MANUAL PREMIUM PACK 4 DEMO VERSION * *

This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.

This version is copyright and may only be used for local testing purposes. It may not be distributed.

Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.

 

Numeric equates

 

thinBasic allows you to refer to numeric constants by name. Those constant values are called equates.

A numeric equate (constant) must start with % sign.

 

Equates data type

 

Equates declaration has the following syntax:

 

%EquateName = NumericExpression [As NumericDataType]

 

Equal sign is optional, so the above sentence can also be written as:

 

%EquateName NumericExpression [As NumericDataType]

 

Where the optional parameter NumericDataType can be any of the allowed numeric data types: BYTE, INTEGER, WORD, DWORD, LONG, QUAD, SINGLE, DOUBLE, EXTENDED, CURRENCY.

If not NumericDataType is specified, default type will be assumed to be LONG.

 

Binary and hex numbers can be represented indicating &B or &H followed by the relative representation. Examples:

 

%MAXIMUM_D  = &HFFFFFFFF As DWord

%MAXIMUM_L  = &H7FFFFFFF As Long

%MINIMUM_L  = &H80000000 As Long

 

%Normal   = &B000000

%ReadOnly = &B000001

%Hidden   = &B000010

%System   = &B000100

%vLabel   = &B001000

%SubDir   = &B010000

%Archive  = &B100000

 

Hex numbers can be also represented using C notation 0x... followed by the hex representation of the hex value.

Examples:

%MAXIMUM_D  = 0XFFFFFFFF As DWord

%MAXIMUM_L  = 0X7FFFFFFF As Long

%MINIMUM_L  = 0X80000000 As Long

 

Examples

 

Some equate declaration example:

 

%MAXPIECES = 32

%NPARAM    = 3

%NTYPE     = 1

%RANK      = 2

%FILE      = 3

%KING      = 1

%PAWN      = 2

 

%MAXVALUE  = 0.999 AS EXT

%ANYVALUE  = 0.999 AS DOUBLE

 

Restrictions

 

1.Numeric equates name must start with percent sign %

2.Unlike variables, you can use an equate on the left side of an assignment statement only once.

3.If an equate has already been created, subsequent attempts to assign a new value will fail but no error will be generated

 

 

 

Created with Help+Manual 8 and styled with Premium Pack Version 4 © by EC Software