10. Error messages

Description

During the execution of a DestinyScript the can occur errors on different places. A list of all errors (and their meanings) is listed here.

List of errors

NummerName of constantShort description
0ERROR_UNKNOWNAn unknown error
1ERROR_SYNTAXUnexpected chars are used in the DestinyScript
2ERROR_NOVALUEA value is expected but no one is denoted
3ERROR_UNKNOWNNAMEAn unknown name was used
4ERROR_CONVERTA value couldn't be converted due to an unknown reason
5ERROR_READONLYIt was tried to write a read-only value
6ERROR_ARRAYBOUNDThe used index exceeds the boundaries
7ERROR_RANGEA value couldn't be converted because it is out of the range of the destination data type
8ERROR_MEMORYThe isn't sufficient free memory available
9ERROR_VALUEAn invalid value has been used for a parameter
10ERROR_BINARYFLOATIt was tried to execute a binary operation with a floating point number
11ERROR_CALCSWITCHIt was tried to calculate with a switch
12ERROR_CALCSTRINGIt was tried to calculate with a string
13ERROR_FLOATERRORAn error occured during a floating point operation
14ERROR_FLOATLENGTHTo much places have been denoted for a floating point number
15ERROR_DIVISIONBYZEROIt was tried to divide by zero
16ERROR_STRINGFORMATA string has an invalid format so it couldn't be converted
17ERROR_STRINGRANGEIt was tried to access a char which exceeds the length of the string
18ERROR_PICTUREA picture hasn't been loaded
19ERROR_PIXELRANGEIt was tried to access an area that exceed the boundaries of a picture
20ERROR_SAMEPICTUREIt was tried to use the same source and destination picture
21ERROR_PALETTERANGEIt was tried to access a palette entry which exceeds the 256 colors palette
22ERROR_SOCKETSTARTUPThe socket system couldn't be initialized
23ERROR_NOFREESOCKETThere are no more free sockets available
24ERROR_CANTCREATESOCKETIt was not possible to create a socket
25ERROR_SOCKETSTILLOPENIt was tried to open a socket while its already open
26ERROR_SOCKETNOTOPENIt was tried to use a socket method which requires an open socket
27ERROR_CANTCONNECTIt was not possible to connect to the specified address
28ERROR_SOCKETTYPEIt was tried to use a socket method which is appointed for an other socket type
29ERROR_SOCKETERRORAn unknown error occured during the access of a socket
30ERROR_OOBOut of band data (garbage) has been received on a DestinySocket
31ERROR_STRINGTOOLONGIt was tried to send a string which is longer than 255 bytes
32ERROR_NOFREEFILEHANDLEIt was tried to open an already open file handle
33ERROR_CANTRESOLVEPATHIt was not possible to resolve a path
34ERROR_NOPERMISSIONIt was tried to access a path outside of the game directory
35ERROR_CANTOPENFILEIt was not possible to open a file
36ERROR_FILENOTOPENIt was tried to use a file function which requires an open file
37ERROR_CANTACCESSFILEIt was not possible to access a file
38ERROR_CANTCREATEDIRIt was not possible to create a directory
39ERROR_CANTREMOVEDIRIt was not possible to remove a directory
40ERROR_CANTRENAMEFILEIt was not possible to rename/move a file/directory
41ERROR_CANTCOPYFILEIt was not possible to copy a file
42ERROR_CANTDELETEFILEIt was not possible to delete a file
43ERROR_CANTREADATTRIBUTESIt was not possible to retrieve the attributes of a file/directory
44ERROR_CANTWRITEATTRIBUTESIt was not possible to set the attributes of a file/directory
45ERROR_SEARCHSTILLOPENA directory browsing is already started
46ERROR_CANTSTARTSEARCHIt was not possible to start a directory browsing
47ERROR_NOSEARCHSTARTEDIt was tried to use a method which requires an already started directory browsing

Error 0: ERROR_UNKNOWN

Description

This error may never occur. It is only here to cover the impossible case.

Error 1: ERROR_SYNTAX

Description

