Built-In Constants
TMBASIC provides a set of constants for your convenience.
You can use these constants in your programs by name rather than writing the literal number or string values.
Mathematical Constants
const PI = 3.141592653589793238462643383279502
const EULER = 2.718281828459045235360287471352662
Error Codes
Many built-in procedures throw errors when they fail.
When catching errors, use the
ErrorCode function to get the numeric error code.
TMBASIC provides the following constants for the error codes used by built-in procedures.
- ERR_INVALID_ARGUMENT = 50
- ERR_INVALID_OPERATION = 51
- ERR_IO_FAILURE = 100
- ERR_FILE_NOT_FOUND = 101
- ERR_ACCESS_DENIED = 102
- ERR_PATH_TOO_LONG = 103
- ERR_DISK_FULL = 104
- ERR_PATH_IS_DIRECTORY = 105
- ERR_PATH_IS_NOT_DIRECTORY = 106
- ERR_DIRECTORY_NOT_EMPTY = 107
- ERR_INVALID_PATH = 108
- ERR_INTERNAL_UNICODE_ERROR = 200
- ERR_INVALID_UNICODE_CODE_POINT = 201
- ERR_INVALID_NUMBER_FORMAT = 202
- ERR_MAP_KEY_NOT_FOUND = 300
- ERR_LIST_INDEX_OUT_OF_RANGE = 301
- ERR_VALUE_NOT_PRESENT = 302
- ERR_INTERNAL_TYPE_CONFUSION = 303
- ERR_LIST_IS_EMPTY = 304
- ERR_FORM_NOT_FOUND = 400
- ERR_CONTROL_NOT_FOUND = 401
- ERR_INVALID_CONTROL_TYPE = 402
- ERR_INVALID_DATETIME = 500
- ERR_INVALID_TIMEZONE = 501
- ERR_WRONG_SCREEN_MODE = 600