Category:LSL Integer
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Integers
The integer data type is a signed 32 bit value between −2,147,483,648 and +2,147,483,647 (that is 0x80000000 to 0x7FFFFFFF in hex). Integers are whole numbers. The fractional datatype is the float.
DEBUG_CHANNEL can be used as a constant for the maximum integer (for that is the value it is defined as).
Examples
All of the following are integers: <lsl>integer firstInt = 5512623; integer secondInt = ACTIVE; integer thirdInt = 0x61EC1A; integer fourthInt = -160693;</lsl>
The following are NOT integers, use float for them: <lsl> integer decimalValue = 125.2; // ERROR : Type mismatch -- Integer literals can't have a decimal. integer bigValue = 3147483647; // An undocumented way to say -1,147,483,649 // Integer literals can't be larger than 2,147,483,647. integer biggerValue = 10123456789; // An undocumented way to say -1 // Integer literals can't be larger than 2,147,483,647. </lsl>
The following function can be used to determine whether a string of characters consists only of integers. This can be important if you need to know that a user has entered a valid integer in chat or a textbox, for example. <lsl> integer IsInteger(string var) {
integer i; for (i=0;i<llStringLength(var);++i) { if(!~llListFindList(["1","2","3","4","5","6","7","8","9","0"],[llGetSubString(var,i,i)])) { return FALSE; } } return TRUE;
}</lsl>
Further Reading
For a more extensive coverage of integers, including the different ways they are used in LSL, see LSL in Focus: Integers.
Subcategories
This category has the following 19 subcategories, out of 19 total.
I
Pages in category "LSL Integer"
The following 200 pages are in this category, out of 658 total.
(previous page) (next page)H
I
K
L
- LAND LEVEL
- LAND LOWER
- LAND NOISE
- LAND RAISE
- LAND REVERT
- LAND SMOOTH
- LINK ALL CHILDREN
- LINK ALL OTHERS
- LINK ROOT
- LINK SET
- LINK THIS
- LIST STAT GEOMETRIC MEAN
- LIST STAT MAX
- LIST STAT MEAN
- LIST STAT MEDIAN
- LIST STAT MIN
- LIST STAT NUM COUNT
- LIST STAT RANGE
- LIST STAT STD DEV
- LIST STAT SUM
- LIST STAT SUM SQUARES
- LlGetGroup
- LOOP
O
- OBJECT ATTACHED POINT
- OBJECT ATTACHED SLOTS AVAILABLE
- OBJECT BODY SHAPE TYPE
- OBJECT CHARACTER TIME
- OBJECT CLICK ACTION
- OBJECT CREATOR
- OBJECT DAMAGE
- OBJECT DAMAGE TYPE
- OBJECT DESC
- OBJECT GROUP
- OBJECT GROUP TAG
- OBJECT HEALTH
- OBJECT HOVER HEIGHT
- OBJECT LAST OWNER ID
- OBJECT NAME
- OBJECT OMEGA
- OBJECT OWNER
- OBJECT PATHFINDING TYPE
- OBJECT PHANTOM
- OBJECT PHYSICS
- OBJECT PHYSICS COST
- OBJECT POS
- OBJECT PRIM COUNT
- OBJECT PRIM EQUIVALENCE
- OBJECT RENDER WEIGHT
- OBJECT RETURN PARCEL
- OBJECT RETURN PARCEL OWNER
- OBJECT RETURN REGION
- OBJECT ROOT
- OBJECT ROT
- OBJECT RUNNING SCRIPT COUNT
- OBJECT SCRIPT MEMORY
- OBJECT SCRIPT TIME
- OBJECT SELECT COUNT
- OBJECT SERVER COST
- OBJECT STREAMING COST
- OBJECT TEMP ON REZ
- OBJECT TOTAL INVENTORY COUNT
- OBJECT TOTAL SCRIPT COUNT
- OBJECT UNKNOWN DETAIL
- OBJECT VELOCITY
- OPT CHARACTER
- OPT AVATAR
- OPT EXCLUSION VOLUME
- OPT LEGACY LINKSET
- OPT MATERIAL VOLUME
- OPT OTHER
- OPT STATIC OBSTACLE
- OPT WALKABLE
P
- PARCEL COUNT GROUP
- PARCEL COUNT OTHER
- PARCEL COUNT OWNER
- PARCEL COUNT SELECTED
- PARCEL COUNT TEMP
- PARCEL COUNT TOTAL
- PARCEL DETAILS AREA
- PARCEL DETAILS DESC
- PARCEL DETAILS FLAGS
- PARCEL DETAILS GROUP
- PARCEL DETAILS ID
- PARCEL DETAILS NAME
- PARCEL DETAILS OWNER
- PARCEL DETAILS SEE AVATARS
- PARCEL FLAG ALLOW ALL OBJECT ENTRY
- PARCEL FLAG ALLOW CREATE GROUP OBJECTS
- PARCEL FLAG ALLOW CREATE OBJECTS
- PARCEL FLAG ALLOW DAMAGE
- PARCEL FLAG ALLOW FLY
- PARCEL FLAG ALLOW GROUP OBJECT ENTRY
- PARCEL FLAG ALLOW GROUP SCRIPTS
- PARCEL FLAG ALLOW LANDMARK
- PARCEL FLAG ALLOW SCRIPTS
- PARCEL FLAG ALLOW TERRAFORM
- PARCEL FLAG LOCAL SOUND ONLY
- PARCEL FLAG RESTRICT PUSHOBJECT
- PARCEL FLAG USE ACCESS GROUP
- PARCEL FLAG USE ACCESS LIST
- PARCEL FLAG USE BAN LIST
- PARCEL FLAG USE LAND PASS LIST
- PARCEL MEDIA COMMAND AGENT
- PARCEL MEDIA COMMAND AUTO ALIGN
- PARCEL MEDIA COMMAND DESC
- PARCEL MEDIA COMMAND LOOP
- PARCEL MEDIA COMMAND LOOP SET
- PARCEL MEDIA COMMAND PAUSE
- PARCEL MEDIA COMMAND PLAY
- PARCEL MEDIA COMMAND SIZE
- PARCEL MEDIA COMMAND STOP
- PARCEL MEDIA COMMAND TEXTURE
- PARCEL MEDIA COMMAND TIME
- PARCEL MEDIA COMMAND TYPE
- PARCEL MEDIA COMMAND UNLOAD
- PARCEL MEDIA COMMAND URL
- PASSIVE
- PASS ALWAYS
- PASS IF NOT HANDLED
- PASS NEVER
- PATROL PAUSE AT WAYPOINTS
- PAYMENT INFO ON FILE
- PAYMENT INFO USED
- PAY DEFAULT
- PAY HIDE
- PERMISSION ATTACH
- PERMISSION CHANGE LINKS
- PERMISSION CONTROL CAMERA
- PERMISSION DEBIT
- PERMISSION OVERRIDE ANIMATIONS
- PERMISSION RETURN OBJECTS
- PERMISSION SILENT ESTATE MANAGEMENT
- PERMISSION TAKE CONTROLS
- PERMISSION TELEPORT
- PERMISSION TRACK CAMERA
- PERMISSION TRIGGER ANIMATION
- PERM ALL
- PERM COPY
- PERM MODIFY
- PERM MOVE
- PERM TRANSFER
- PING PONG
- PRIM ALLOW UNSIT
- PRIM ALPHA MODE
- PRIM ALPHA MODE BLEND
- PRIM ALPHA MODE EMISSIVE
- PRIM ALPHA MODE MASK
- PRIM ALPHA MODE NONE
- PRIM BUMP BARK
- PRIM BUMP BLOBS
- PRIM BUMP BRICKS
- PRIM BUMP BRIGHT
- PRIM BUMP CHECKER
- PRIM BUMP CONCRETE
- PRIM BUMP DARK