the ever elusive spanish while loop(inside a function):
ActionScript Code:
[FONT=Courier New][LEFT]</p>
<p>function ExaminarTexto[COLOR=#66cc66]([/COLOR]Texto, Buscar, remplazar[COLOR=#66cc66])[/COLOR] [COLOR=#66cc66]{[/COLOR]</p>
<p> [COLOR=#808080]//trace(“hola”)</p>[/COLOR]
<p> Posicion = Texto.[COLOR=#0066cc]indexOf[/COLOR]COLOR=#66cc66[/COLOR];</p>
<p> [COLOR=#b1b100]while[/COLOR] [COLOR=#66cc66]([/COLOR]Posicion != -[COLOR=#cc66cc]1[/COLOR][COLOR=#66cc66])[/COLOR] [COLOR=#66cc66]{[/COLOR]</p>
<p> Cadena1 = Texto.[COLOR=#0066cc]slice[/COLOR][COLOR=#66cc66]([/COLOR][COLOR=#cc66cc]0[/COLOR], COLOR=#66cc66[/COLOR][COLOR=#66cc66])[/COLOR];</p>
<p> Cadena2 = Texto.[COLOR=#0066cc]slice[/COLOR]COLOR=#66cc66[/COLOR];</p>
<p> Texto = Cadena1+remplazar+Cadena2;</p>
<p> Posicion = Texto.[COLOR=#0066cc]indexOf[/COLOR]COLOR=#66cc66[/COLOR];</p>
<p> [COLOR=#66cc66]}[/COLOR]</p>
<p> [COLOR=#b1b100]return[/COLOR] COLOR=#66cc66[/COLOR];</p>
<p>[COLOR=#66cc66]}[/COLOR]</p>
<p>
[/LEFT]
[/FONT]
if your boss has never dropped FLAs on you that are coded in spanish be prepared. it’s not as bad as it looks. they’re just variables right?
notice what the dude uses for his trace() testing. lol.