Convertion between Delphi, VB and C/C++

Please feel free to notify me about any change, addition or error E-Mail: !

Boolean types

Delphi/PascalVB/BasicC/C++BitsBytesRange
ByteBool
Boolean
8 10=False, <>0=True (1=True is common in Delphi/Pascal)
WordBool Boolean 1620=False, <>0=True (-1=True is common in VB/Basic)
LongBool 3240=False, <>0=True

Signed integer types

Delphi/PascalVB/BasicC/C++BitsBytesRange
ShortInt signed char 8 1-128 .. 127
SmallInt Integersigned short
signed int
162-32,768 .. 32,767
Integer
LongInt
Long signed long 324-2,147,483,648 .. 2,147,483,647
Int64 signed long long 6482^63 .. 2^631
-9,223,372,036,854,775,807 .. 9,223,372,036,854,775,807

Unsigned integer types

Delphi/PascalVB/BasicC/C++BitsBytesRange
Byte Byteunsigned char 8 80 .. 255
Word unsigned short
unsigned int
1620 .. 65,535
Cardinal
LongWord
unsigned long 3240 .. 4,294,967,295
unsigned long long 3240 .. 18,446,744,073,709,551,615

Real types

Delphi/PascalVB/BasicC/C++BitsBytesSignificant digitsRange
Real48 486 11-122.9 x 10^39 .. 1.7 x 10^38
Single Singlefloat 324 7-8 1.5 x 10^45 .. 3.4 x 10^38
Double
Real
double
long double
648 15-165.0 x 10^324 .. 1.7 x 10^308
Extended 801019-203.6 x 10^4,951 .. 1.1 x 10^4,932
Comp 648 19-202^63+1 .. 2^631
Currency 648 19-20922,337,203,685,477.5808 .. 922,337,203,685,477.5807

Characters

Delphi/PascalVB/BasicC/C++BitsBytesRange
AnsiChar
Char
8 10 .. 255
WideChar 1620 .. 65535

Strings

Delphi/PascalVB/BasicC/C++Max lengthMem. req.Description
ShortString 255 2 .. 256 bytes 8-bit ANSI characters
AnsiString
String
-2^31 4 bytes .. 2 Gbytes8-bit ANSI characters
WideString -2^30 4 bytes .. 2 GbytesUnicode characters
PAnsiChar
PChar
StringCharZero terminatedMemory allocated Pointer to first character in a 8-bit ANSI character string
PWideChar Zero terminatedMemory allocated Pointer to first character in a Unicode character string

Function declaration

TypeDelphi/PascalVB/BasicC/C++
Untyped Procedure ProcedureName; void functionname(void)
Typed Function FunctionName: Type; Public Declare Function FunctionName as Type Type functionname(void)
Untyped with parameterProcedure ProcedureName(Value: Type); void functionname(Type Value)
Typed with parameter Function FunctionName(Value: Type): Type; Public Declare Function FunctionName(Value as Type) as TypeType 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/PascalVB/BasicC/C++
Type casting Type(Value)
Value As Type
Type(Value)
Value assignmentValue:=Value Value=ValueValue=Value
Comparing values
= Value=Value Value=ValueValue=Value
<> Value<>Value Value!=Value
Value<>Value
> Value>Value Value>Value
< Value<Value Value<Value
>= Value>=Value
<= Value<=Value