LlList2String/fr
From Second Life Wiki
| Portail LSL | | | Fonctions | | | Évènements | | | Types | | | Constantes | | | Contrôle d'exécution | | | Bibliothèque de scripts | | | Tutoriels |
Fonction: string llList2String( list src, integer index );
| 188 | N° de fonction |
| 0.0 | Délai |
| 10.0 | Energie |
Renvoie un correspondant à l’élément à l’index du src.
| • list | src | |||
| • integer | index |
index accepte les index négatifs.
Si l’élément du list src n’est pas un string, il est alors converti en string.
Si l’index est hors de portée, la fonction renvoie un string null.
Exemples
//ce code illustre les différentes conversions dans le LSL (et l’utilisation des fonctions llList2* ). // Mieux visible dans l’historique du chat (ctrl-h) default { state_entry() { list my_list = ["a", "0xFF", "0xFF.FF", "1.0e3", 1, 2.0, <1,2,3>, <1,2,3,4>, llGetOwner()]; integer i = 0; integer end = llGetListLength(my_list); for (; i<end; ++i) { llOwnerSay("string=" + llList2String(my_list,i) + "\n integer=" + (string)llList2Integer(my_list,i) + " OR " +(string)((integer)llList2String(my_list,i)) + "\n float=" + (string)llList2Float(my_list,i) + " OR " +(string)((float)llList2String(my_list,i)) + "\n vector=" + (string)llList2Vector(my_list,i) + " OR " +(string)((vector)llList2String(my_list,i)) + "\n rot=" + (string)llList2Rot(my_list,i) + " OR " +(string)((rotation)llList2String(my_list,i)) + "\n key=" + (string)llList2Key(my_list,i) + " OR " +(string)((key)llList2String(my_list,i)) ); } } }
Notes
Pour convertir un string au format hexadécimal en integer, utilisez llList2String puis convertissez le résultat en integer : "(integer)valeur" Pour convertir cet integer en hexadécimal, utilisez hex.
Voir également
Fonctions
| • llGetListEntryType | Renvoie le type d’un élément de list | |||
| • llList2Float | Renvoie un élément de list | |||
| • llList2Integer | Renvoie un élément de list | |||
| • llList2Key | Renvoie un élément de list |
Articles
| • | Negative_Index |

