LSL – String e Listas
Olá continuando falando sobre tipos de dados vou falar um pouco sobre String e Listas(list) usando Dialog apenas para servir de exemplo:
integer channel = 96;//tipo de dado integer<br /> list botoes = ["Um","Dois","Tres"];//tipo de dado list<br /> string texto = "Clique nos botoes";//tipo de dado string</p> <p>default<br /> {<br /> state_entry()<br /> {<br /> llListen(channel,"",llDetectedKey(0),"");<br /> }<br /> touch_start(integer total_number)<br /> {<br /> llDialog(llDetectedKey(0),texto,botoes,channel);<br /> }</p> <p>listen(integer channel, string name, key id, string message)<br /> {<br /> if(message == "Um"){ llSay(0,"CLicou no botao Um");}<br /> if(message == "Dois"){ llSay(0,"CLicou no botao Dois");}<br /> if(message == "Tres"){ llSay(0,"CLicou no botao Tres");}<br /> }<br /> }</p>
No exemplo acima vemos.
list botoes = ["Um","Dois","Tres"];
Que nada mais é uma lista de dados , que no caso são string , mais poderia ser por exemplo:
list lista= [1,2,3];//lista com numeros<br /> default<br /> {<br /> state_entry()<br /> {<br /> llSay(0, "Carregou!!");<br /> }<br /> touch_start(integer total_number)<br /> {<br /> llSay(0,(string)lista);<br /> }<br /> }</p>
Admin

0 Comments For This Post
1 Trackbacks For This Post
[...] LSL – String e Listas [...]
Leave a Reply