This error occurs if an invalid char has been used in DestinyScript. This could happen whether there are too much parameters declared (in that case the interpreter want's a closing parenthesis and not a comma).

Example of the error

1
2
$
:

Error 2: ERROR_NOVALUE

Description

This error occurs if a value is required but no one is specified. This could be an empty pair of parantheses in a formula or simply a missing term.

Example of the error

1
2
$
v[1] = 3 + () + 1

Error 3: ERROR_UNKNOWNNAME

Description

This error occurs if a name (this means name of an object, method, property, constant or scope) has been denoted that doesn't exist.

Example of the error

1
2
$
v[1] = Picture[1].Toast
The Picture object has no property with the name "Toast".

Error 4: ERROR_CONVERT

Description

This error may never occur. It whould only occur if the interpreter tries to convert a not specified value.

Error 5: ERROR_READONLY

Description

This error occurs if it is tried to write a read-only (this means write-protected) value. Wheter a value is read-only or not is written in its definition.

Example of the error

1
2
$
Destiny.DllVersionMajor = 100
The property "DllVersionMajor" of the Destiny object is declared as read-only.

Error 6: ERROR_ARRAYBOUND

Description

This error occurs if an invalid index is used. For example if the range is defined as 1 to 100 then all indices less than 1 or bigger than 100 are invalid.

Example of the error

1
2
$
Picture[-1].UseMaskColor = False
The index of the Picture object start with 1. Hence each negative index is invalid.

Error 7: ERROR_RANGE

Description

A data type with a huge value was tried to be converted into a data type with a small range. For example the data type byte allows only values in the range from 0 to 255. So it is not possible to convert a value smaller than 0 or bigger than 255 into a byte.

Example of the error

1
2
3
$
f[1] = Math.Exp(11);
v[1] = f[1]
The error occurs in line 3. f[1] is 100,000,000,000 but the maximum value of dword is 2,147,483,647. Hence it is not possible to store the huge value into the small data type.

Error 8: ERROR_MEMORY

Description

There is not enough memory available to execute a command. For example this could happen if it is tried to allocate a string which is some giga bytes long. This error can depend on the used target computer system where the game is running. In this case a reboot of the computer could help.

Example of the error

1
2
3
$
a[1] += a[1] + String.Fill("This is just" +
" a long example string", 1000)
If this DestinyScript is executed in a (endless) loop then a[1] will grow and grow and grow... In theory this could raise the error if there is insufficient memory.

Error 9: ERROR_VALUE

Description

An invalid value has been specified for a parameter. Which values are valid for a parameter is written in the definition of its method. For the most parameters, where ranges are definied, you can use constants.

Example of the error

1
2
$
Server.Listen(1000000, SOCK_DESTINY)
The first parameter of the listen methods specifies the port where the socket will listen on. The range of this port specified as 1 to 65535. The value 1000000 exceeds this range.

Error 10: ERROR_BINARYFLOAT

Description

This error occurs when it is tried to apply a binary operation (AND, OR, NOT and XOR) with a floating point number. Binary operations are only allowed for integer data types (byte, word and dword).

Example of the error

1
2
$
f[1] &= 1
The used operator is an AND operator and not valid for an operation with the floating point number f[1].

Error 11: ERROR_CALCSWITCH

Description

This error occurs if it is tried to calculate with switches. This includes arithmetical and binary operations.

Example of the error

1
2
$
s[1] += 1
The used operator is an addition operator. Because s[1] is a switch this is invalid.
Information
To apply logical operations with switches you can use the Logic object.

Error 12: ERROR_CALCSTRING

Description

This error occurs if it is tried to calculate with strings. This includes arithmetical and binary operations. The only operator, which may be used with strings (additionally to the set operator), is the addition operator which is used to concatenate strings.

Example of the error

1
2
$
a[1] = "Hello Nr. " + 5
Numbers and strings are used in the same calculation. So the addition operator is interpreted as addition and not as concatenation.
Information
To avoid this error you can convert strings into numbers first (or vice versa). You can use the Convert object for this.

Error 13: ERROR_FLOATERROR

Description

This error occurs if a floating point operation was invalid. This could happen with (invalid) floating point numbers which are read from a file.

Error 14: ERROR_FLOATLENGTH

Description

This error occurs if a number (in text form), which is longer than 13 chars, is being converted into a floating point number.

Example of the error

1
2
$
f[1] = 1234567890.1234567890
The number has 10 integer places and 10 decimal places. In sum this are 20 places. This are more than the maximum allowed 13 places.

Error 15: ERROR_DIVISIONBYZERO

Description

This error occurs if it is tried to divide trough zero. This is (depending on the laws of mathematics) not possible. In theory it is possible to subtract zero infinite times from any number.

Example of the error

1
2
$
v[1] /= 0

Error 16: ERROR_STRINGFORMAT

Description

This error occurs if it is tried to convert a string into a number which has an invalid format (this means it doesn't contain (only) a number).

Example of the error

1
2
$
v[1] = "Number: 12345"
The string "Number: 12345" is not a number. Instead "12345" whould be valid.

Error 17: ERROR_STRINGRANGE

Description

This error occurs if it is tried to access a position which exceeds the length of a string.

Example of the error

1
2
$
v[1] = String.Ord("Hello", 5)
The string "Hello" has a length of 5 chars. It is tried to access the sixth char (= position 5) with the Ord method.

Error 18: ERROR_PICTURE

Description

This error occurs if it is tried to access a picture property, which is only available if the picture has been loaded (e. g. the pixels of a picture).

Example of the error

1
2
$
v[1] = Picture[1].Pixel[0, 0]
If there is no picture loaded as id 1 this will raise an error.

Error 19: ERROR_PIXELRANGE

Description

This error occurs if it is tried to access some pixel which exceed the picture's boundaries.

Example of the error

1
2
$
v[1] = Picture[1].FillRect(0, 0, 100, 100)
The error whould occur if the Picture no. 1 whould be smaller than 100 x 100 pixels (e. g. if the picture has a size of 20 x 20 pixels).

Error 20: ERROR_SAMEPICTURE

Description

This error occurs if it is tried to copy an area from one picture to the same picture.

Example of the error

1
2
$
Picture[1].CopyRect(0, 0, 1, 0, 0, 100, 100)
The error whould occur because the source picture (= 1) is the same as the destination picture (= 1).
Information
To avoid this problem you could load the same picture two times. Then you could copy the area from one picture to the other and then erase the copy.

Error 21: ERROR_PALETTERANGE

Description

This error occurs if it is tried to access a palette entry outside the range of 0 to 255.

Example of the error

1
2
$
Picture[1].Palette[256] = 0xFF
The palette entry with the index 256 doesn't exist.

Error 22: ERROR_SOCKETSTARTUP

Description

This error whould occur if it is not possible to initialize the socket system. This is an error of the target system, where the game is running. The reason for this error could be a wrong winsock version or an invalid network driver.

Error 23: ERROR_NOFREESOCKET

Description

This error occurs if there is no more free socket to accept an incoming connection.

Error 24: ERROR_CANTCREATESOCKET

Description

This error occurs if it is not possible to create a socket. This is an error of the target system, where the game is running. The reason for this error could be insufficient resources.

Error 25: ERROR_SOCKETSTILLOPEN

Description

This error occurs if it is tried to connect an already connected socket.

Example of the error

1
2
3
$
Client[0].Connect("127.0.0.1", SOCK_DESTINY);
Client[0].Connect("127.0.0.1", SOCK_DESTINY)
If we assume that the first connection whould be established then the second try to establish a connection whould raise this error. To avoid this error it is satisfactory to close the socket with the Close method before the connection is being established.

Error 26: ERROR_SOCKETNOTOPEN

Description

This error occurs if it is tried to do an operation which requires a connected socket.

Example of the error

1
2
3
$
Client[0].Close();
Client[0].SendVariable(1, 1)
The error whould occur in line 3, because the socket is closed (line 2). Hence it is not possible to send dara.

Error 27: ERROR_CANTCONNECT

Description

This error occurs if it was not possible to establish a connection.

Example of the error

1
2
$
Client[0].Connect("255.255.255.255", SOCK_DESTINY)
It is not possible to connect to the specified address (in this case it is an invalid address).

Error 28: ERROR_SOCKETTYPE

Description

This error occurs if it is tried to use RAW methods on a DestinySocket or DestinySocket methods on a RAW socket.

Example of the error

1
2
3
$
Client[0].Connect("127.0.0.1", SOCK_DESTINY);
Client[0].SendRawData("Hello", 5)
The error whould occur in line 3 because the socket type is DestinySocket and the SendRawData method is only for RAW sockets.

Error 29: ERROR_SOCKETERROR

Description

This error occurs if the socket system reports an error. This is a problem of the target system, where the game is running. The reason could be insufficient resources.

Error 30: ERROR_OOB

Description

This error occurs if a DestinySocket receives invalid data (out of band). This could occur if a DestinySocket connects to a RAW socket (or vice versa).
Information
The DestinyProtocol has no error handling. Hence a connection must be closed an re-established if such an error occurs. Usually the used TCP/IP protocol avoids the arrival of invalid data packages (because the TCP/IP protocol has its own error handling).

Error 31: ERROR_STRINGTOOLONG

Description

This error occurs if a string with a length greater than 255 bytes shall be sent over a DestinySocket.

Example of the error

1
2
$
Client[0].SendString(1, String.Fill("Bla", 500))
The error whould occur because the string, which shall be sent, is greater than 255 bytes (the length is 1500 bytes total).
Information
To avoid this error you could split the string into 255 char pieces (e. g. with the SubStr method). Next you send the first piece with the string id. Finally you send the other pieces with id 0. The receiving socket could append all received strings with id 0 to the last string id that was received.

Error 32: ERROR_NOFREEFILEHANDLE

Description

This error occurs if it is tried to open a file although the used file handle is already open.

Example of the error

1
2
3
$
File[0].Open("Test.txt", FILE_WRITE);
File[0].Open("Test2.txt", FILE_WRITE)
The error whould occur in line 3, because the used file handle (= 0) is already open (line 2).

Error 33: ERROR_CANTRESOLVEPATH

Description

This error occurs if it was not possible to resolve the path. This is an error of the target system, but could occur in theory with invalid paths.

Error 34: ERROR_NOPERMISSION

Description

This error occurs if it was tried to access a file or folder, which is outside of the game directory.

Example of the error

1
2
$
Directory.DeleteFile("C:\NTLDR")
Unless the game is running in C:\ (and this whould be stupid) this whould raise an error. Otherwise (if this whould be possible) an execution of this command could waste the computer system after a reboot. This is the reason why file/directory access is only allowed inside of the game directory.

Error 35: ERROR_CANTOPENFILE

Description

This error occurs if an file couldn't be opened. The reason could be that the file is already opened by an other program, because an not existing file is being opened only with read access, because the file name includes invalid chars, ...

Example of the error

1
2
3
$
File[0].Open(
"Filenames may not contain ?.txt", FILE_READ)
The error occurs because filenames may not contain question marks.

Error 36: ERROR_FILENOTOPEN

Description

This error occurs if a method is called which requires an open file handle, but the used file handle is not open.

Example of the error

1
2
3
$
File[0].Close();
File[0].WriteRawData(12345, TYPE_DWORD)
The error whould occur in line 3, because the file handle is closed (line 2).

Error 37: ERROR_CANTACCESSFILE

Description

This error occurs if a read/write command on a file handle fails. This depends on the target system, where the game is running. The reason could be insufficient free disk space.

Error 38: ERROR_CANTCREATEDIR

Description

This error occurs if it was not possible to create a directory. This depends on the target system, where the game is running. The reason could be insufficient free disk space or an other file/directory with the same name already exists.

Error 39: ERROR_CANTREMOVEDIR

Description

This error occurs if it was not possible to remove a directory. Additionally to reasons of ERROR_CANTCREATEDIR the reason could be that the directory, which shall be removed, isn't empty (so it contains files/directories).

Error 40: ERROR_CANTRENAMEFILE

Description

This error occurs if it was not possible to rename/move a file/directory. This depends on the target system, where the game is running. The reason could be insufficient free disk space or that already a file/directory exists with the target name.

Error 41: ERROR_CANTCOPYFILE

Description

This error occurs if it was not possible to copy a file. This depends on the target system, where the game is running. The reason could be insufficient free disk space or that already a file/directory exists with the target name.

Error 42: ERROR_CANTDELETEFILE

Description

This error occurs if it was not possible to delete a file. This depends on the target system, where the game is running. The reason could be that the file is marked as read-only or that already a file/directory exists with the target name.

Error 43: ERROR_CANTREADATTRIBUTES

Description

This error occurs if it was not possible to retrieve the attributes of a file/directory. This depends on the target system, where the game is running. The reason could be that the user has not the required rights to access the file/directory.

Error 44: ERROR_CANTWRITEATTRIBUTES

Description

This error occurs if it was not possible to set the attributes of a file/directory. This depends on the target system, where the game is running. The reason could be that the user has not the required rights to access the file/directory.

Error 45: ERROR_SEARCHSTILLOPEN

Description

This error occurs if it is tried to open a new directory browsing while an other is still open.

Example of the error

1
2
3
$
Directory.FindFirst("*.*");
Directory.FindFirst("*.*")
The error whould occur in line 3, because the browsing is still open (since line 2).

Error 46: ERROR_CANTSTARTSEARCH

Description

This error occurs if it was not possible to open a directory browsing. The reason could be an invalid search pattern or an invalid path.

Example of the error

1
2
$
Directory.FindFirst("|\*.*")
The error occurs because there is no directory with the name | (in fact this is not possible, because a file/directory may not contain | in its name).

Error 47: ERROR_NOSEARCHSTARTED

Description

This error occurs if it is tried do retrieve the next browse result, but no directory browsing was started.

Example of the error

1
2
3
$
Directory.FindClose();
a[1] = Directory.FindNext()
The error whould occur in line 3, because the directory browsing is closed (line 2).