Difference between revisions of "LlGetListEntryType"

From Second Life Wiki
Jump to navigation Jump to search
(I think "ditto" might cause problems for our translators)
m
Line 12: Line 12:


|constants=
|constants=
{{{!}}
{{LSL_Constants/ListEntryType}}
{{!}}- valign="top"
{{!}}
{{{!}}{{Prettytable}}
{{!}}-{{Hl2}}
!colspan="2"{{!}}Type
!Description
{{!}}-
{{!}}{{LSL Const|TYPE_INTEGER|integer|1|c=integer}}
{{!}}{{#var:value}}
{{!}}[[integer]]
{{!}}-
{{!}}{{LSL Const|TYPE_FLOAT|integer|2|c=float}}
{{!}}{{#var:value}}
{{!}}[[float]]
{{!}}-
{{!}}{{LSL Const|TYPE_STRING|integer|3|c=string}}
{{!}}{{#var:value}}
{{!}}[[string]]
{{!}}}
{{!}}
{{{!}}{{Prettytable}}
{{!}}-{{Hl2}}
!colspan="2"{{!}}Type
!Description
{{!}}-
{{!}}{{LSL Const|TYPE_KEY|integer|4|c=key}}
{{!}}{{#var:value}}
{{!}}[[key]]
{{!}}-
{{!}}{{LSL Const|TYPE_VECTOR|integer|5|c=vector}}
{{!}}{{#var:value}}
{{!}}[[vector]]
{{!}}-
{{!}}{{LSL Const|TYPE_ROTATION|integer|6|c=rotation}}
{{!}}{{#var:value}}
{{!}}[[rotation]]
{{!}}}
{{!}}
{{{!}}{{Prettytable}}
{{!}}-{{Hl2}}
!colspan="2"{{!}}Type
!Description
{{!}}-
{{!}}{{LSL Const|TYPE_INVALID|integer|0|c=none}}
{{!}}{{#var:value}}
{{!}}{{#var:comment}}
{{!}}}
{{!}}}
|examples
|examples
|helpers
|helpers

Revision as of 12:15, 24 April 2009

Summary

Function: integer llGetListEntryType( list src, integer index );

Returns an integer that is the type of the entry index in src.

• list src List containing the element of interest.
• integer index Index of the element of interest.

index supports negative indexes.
If index describes a location not in src then TYPE_INVALID is returned.

Specification

Index Positive Negative
First 0 -length
Last length - 1 -1

Indexes

  • Positive indexes count from the beginning, the first item being indexed as 0, the last as (length - 1).
  • Negative indexes count from the far end, the first item being indexed as -length, the last as -1.

Type Description
TYPE_INTEGER 1 integer
TYPE_FLOAT 2 float
TYPE_STRING 3 string
TYPE_KEY 4 key
TYPE_VECTOR 5 vector
TYPE_ROTATION 6 rotation
TYPE_INVALID 0 none

Caveats

  • If index is out of bounds the script continues to execute without an error message.If a vector is stored in a list as "<7,5,0>" (as opposed to <7,5,0>), its type will be returned as TYPE_STRING, not TYPE_VECTOR. The same applies for "1" being returned as a string instead of an integer, etc. There is no easy way to guess what the type could be from a string value.
All Issues ~ Search JIRA for related Bugs

Examples

See Also

Functions

•  llList2Float
•  llList2Integer
•  llList2Key
•  llList2Rot
•  llList2String
•  llList2Vector

Articles

•  Negative Index

Deep Notes

Search JIRA for related Issues

Signature

function integer llGetListEntryType( list src, integer index );