- Overview
- Converting C types
- Simple types used in return value or in input parameter
- Simple types in output parameter
- Simple array in input parameter
- Simple array in return value
- Simple array in output parameter
- Using strings
- Using arrays of strings
- Strings and structures
- Simple array in a structure
- Class
Depending on the type of programming, it may be useful to know the correspondence between the types used in C and the types used in WLanguage. The table below presents this correspondence. Simple types used in return value or in input parameter | | | C type | C comment | WLanguage type | char, int8 | 1 byte | 1-byte integer | byte, uint8 | 1 byte | unsigned integer on 1 byte | short, int16 | 2 bytes | 2-byte integer | word, uint16 | 2 bytes | unsigned integer on 2 bytes | long, int 32, int (in 32 bits) | 4 bytes | [4-byte] integer | dword, uint32 | 4 bytes | unsigned integer on 4 bytes | longlong, int64 | 8 bytes | 8-byte integer | ulonglong, dwordlong, uint64 | 8 bytes | unsigned integer on 8 bytes | float | 4 bytes | 4-byte real | double | 8 bytes | [8-byte] real |
Simple types in output parameter | | | C type | C comment | WLanguage type | char*, int8* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an integer on 1 byte) | byte*, uint8* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an unsigned integer on 1 byte) | short*, int16* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an integer on 2 bytes) | word*, uint16* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an unsigned integer on 2 bytes) | long*, int 32*, int* (in 32 bits) | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of a [4-byte] integer) | dword*, uint32* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an unsigned [4-byte] integer) | longlong*, int64* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an integer on 8 bytes) | ulonglong*, dwordlong*, uint64* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an unsigned integer on 8 bytes) | float* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of a real [on 4 bytes]) | double* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of a real on 8 bytes) |
Simple array in input parameter | | | C type | C comment | WLanguage type | char*, int8* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an array of <N> integers on 1 byte or the address of a string) | byte*, uint8* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an array of <N> unsigned integers on 1 byte or the address of a buffer) | short*, int16* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an array of <N> integers on 2 bytes) | word*, uint16* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an array of <N> unsigned integers on 2 bytes) | long*, int 32*, int* (in 32 bits) | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an array of <N> [4-byte] integers) | dword*, uint32* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an array of <N> unsigned [4-byte] integers) | longlong*, int64* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an array of <N> integers on 8 bytes) | ulonglong*, dwordlong*, uint64* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an array of <N> unsigned integers on 8 bytes) | float* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an array of <N> [ 4-byte] real) | double* | 4 bytes in 32-bit, 8 bytes in 64-bit | system integer (containing the address of an array of <N> 8-bytes reals) |
Simple array in return value | | | | C type | C comment | WLanguage type | WLanguage comment | char*, int8* | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of an array of <N> 1-byte integers or address of an [ANSI] string. Use Transfer or StringRetrieve to retrieve the values. | byte*, uint8* | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of an array of <N> unsigned 1-byte integers or address of a buffer. Use Transfer or StringRetrieve to retrieve the values. | short*, int16* | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of an array of <N> integers on 2 bytes. Use Transfer to retrieve the values. | word*, uint16* | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of an array of <N> unsigned integers on 2 bytes. Use Transfer to retrieve the values. | long*, int 32*, int* (in 32 bits) | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of an array of <N> integers [on 4 bytes]. Use Transfer to retrieve the values. | dword*, uint32* | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of an array of <N> unsigned integers on 4 bytes. Use Transfer to retrieve the values. | longlong*, int64* | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of an array of <N> unsigned integers on 8 bytes. Use Transfer to retrieve the values. | ulonglong*, dwordlong*, uint64* | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of an array of <N> unsigned integers on 8 bytes. Use Transfer to retrieve the values. | float* | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of an array of <N> reals on 4 bytes. Use Transfer to retrieve the values. | double* | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of an array of <N> reals [on 8 bytes]. Use Transfer to retrieve the values. |
Simple array in output parameter | | | | C type | C comment | WLanguage type | WLanguage comment | char**, int8** | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of another system integer that contains the address of an array of <N> 1-byte integers or an [ANSI] string. Use Transfer or StringRetrieve to retrieve the values. | byte**, uint8** | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of another system integer containing the address of an array of <N> unsigned integers on 1 byte or the address of a buffer. Use Transfer or StringRetrieve to retrieve the values. | short**, int16** | 4 bytes in 32-bit, 8 bytes in 64-bit + csize <N> to get | system integer | address of another system integer containing the address of an array of <N> integers on 2 bytes. Use Transfer to retrieve the values. | word**, uint16** | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of another system integer containing the address of an array of <N> unsigned integers on 2 bytes. Use Transfer to retrieve the values. | long**, int 32**, int** (in 32 bits) | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of another system integer that contains the address of an array of <N> [4-byte] integers + Transfer | dword**, uint32** | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of another system integer containing the address of an array of <N> unsigned integers on 4 bytes. Use Transfer to retrieve the values. | longlong**, int64** | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of another system integer containing the address of an array of <N> integers on 8 bytes. Use Transfer to retrieve the values. | ulonglong**, dwordlong**, uint64** | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of another system integer containing the address of an array of <N> unsigned integers on 8 bytes. Use Transfer to retrieve the values. | float** | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of another system integer containing the address of an array of <N> reals on 4 bytes. Use Transfer to retrieve the values. | double** | 4 bytes in 32-bit, 8 bytes in 64-bit + size <N> to get | system integer | address of another system integer that contains the address of an array of <N> [8-byte] reals. Use Transfer to retrieve the values. |
Using strings - Read-only strings in input parameter
| | | C type | C comment | WLanguage type | char* | read-only ANSI string | system integer (containing the address of an ANSI string: &string[ANSI]) | wchar* | read-only UNICODE string | system integer (containing the address of a Unicode string: &string unicode) |
- Read/Write strings in input parameter
| | | C type | C comment | WLanguage type | char* | read/write ANSI string | system integer (containing the address of a fixed Ansi string: &string[ANSI] on <Max length>) | wchar* | read/write UNICODE string | system integer (containing the address of a fixed Unicode string: &string unicode on <Max Length>) |
- Strings in return value
| | | | C type | C comment | WLanguage type | WLanguage comment | char* | ANSI string | system integer | use StringRetrieve(system integer, srASCIIZAddress) | wchar* | UNICODE string | system integer | use StringRetrieve(system integer, srUNICODEAddress) |
- Strings in output parameter
| | | | C type | C comment | WLanguage type | WLanguage comment | char** | ANSI string | system integer | address of another system integer containing the address to use with StringRetrieve(system integer, srASCIIZAddress) | wchar** | UNICODE string | system integer | address of another system integer containing the address to use with StringRetrieve(system integer, srUNICODEAddress) |
Using arrays of strings - Array of strings in input parameter
| | | | C type | C comment | WLanguage type | WLanguage comment | char** | array of ANSI strings | system integer= &array of <N> integers | each array cell must be filled with the address of an Ansi string (&string[ANSI]) | wchar** | array of UNICODE strings | system integer = &array of <N> integers | each array cell must be filled with the address of a Unicode string (Unicode &string) |
- Array of strings in return value
| | | | C type | C comment | WLanguage type | WLanguage comment | char** | array of ANSI strings + find out the size <N> elsewhere | system integer | you must use StringRetrieve(system integer, srASCIIZAddress) for each array cell | wchar** | array of UNICODE strings + find out the size <N> elsewhere | system integer | you must use StringRetrieve(system integer, srUNICODEAddress) for each array cell |
Strings and structures - String directly in a structure
| | | C type | C comment | WLanguage type | struct ... { char ...[N+1] }; | read/write ANSI string | Struct is structure
- sString is string on N
END AStruct is Struct StructAddress is a system integer=&AStruct | struct ... { wchar ...[N+1] }; | read/write UNICODE string | Struct is structure
- sString is UNICODE string on N
END AStruct is Struct StructAddress is a system integer=&AStruct |
- Read-only string in input in a structure
| | | C type | C comment | WLanguage type | struct ... {char* ... }; | read-only ANSI string | sString is [ANSI] string Struct is structure
- aString is int
END AStruct is Struct
- AStruct:aString = &sString
StructAddress is a system integer=&AStruct | struct ... {wchar* ... }; | read-only UNICODE string | sString is UNICODE string Struct is structure
- aString is int
END AStruct is Struct AStruct:aString = &sString StructAddress is a system integer=&AStruct |
- Read/Write string in input in a structure
| | | C type | C comment | WLanguage type | struct ... {char* ... }; | read/write ANSI string | sString is [ANSI] string on <Max length> Struct is structure
- aString is a system integer
END AStruct is Struct AStruct:aString = &sString StructAddress is a system integer=&AStruct | struct ... {wchar* ... }; | read/write ANSI string | sString is UNICODE string on <Max Length> Struct is structure
- aString is a system integer
END AStruct is Struct AStruct:aString = &sString StructAddress is a system integer=&AStruct |
- String in output in a structure
| | | | C type | C comment | WLanguage type | WLanguage comment | struct ... {char* ... }; | ANSI string | Struct is structure
- aString is a system integer
END AStruct is Struct StructAddress is a system integer=&AStruct | + use StringRetrieve (int, srASCIIZAddress) | struct ... {wchar* ... }; | UNICODE string | Struct is structure
- aString is a system integer
END AStruct is Struct StructAddress is a system integer=&AStruct | + use StringRetrieve (int, srUNICODEAddress) |
Simple array in a structure - Simple array directly in a structure
| | C type | WLanguage type | struct ... { type ... [N] }; | Struct is structure
- t is fixed array of N <corresponding type>
END AStruct is Struct StructAddress is a system integer=&AStruct |
- Simple array in a structure
| | C type | WLanguage type | struct ... { type* ... }; | t is array of N <corresponding type> Struct is structure
- aArray is int
END AStruct is Struct AStruct:aArray = &t StructAddress is a system integer=&AStruct |
Class No conversion is available for the classes.
This page is also available for…
|
|
|