User Tools

Site Tools


en:constants

Constants

Numeric Constants

Numeric constants are any numeric characters, preceded by an optional minus sign to indicate negative numbers, and an optional decimal followed by more numeric characters to indicate floating point values. Numbers come in two types: 1) integers and 2) decimal numbers.

Examples include:

Integer Numbers
10
-2345
0

Positive integer values may also be expressed in binary (base 2), octal (base 8), and hexadecimal (base 16). Precede binary values with 0b (0b1110 = 14), octal with 0o (0o177 = 127), and hexadecimal with 0x (0xff = 255).

Decimal Numbers
-234.567
56.87
0.0123
PI

Very large and small numbers may also be represented in scientific E notation (added in version 0.9.9.46). http://en.wikipedia.org/wiki/Scientific_notation

Scientific E Notation
E NotationDecimal Number
2e02
3e2300
1.234e1012340000000
-5.3e4-53000
2e-10.2
5.12e-90.00000000512
2016/01/01 22:41

String Constants

String constants are zero or more characters enclosed by either double quotation marks(“) or single quotation marks (').

Examples

'I said “Hello.”'
“Tuesday Rocks”
'123'
“it is Smith's”
2016/01/01 22:42

Boolean Constants

Boolean values represent the two values of True and false. There are defined constants true and false that represent the value 1 and 0 respectively.

Examples

True ValuesFalse Values
TRUEFALSE
10
-560.0
9.9'“
“something”
2016/08/09 09:54 · admin

Color Constants and RGB values

These values are used by the Color statement, can be created with the RGB, and are returned by the GetBrushColor, GetColor, and pixel functions.

Color Constant (Name)ARGB ValuesInteger
BLACK255, 0, 0, 04278190080Black
WHITE255, 255, 255, 2554294506744White
RED255, 255, 0, 04294901760red
DARKRED255, 128, 0, 04286578688darkred
GREEN255, 0, 255, 04278255360green
DARKGREEN255, 0, 128, 04278222848darkgreen
BLUE255, 0, 0, 2554278190335blue
DARKBLUE255, 0, 0, 1284278190208darkblue
CYAN255, 0, 255, 2554278255615cyan
DARKCYAN255, 0, 128, 1284278222976darkcyan
PURPLE255, 255, 0, 2554294902015purple
DARKPURPLE255, 128, 0, 1284286578816darkpurple
YELLOW255, 255, 255, 04294967040yellow
DARKYELLOW255, 128, 128 ,04286611456darkyellow
ORANGE255, 255, 102, 04294927872orange
DARKORANGE255, 176, 61 ,04289344256darkorange
GREY255, 164, 164 ,1644288980132grey
DARKGREY255, 128, 128 ,1284286611584darkgrey
CLEAR0, 0, 0, 00
2016/08/12 20:00 · admin

Variable and Expression Types

These constants can be used to represent the numeric values returned by the TypeOf function.

Return Values
ConstantValueType
TYPE_UNASSIGNED0Unassigned Variable
TYPE_INT1Integer
TYPE_FLOAT2Decimal Number
TYPE_STRING3String
TYPE_ARRAY4Array Variable
TYPE_REF5Variable Reference
2016/08/13 13:25 · admin

Error Codes and Constants

This is a list of runtime error code numbers returned by the LastError function and text error messages returned by the LastErrorMessage function.

Non Trappable Errors
Error #Error Description
-1ERROR_NOSUCHLABELNo such label %VARNAME%
-2ERROR_NEXTNOFORNext without FOR
-3ERROR_NOTARRAYVariable %VARNAME% is not an array
-5ERROR_ARGUMENTCOUNTNumber of arguments passed does not match FUNCTION/SUBROUTINE definition
-6ERROR_MAXRECURSEMaximum levels of recursion exceeded
-7ERROR_STACKUNDERFLOWStack Underflow Error
-8ERROR_BADCALLFUNCTIONFunction was not called correctly
-9ERROR_BADCALLSUBROUTINESubroutine was not called correctly
Trappable Errors
Error #Error Description
5ERROR_FILENUMBERInvalid File Number
6ERROR_FILEOPENUnable to open file
7ERROR_FILENOTOPENFile not open
8ERROR_FILEWRITEUnable to write to file
9ERROR_FILERESETUnable to reset file
10ERROR_ARRAYSIZELARGEArray %VARNAME% dimension too large
11ERROR_ARRAYSIZESMALLArray %VARNAME% dimension too small
13ERROR_VARNOTASSIGNEDVariable %VARNAME% has not been assigned a value
14ERROR_ARRAYNITEMSArray %VARNAME% rows must have the same number of items
15ERROR_ARRAYINDEXArray %VARNAME% index out of bounds
17ERROR_STRSTARTStarting position less than zero
20ERROR_RGBRGB Color values must be in the range of 0 to 255
21ERROR_PUTBITFORMATString input to putbit incorrect
23ERROR_POLYPOINTSNot enough points in array for poly()/stamp()
24ERROR_IMAGEFILEUnable to load image file
25ERROR_SPRITENUMBERSprite number out of range
26ERROR_SPRITENASprite has not been assigned
27ERROR_SPRITESLICEUnable to slice image
28ERROR_FOLDERInvalid directory name
29ERROR_INFINITYOperation returned infinity
30ERROR_DBOPENUnable to open SQLITE database
31ERROR_DBQUERYDatabase query error (message follows)
32ERROR_DBNOTOPENDatabase must be opened first
33ERROR_DBCOLNOColumn number out of range or column name not in data set
34ERROR_DBNOTSETRecord set must be opened first
35ERROR_TYPECONVUnable to convert string to number
36ERROR_NETSOCKError opening network socket
37ERROR_NETHOSTError finding network host
38ERROR_NETCONNUnable to connect to network host
39ERROR_NETREADUnable to read from network connection
40ERROR_NETNONENetwork connection has not been opened
41ERROR_NETWRITEUnable to write to network connection
42ERROR_NETSOCKOPTUnable to set network socket options
43ERROR_NETBINDUnable to bind network socket
44ERROR_NETACCEPTUnable to accept network connection
45ERROR_NETSOCKNUMBERInvalid Socket Number
46ERROR_PERMISSIONYou do not have permission to use this statement/function
47ERROR_IMAGESAVETYPEInvalid image save type
50ERROR_DIVZERODivision by zero
51ERROR_BYREFFunction/Subroutine expecting variable reference in call
53ERROR_FREEFILEThere are no free file numbers to allocate
54ERROR_FREENETThere are no free network connections to allocate
55ERROR_FREEDBThere are no free database connections to allocate
56ERROR_DBCONNNUMBERInvalid Database Connection Number
57ERROR_FREEDBSETThere are no free data sets to allocate for that database connection
58ERROR_DBSETNUMBERInvalid data set number
59ERROR_DBNOTSETROWYou must advance the data set using DBROW before you can read data from it
60ERROR_PENWIDTHDrawing pen width must be a non-negative number
62ERROR_ARRAYINDEXMISSINGArray variable %VARNAME% has no value without an index
63ERROR_IMAGESCALEImage scale must be greater than or equal to zero
64ERROR_FONTSIZEFont size, in points, must be greater than or equal to zero
65ERROR_FONTWEIGHTFont weight must be greater than or equal to zero
66ERROR_RADIXSTRINGUnable to convert radix string back to a decimal number
67ERROR_RADIXRadix conversion base muse be between 2 and 36
68ERROR_LOGRANGEUnable to calculate the logarithm or root of a negative number
69ERROR_STRINGMAXLENString exceeds maximum length of 16,777,216 characters
71ERROR_PRINTERNOTONPrinter is not on
72ERROR_PRINTERNOTOFFPrinting is already on
73ERROR_PRINTEROPENUnable to open printer
74ERROR_WAVFILEFORMATMedia file does not exist or in an unsupported format
75ERROR_WAVNOTOPENMedia file not open
76ERROR_WAVNOTSEEKABLE
77ERROR_WAVNODURATION
78ERROR_FILEOPERATIONCan not perform that operation on a Serial Port
79ERROR_SERIALPARAMETERInvalid serial port parameter
80ERROR_LONGRANGENumber exceeds long integer range ()
81ERROR_INTEGERRANGENumber exceeds integer range ()
65535ERROR_NOTIMPLEMENTED“Feature not implemented in this environment.”
Warnings
Error #Error Description
65536+ERROR_TYPECONVWARNING_TYPECONVUnable to convert string to number, zero used
65536+ERROR_WAVNOTSEEKABLEWARNING_WAVNOTSEEKABLEMedia file is not seekable
65536+ERROR_WAVNODURATIONWARNING_WAVNODURATIONDuration is not available for media file
65536+ERROR_VARNOTASSIGNEDWARNING_VARNOTASSIGNEDVariable %VARNAME% has not been assigned a value
65536+ERROR_LONGRANGEWARNING_LONGRANGENumber exceeds long integer range ()
65536+ERROR_INTEGERRANGEWARNING_INTEGERRANGENumber exceeds integer range ()
2016/01/01 22:40

Mouse Button Constants

These constants can be used to represent the numeric values returned by the Clickb and Mouseb functions. If a user has pressed more than one button the values will be added together when returned.

Return Values
ConstantValue
MOUSEBUTTON_NONE0
MOUSEBUTTON_LEFT1
MOUSEBUTTON_RIGHT2
MOUSEBUTTON_CENTER4
MOUSEBUTTON_DOUBLECLICK32
2016/08/14 14:38 · admin

Image Save Type Constants

These constants can be used to tell the ImgSave statement which format to save the graphics window into.

Return Values
ConstantValue
IMAGETYPE_BMP“BMP”
IMAGETYPE_JPG“JPG”
IMAGETYPE_PNG“BMP”
2016/08/14 14:42 · admin

Operating System Type Constants

These constants can be used to represent the numeric values returned by the OsType function.

Return Values
ConstantValue
OSTYPE_WINDOWS0
OSTYPE_LINUX1
OSTYPE_MACINTOSH2
OSTYPE_ANDROID3
2016/08/14 14:45 · admin

GetSlice Constants

These constants can be used to specify the action of the GetSlice statement.

Graphics Layers Values
ConstantValue
SLICE_ALL0
SLICE_PAINT1
SLICE_SPRITE2
2016/09/08 10:55 · admin
en/constants.txt · Last modified: 2016/09/08 10:56 by admin