Difference between revisions of "LlList2Vector/fr"

From Second Life Wiki
Jump to navigation Jump to search
(Localized to french)
 
m (Robot: <pre> -> <lsl>)
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
|func_footnote=Si l’élément du list '''src''' n’est pas un vector, alors la fonction renvoie {{LSLG/fr|ZERO_VECTOR|<0.0, 0.0, 0.0>}} (idem si l’index est hors limite).<br/> Dans ce cas, utilisez : ({{LSLG/fr|vector}}){{LSLG/fr|llList2String}}(src, index);
|func_footnote=Si l’élément du list '''src''' n’est pas un vector, alors la fonction renvoie {{LSLG/fr|ZERO_VECTOR|<0.0, 0.0, 0.0>}} (idem si l’index est hors limite).<br/> Dans ce cas, utilisez : ({{LSLG/fr|vector}}){{LSLG/fr|llList2String}}(src, index);
|func_desc
|func_desc
|return_text=correspondant à l’élément de l’'''index''' du list '''src'''.
|return_text=correspondant à l’élément de '''src''' à l''''index''' identifié .
|spec
|spec
|caveats=*Quand la fonction tente de convertir un string, elle renvoie un [[ZERO_VECTOR/fr|ZERO_VECTOR]]
|caveats=*Quand la fonction tente de convertir un string, elle renvoie un [[ZERO_VECTOR/fr|ZERO_VECTOR]]
** La syntaxe suivante résoud le problème (avec une véritable conversion) ([[vector/fr|vector]]){{LSLG/fr|llList2String}}(src, index);
** La syntaxe suivante résoud le problème (avec une véritable conversion) ([[vector/fr|vector]]){{LSLG/fr|llList2String}}(src, index);
|constants
|constants
|examples=<pre>// Mieux visible dans l’historique du chat (ctrl-h)
|examples=<lsl>// Mieux visible dans l’historique du chat (ctrl-h)
default
default
{
{
Line 27: Line 27:
         }
         }
     }
     }
}</pre>
}</lsl>
|helpers
|helpers
|also_functions={{LSL DefineRow|[[llGetListEntryType/fr|llGetListEntryType]]|Renvoie le type d’un élément d’un list}}
|also_functions={{LSL DefineRow|[[llGetListEntryType/fr|llGetListEntryType]]|Renvoie le type d’un élément d’un list}}

Latest revision as of 20:14, 4 August 2009

Description

Fonction: vector llList2Vector( list src, integer index );

Renvoie un vector correspondant à l’élément de src à l'index identifié .

• list src
• integer index

index accepte les index négatifs.
Si l’élément du list src n’est pas un vector, alors la fonction renvoie <0.0, 0.0, 0.0> (idem si l’index est hors limite).
Dans ce cas, utilisez : (vector)llList2String(src, index);

Spécifications

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

Avertissements

  • Quand la fonction tente de convertir un string, elle renvoie un ZERO_VECTOR
    • La syntaxe suivante résoud le problème (avec une véritable conversion) (vector)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 d’un list
• llList2String Renvoie un élément d’un list

Articles

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