LlList2Integer/fr

From Second Life Wiki
< LlList2Integer
Revision as of 20:14, 4 August 2009 by Wiki Scribe (talk | contribs) (Robot: <pre> -> <lsl>)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

Fonction: integer llList2Integer( list src, integer index );

Renvoie un integer correspondant à l’index du list src.

• list src
• integer index

index accepte les index négatifs.
Si l’élément correspondant à l’index du list src n’est pas un integer, il est converti. S’il ne peut être converti, la fonction renvoie zéro.

Spécifications

Index Positif Negatif
Premier 0 - longueur
Dernier longueur - 1 -1

Avertissements

  • Quand la fonction est utilisée avec un string, seul les integers en notation simple sont reconnus, elle ne traitera pas les integers en format hexadécimal.
    • Dans ce cas, utilisez la syntaxe (integer)llList2String(src, index);

Exemples

<lsl>// Mieux visible dans l’historique du chat (ctrl-h) default {

   state_entry()
   {
       list my_list = ["a", 1, 2.0, <1,2,3>, <1,2,3,4>, llGetOwner()];
       integer i;
       for (i=0;i<llGetListLength(my_list); ++i)
       {
           llOwnerSay("string=" + llList2String(my_list,i)
                       + "\n   integer=" + (string)llList2Integer(my_list,i)
                       + "\n   float=" + (string)llList2Float(my_list,i)
                       + "\n   vector=" + (string)llList2Vector(my_list,i)
                       + "\n   rot=" + (string)llList2Rot(my_list,i)
                       + "\n   key=" + (string)llList2Key(my_list,i) );
       }
   }

}</lsl>

Voir également

Fonctions

•  llGetListEntryType Renvoie le type d’un élément de list
•  llList2Float Extrait un élément d’un list
•  llList2String Extrait un élément d’un list

Articles

•  Negative_Index
Vous cherchez encore des informations ? Peut-être cette page du LSLwiki pourra vous renseigner.