Difference between revisions of "ObjectType:int"

From Lavish Software Wiki
Jump to navigation Jump to search
m (DataType:int moved to ObjectType:int)
Line 1: Line 1:
 
== Description ==
 
== Description ==
Short for <tt>integer</tt>, an int is a whole number that can be represented in 32 bits.  This datatype is limited to the numbers -2,147,483,648 to 2,147,483,647.
+
Short for <tt>integer</tt>, an int is a whole number that can be represented in 32 bits.  This datatype is limited to the numbers -2,147,483,648 to 2,147,483,647 (2 billion).
  
 
== Members ==
 
== Members ==

Revision as of 09:13, 14 May 2008

Description

Short for integer, an int is a whole number that can be represented in 32 bits. This datatype is limited to the numbers -2,147,483,648 to 2,147,483,647 (2 billion).

Members

  • float Float: This number, converted to a float
  • string Hex: A hexadecimal string equivalent to this number
  • int Reverse: This number, with its bytes reversed (1234 is turned into 3523477504.. easier to see in hex: 00 00 04 D2 -> D2 04 00 00)
  • string LeadingZeroes[#]: A string representation of this number, with at least this many decimal places. The number will be lead with zeroes to reach the desired length
  • uint Unsigned: This number as 32-bit unsigned

Methods

  • Inc: Increments this int by 1
  • Inc[formula]: Increments this int by a given amount
  • Dec: Decrements this int by 1
  • Dec[formula]: Decrements this int by a given amount
  • Set[formula]: Sets this int to a given value

Returns

The string representation of this number

Examples

Declare an integer

  • declare Count int 37

Set an integer's value

  • Count:Set[37430]

Add two integers

  • Total:Set[${Total}+${Current}]

Increment an integer

  • Count:Inc

Decrement an integer

  • Count:Dec

Operates On

int

See Also