Difference between revisions of "ObjectType:byte"
Jump to navigation
Jump to search
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{ObjectType-Vitals|byte|[[LavishScript]]|none|The string representation of this number|[[ObjectType:byte|byte]]|no|unsigned char}} | ||
+ | |||
== Description == | == Description == | ||
− | Similar to an [[ | + | Similar to an [[ObjectType:int|int]], a byte is a whole number. The range of a byte is 0-255. |
== Members == | == Members == | ||
Line 7: | Line 9: | ||
== Methods == | == Methods == | ||
* '''Inc''': Increments this byte by 1 | * '''Inc''': Increments this byte by 1 | ||
− | * '''Inc['''formula''']''': Increments this byte by a given amount | + | * '''Inc['''[[LavishScript:Mathematical Formulae|formula]]''']''': Increments this byte by a given amount |
* '''Dec''': Decrements this bye by 1 | * '''Dec''': Decrements this bye by 1 | ||
− | * '''Dec['''formula''']''': Decrements this byte by a given amount | + | * '''Dec['''[[LavishScript:Mathematical Formulae|formula]]''']''': Decrements this byte by a given amount |
− | * '''Set['''formula''']''': Sets this bye to a given value | + | * '''Set['''[[LavishScript:Mathematical Formulae|formula]]''']''': Sets this bye to a given value |
− | |||
− | |||
− | |||
== Examples == | == Examples == | ||
+ | ===Declare a byte variable=== | ||
+ | *declare Age byte "128" | ||
+ | ===Increment a byte variable=== | ||
+ | *Age:Inc | ||
+ | ===Decrement a byte variable=== | ||
+ | *Age:Dec | ||
+ | ===Set a byte variable to a given value=== | ||
+ | *Age:Set[30] | ||
+ | ===Add two byte variables=== | ||
+ | *TotalAge:Set[${Age1}+${Age2}] | ||
+ | *Cookies:Inc[${NewCookies}] | ||
== See Also == | == See Also == | ||
− | + | {{LavishScript:ObjectType}} | |
− | |||
− | |||
− |
Latest revision as of 15:39, 8 July 2018
byte | |
Defined By | LavishScript |
Inherits | none |
Reduces To | The string representation of this number |
Variable Object Type | byte |
Uses Sub-Types | no |
C/C++ Type | unsigned char |
Contents
Description
Similar to an int, a byte is a whole number. The range of a byte is 0-255.
Members
(none)
Methods
- Inc: Increments this byte by 1
- Inc[formula]: Increments this byte by a given amount
- Dec: Decrements this bye by 1
- Dec[formula]: Decrements this byte by a given amount
- Set[formula]: Sets this bye to a given value
Examples
Declare a byte variable
- declare Age byte "128"
Increment a byte variable
- Age:Inc
Decrement a byte variable
- Age:Dec
Set a byte variable to a given value
- Age:Set[30]
Add two byte variables
- TotalAge:Set[${Age1}+${Age2}]
- Cookies:Inc[${NewCookies}]
See Also
LavishScript Object Types
- Text
- string - mutablestring - unistring
- Numbers
- byte - float - float64 - int - uint - int64
- Boolean (TRUE/FALSE)
- bool
- Pointers
- boolptr - byteptr - floatptr - float64ptr - intptr - uintptr - int64ptr - rgbptr - stringptr
- Containers
- objectcontainer - array - index - collection - queue - stack - set - variablescope
- JSON
- jsonobject - jsonarray - jsonvaluecontainer - jsonvalue
- Iteration
- iterator - jsoniterator
- Date/Time
- time
- File Handling
- filepath - file - filelist - filelistentry
- Tasks
- lavishmachine - Accessed via the Top-Level Object LMAC
- task - tasklibrary - taskmanager - tasktype - taskpulseargs - elmactaskstate