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.

 

Description

 

Define beginning and end of a constant declaration block.

It can be used to define a series of constants (equates) with some advantages like automatic increment of numeric values.

 

Syntax

 

BEGIN CONST [, InitialNumericValue]

 %NumericEquate [= Numeric Expression]

 ...

 $StringEquate = String Expression

END CONST

 

Returns

 

None

 

Parameters

 

Remarks

 

Numeric equate name must start with % sign.

String equate must start with $ sign

 

If numeric equate value is not specified, the last value used incremented by 1 will be assigned.

 

Restrictions

 

For string equate it is mandatory to specify the = sign followed by a string expression because it has no sense to assign a blank value.

In any case a string expression resulting in an empty string is accepted.

 

See also

 

Dim

 

Examples

 

Begin Const                '---Start of BEGIN CONST block

    %a = 1                 '---A value was specified so new auto increment will start from 1 + 1

    %b                     '---No value specified. The last value (1) incremented by 1 will be used

    %c = 100               '---A value was specified so new auto increment will start from 100 + 1

    %d                     '---No value specified. The last value (100) incremented by 1 will be used

    %e, %f                 '---Use comma to specify multiple consts

    $s1 = "Any text"       '---For string equates an assignment clause is mandatory

    %f1 = 123.456 As EXT   '---A value was specified and also forced an EXT type

 

End Const                  '---End of BEGIN CONST block

 

MSGBOX 0, "Values: " & $crlf & _

            %a  & $crlf & _    '---1

            %b  & $crlf & _    '---2

            %c  & $crlf & _    '---100

            %d  & $crlf & _    '---101

            $s1 & $crlf & _    '---AnyText

            %f1 & $crlf & _    '---123.456

            ""

 

'---See also BEGIN CONTROLID

Begin Const, %WM_USER      '---Start of BEGIN CONST block with starting value = %WM_USER

    %idButton1

    %idButton2

    %idTextBox1

End Const                  '---End of BEGIN CONST block

 

 

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