.NET for Visual FoxPro Developers

Appendix B
Data Type Comparison Table

The following table provides a side-by-side comparison of Visual FoxPro, C#, and Visual Basic.NET data types.

Data Type Comparison

Table 1 is an adaptation of the table found in the .NET Help topic “Data Types Compared in Different Languages”.

Table 1. A comparison of Visual FoxPro, C#, and VB.NET data types

Storage size

Visual
FoxPro

C#

VB.NET

16 bytes

Variant

n/a

n/a

Decimals

n/a

decimal

Decimal

Date

Date, DateTime

DateTime

Date,DateTime

(varies)

n/a

string

String

1 byte

Logical

byte

Byte

2 bytes

n/a

bool

Boolean

2 bytes

n/a

short, char
(Unicode character)

Short, Char
(Unicode character)

1 byte

Character

n/a

n/a

4 bytes

Integer

int

Integer

8 bytes

Float

long

Long

4 bytes

n/a

float

Single

8 bytes

Double

double

Double

4 bytes in table

General

n/a

n/a

 


Table 2. A list of C# and VB.NET data types

 

Type

C#

Alias

VB .NET

Alias

Range

Size

System.Byte

byte

Byte

0-255

Unsigned 8-bit integer

System.SByte

sbyte

Sbyte

-128 to 127

Signed 8-bit integer

System.Int16

short

Short

-32,768 to 32,767

Signed 16-bit integer

System.Int32

int

Integer

-2,147,483,648 to

2,147,483,647

Signed 32-bit integer

System.Int64

long

Long

-9,223,372,036,854,775,808 to

9,223,372,036,854,775,807

Signed 64-bit integer

System.UInt16

ushort

UInt16

0 to 65,535

Unsigned 16-bit integer

System.UInt32

uint

UInt32

0 to 4,294,967,295

Unsigned 32-bit integer

System.UInt64

ulong

UInt64

0 to 184,467,440,737,095,551,615

Unsigned 64-bit integer

System.Single

float

Single

±1.4 × 10-45 to ±3.4 × 1038

7 digits (precision)

System.Double

double

Double

±5.0 × 10-324 to ±1.7 × 10308

15-16 digits (precision)

System.Decimal

decimal

Decimal

1.0 × 10-28 to 7.9 × 1028

28-29 significant digits

System.Boolean

bool

Boolean

True or False

 

System.Char

char

Char

U+0000 to U+ffff

Unicode 16-bit character

 

 


.NET for Visual FoxPro Developers