Jump to content
The simFlight Network Forums

Recommended Posts

Posted

In the comming version of FS-Interrogate users will be able to pick how variable types should appear based on their preferences (e.g. a Delphi developer like myself prefer seing the Delphi-types, a C/C++ developer preferes the C-types an so on).

In order to complete the list I would like some help as what the types are called in the Development/platforms-languages that are written in subject (hence Delphi and C/C++ is defined). I need the name for the following types:

8 bit Unsigned (Byte in Delphi, unsigned char in C/C++)

16 bit Unsigned (Word in Delphi, unsigned short in C/C++)

32 bit Unsigned (LongWord in Delphi, unsigned int in C/C++)

8 bit Signed (ShortInt in Delphi, signed char in C/C++)

16 bit Signed (SmallInt in Delphi, short in C/C++)

32 bit Signed (Integer in Delphi, int in C/C++)

64 bit Signed (Int64 in Delphi, long long / _int64 in C/C++)

32 bit Floating-Point (Single in Delphi, float in C/C++)

64 bit Floating-Point (Double in Delphi, double in C/C++)

Strings (String in Delphi, ASCIIZ in C/C++)

Thanks,

Pelle F. S. Liljendal

Posted

That is the very reason I ask what these types are called in those languages mentioned: VB, VB.Net, C# nd Java.

If someboby once and for all would tell me the names of these variabletypes in VB and VB.Net then when YOU use the new version of FS-Interrogate you simply instruct it to use VB types and then you won't you hopefully will not be confused.

Howeer as I am not a VB nor VB-Net developer I do n o know the names of the types for VB/VB.Net - hence this is the reason I ask if somebody will tell me.

Pelle

Posted

Hope I can help a little:

Integer...... 2 bytes, 16 bits

Long.......... 4 bytes, 32 bits

Single........ 4 bytes, 32 bits

Double....... 8 bytes, 64 bits

Currency....8 bytes, 64 bits

Note: (got info from my programmer friend)

There is a REALLY BIG difference between double and currency in VB, although they are both 64bit. Double is a floating point number stored as M*2^E which can store number as high as 1.7*10^308. The tradeoff is that looses precision because it has a limited number of bits (something around 50) so it has limited number of decimal places so adding 1.0 to 1.0E+30 will give you 1E+30 again.

The currency type is a fixed-point type that always has 4 decimal places. It has no exponent etc, it's a integer value where the last 4 places are considered decimal. It has the range 922337203685477.5808 and is used for financial operations. It is better suited for calculations for no rounding occurs in this case.

Hope that helps

Posted

Integer...... 2 bytes, 16 bits

Long.......... 4 bytes, 32 bits

Are these only available signed? I seem to remember that VB has a lot of difficulty dealing with unsigned values.

What is an 8-bit value, or isn't that supported? I would have thought it would be needed for arrays of bytes representing actual computer addressable memory.

Are characters always the 16-bit Unicode or Wide character values, or is this a compiler option? I notice a lot of folks "extracting" characters from strings in order to make Windows-API and FS-compatible strings, or vice versa.

Double is a floating point number stored as M*2^E which can store number as high as 1.7*10^308.

I assume this is the Intel 64-bit floating point format, same as "double" in C/C++, and "Single" is the 32-bit equivalent (known as "float" in C/C++).

The currency type is a fixed-point type that always has 4 decimal places. It has no exponent etc, it's a integer value where the last 4 places are considered decimal.

Aha! This is why folks use them to "fake" a 64-bit integer, multiplying by 10000 because of the assumed 4 decimal places! I always wondered what that was about.

Thanks,

Pete

Posted

As far as I have been able to verify it, VB is missing in the "Unsigned department" (I haven't been able to find "16 bit unsigned" nor "32 bit unsigned", and last but not least i can't find a 64 bit Signed neither). So the 2 type you mention Pete are both signed.

I have found the all types for C# and it has support for all the various types both signed and unsigned.

Posted

Correct Pete... VB doesn't support unsigned, But it can be converted. For example when come across operation, HiWords or LoWord in C . VB would have to strip out the high bit and add it back again later to avoid overflows and misleading results. I have seen it and its so far complicated than I thought. Assume, MS designed VB for Basic Programmers who doesn't have much knowledge in advance type of operations.

What is an 8-bit value

It's supported :wink: You declare As Byte in VB. Of course because Bytes equals to 8 bits :D

Are characters always the 16-bit Unicode or Wide character values, or is this a compiler option?

No Idea, In VB6 I don't think there is any compiler option... you just complie it once and if it detects error it will acknowledge you rather its declaration arguement or math operations is not properly converted. That would avoid from system crash, this is probably another reason why unsigned is not supported.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.