Difference between revisions of "UNSIGNED"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 1: Line 1:
The _UNSIGNED prefix means that the variable cannot take negative values only positive (over or equal to 0).
+
'''_UNSIGNED''' defines a numerical value as being positive only.
  
  
Line 5: Line 5:
  
  
 
+
* Although _UNSIGNED values can use negative values the result subtracts from the highest value of the number's type keeping it positive.
 
* Datatype can be any of the following: [[INTEGER]], [[SINGLE]], [[DOUBLE]], [[LONG]], [[STRING]], [[_BIT]], [[_BYTE]], [[_INTEGER64]], [[_FLOAT]]
 
* Datatype can be any of the following: [[INTEGER]], [[SINGLE]], [[DOUBLE]], [[LONG]], [[STRING]], [[_BIT]], [[_BYTE]], [[_INTEGER64]], [[_FLOAT]]
 
* _UNSIGNED can be used in a [[_DEFINE]] statement to set variable name first letters as all positive only values.
 
* _UNSIGNED can be used in a [[_DEFINE]] statement to set variable name first letters as all positive only values.

Revision as of 20:48, 30 September 2009

_UNSIGNED defines a numerical value as being positive only.


Syntax: [_UNSIGNED] datatype


  • Although _UNSIGNED values can use negative values the result subtracts from the highest value of the number's type keeping it positive.
  • Datatype can be any of the following: INTEGER, SINGLE, DOUBLE, LONG, STRING, _BIT, _BYTE, _INTEGER64, _FLOAT
  • _UNSIGNED can be used in a _DEFINE statement to set variable name first letters as all positive only values.
  • Can also be used in DIM statements or Subprocedure parameter definitions following AS.
  • _UNSIGNED allows larger positive numerical variable value limits than unsigned.


Example: DIM intvariable AS _UNSIGNED INTEGER



See also: DECLARE, SUB, FUNCTION, DIM, _DEFINE, DEFSTR, DEFLNG, DEFINT, DEFSNG, DEFDBL, ABS, SGN


Navigation:

Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage