Please feel free to notify me about any change, addition or error E-Mail: !
Boolean types
Delphi/Pascal | VB/Basic | C/C++ | Bits | Bytes | Range |
ByteBool Boolean | | | 8 | 1 | 0=False, <>0=True (1=True is common in Delphi/Pascal) |
WordBool | Boolean | | 16 | 2 | 0=False, <>0=True (-1=True is common in VB/Basic) |
LongBool | | | 32 | 4 | 0=False, <>0=True |
Signed integer types
Delphi/Pascal | VB/Basic | C/C++ | Bits | Bytes | Range |
ShortInt | | signed char | 8 | 1 | -128 .. 127 |
SmallInt | Integer | signed short signed int | 16 | 2 | -32,768 .. 32,767 |
Integer LongInt | Long | signed long | 32 | 4 | -2,147,483,648 .. 2,147,483,647 |
Int64 | | signed long long | 64 | 8 | –2^63 .. 2^63–1 -9,223,372,036,854,775,807 .. 9,223,372,036,854,775,807 |
Unsigned integer types
Delphi/Pascal | VB/Basic | C/C++ | Bits | Bytes | Range |
Byte | Byte | unsigned char | 8 | 8 | 0 .. 255 |
Word | | unsigned short unsigned int | 16 | 2 | 0 .. 65,535 |
Cardinal LongWord | | unsigned long | 32 | 4 | 0 .. 4,294,967,295 |
| | unsigned long long | 32 | 4 | 0 .. 18,446,744,073,709,551,615 |
Real types
Delphi/Pascal | VB/Basic | C/C++ | Bits | Bytes | Significant digits | Range |
Real48 | | | 48 | 6 | 11-12 | 2.9 x 10^–39 .. 1.7 x 10^38 |
Single | Single | float | 32 | 4 | 7-8 | 1.5 x 10^–45 .. 3.4 x 10^38 |
Double Real | | double long double | 64 | 8 | 15-16 | 5.0 x 10^–324 .. 1.7 x 10^308 |
Extended | | | 80 | 10 | 19-20 | 3.6 x 10^–4,951 .. 1.1 x 10^4,932 |
Comp | | | 64 | 8 | 19-20 | –2^63+1 .. 2^63–1 |
Currency | | | 64 | 8 | 19-20 | –922,337,203,685,477.5808 .. 922,337,203,685,477.5807 |
Characters
Delphi/Pascal | VB/Basic | C/C++ | Bits | Bytes | Range |
AnsiChar Char | | | 8 | 1 | 0 .. 255 |
WideChar | | | 16 | 2 | 0 .. 65535 |
Strings
Delphi/Pascal | VB/Basic | C/C++ | Max length | Mem. req. | Description |
ShortString | | | 255 | 2 .. 256 bytes | 8-bit ANSI characters |
AnsiString String | | | -2^31 | 4 bytes .. 2 Gbytes | 8-bit ANSI characters |
WideString | | | -2^30 | 4 bytes .. 2 Gbytes | Unicode characters |
PAnsiChar PChar | String | Char | Zero terminated | Memory allocated | Pointer to first character in a 8-bit ANSI character string |
PWideChar | | | Zero terminated | Memory allocated | Pointer to first character in a Unicode character string |
Function declaration
Type | Delphi/Pascal | VB/Basic | C/C++ |
Untyped | Procedure ProcedureName; | | void functionname(void) |
Typed | Function FunctionName: Type; | Public Declare Function FunctionName as Type | Type functionname(void) |
Untyped with parameter | Procedure ProcedureName(Value: Type); | | void functionname(Type Value) |
Typed with parameter | Function FunctionName(Value: Type): Type; | Public Declare Function FunctionName(Value as Type) as Type | Type functionname(Type Value) |
External declaration | Function FunctionName: Type; External 'DLL name'; | Public Declare Function FunctionName Lib "DLL name" as Type | |
Parameter seperator | ; (Semicolon) | , (Comma) | |
Normal parameter | Value: Type | ByVal Value as Type | |
Constant parameter | Const Value: Type | | |
Variable parameter | Var Value: Type | Value as Type | |
Untyped parameter | Var Value | Value as Any | |
Other stuff
| Delphi/Pascal | VB/Basic | C/C++ |
Type casting | Type(Value) Value As Type | | Type(Value) |
Value assignment | Value:=Value | Value=Value | Value=Value |
Comparing values |
= | Value=Value | Value=Value | Value=Value |
<> | Value<>Value | | Value!=Value Value<>Value |
> | Value>Value | | Value>Value |
< | Value<Value | | Value<Value |
>= | Value>=Value | | |
<= | Value<=Value | | |
|