LONG: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
(Created page with "LONG defines a variable as a 4 byte number type definition for larger INTEGER values. {{PageSyntax}} : DIM {{Parameter|variable}} AS LONG * LONG integer values range from -2147483648 to 2147483647. * '''QB64''''s _UNSIGNED LONG integer values range from 0 to 4294967295. * '''QB64''' _UNSIGNED _INTEGER64 values range from 0 to 18446744073709551615. * Decimal point values assigned to a LONG variable will be rounded to the nearest...") |
No edit summary |
||
Line 20: | Line 20: | ||
* [[DIM]], [[DEFLNG]] | * [[DIM]], [[DEFLNG]] | ||
* [[LEN]], [[CLNG]] | * [[LEN]], [[CLNG]] | ||
* [[MKL$]], [[CVL]] | * [[MKL$]], [[CVL]] | ||
* [[INTEGER]], [[_INTEGER64]] | * [[INTEGER]], [[_INTEGER64]] | ||
* [[SINGLE]], [[DOUBLE]] | * [[SINGLE]], [[DOUBLE]] |
Latest revision as of 01:59, 23 January 2023
LONG defines a variable as a 4 byte number type definition for larger INTEGER values.
Syntax
- LONG integer values range from -2147483648 to 2147483647.
- QB64's _UNSIGNED LONG integer values range from 0 to 4294967295.
- QB64 _UNSIGNED _INTEGER64 values range from 0 to 18446744073709551615.
- Decimal point values assigned to a LONG variable will be rounded to the nearest whole number.
- The LONG variable type suffix is & or ~& for _UNSIGNED. Suffix can also be placed after a literal or hexadecimal numerical value.
- _INTEGER64 uses the && or ~&& _UNSIGNED suffix.
- Values can be converted to 4 byte ASCII string values using MKL$ and back with CVL.
- When a variable has not been assigned or has no type suffix, the type defaults to SINGLE.
- Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix.
See also
- DIM, DEFLNG
- LEN, CLNG
- MKL$, CVL
- INTEGER, _INTEGER64
- SINGLE, DOUBLE
- _DEFINE, _UNSIGNED
- Variable Types