Announcement

Collapse
No announcement yet.

Integers ( )

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Integers ( )

    Please add your comments and suggestions as a Reply to this thread.





    PB/WIN - Integers (%)
    To PowerBASIC, an Integer is a number with no decimal point (what mathematicians would call whole numbers) with a range of -32,768 to +32,767 ( -2^15 to 2^15 - 1). These values stem from the underlying 16-bit representation of an Integer: 32,768 is 2^15, and are therefore 2 bytes (16-bits) wide. The type-specifier character for Integer is: %.

    Integers are identified by following the variable name with a percent sign (eg: var%), or by using the DEFINT statement. For example, if you use this declaration in your program code:

    Code:
    DEFINT I, J, K
    …then all variables following this declaration that start with the letter I, J, or K will be an Integer by default. You can also declare an Integer variable using the INTEGER keyword with the DIM statement. For example:

    Code:
    DIM I AS INTEGER
    A C/C++ short variable and a Delphi smallint are both equivalent to a PowerBASIC Integer.
    See Also
    Last edited by Gary Beene; 28 Oct 2014, 09:34 PM.
Working...
X