Length

new topic     » topic index » view thread      » older message » newer message

------=_NextPart_000_000E_01C01812.96AA6040
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I was wondering if there's a way to use length in a loop:

object desc
puts(1,"Enter a number from 1-9)
desc=3Dwait_key()
for length(desc) do                -- if desc is 9 then puts 0 nine =
times.
puts(1,"0")
end for

Also, is there a way to eliminate the enter key number stored in any =
gets(0) vairable?

-Thanks
-Thomas

------=_NextPart_000_000E_01C01812.96AA6040
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I was wondering if there's a way to use =
length in a=20
loop:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>object desc</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>puts(1,"Enter a number from =
1-9)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>desc=3Dwait_key()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>for length(desc) do&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -- if desc is 9 =
then=20
puts 0 nine times.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>puts(1,"0")</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>end for</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Also, is there a way to eliminate the =
enter key=20
number stored in any gets(0) vairable?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-Thanks</FONT></DIV>

------=_NextPart_000_000E_01C01812.96AA6040--

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu