Re: Length

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

------=_NextPart_000_000D_01C0182F.E5F45B20
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hi Thomas
Try this:

object desc
puts(1,"Enter a number from 1-9)
desc=3Dwait_key()
for i =3D 1 to length(desc) do                -- if desc is 9 then puts =
0 nine times.
puts(1,"0")
end for
  ----- Original Message -----=20
  From: Paul Kerslake=20
  To: EUPHORIA at LISTSERV.MUOHIO.EDU=20
  Sent: Wednesday, September 06, 2000 2:56 PM
  Subject: Length


  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_000D_01C0182F.E5F45B20
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Hi Thomas</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Try this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&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 i =3D 1 to 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></FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dpaulk at UNISERVE.COM href=3D"mailto:paulk at UNISERVE.COM">Paul =
Kerslake</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3DEUPHORIA at LISTSERV.MUOHIO.EDU=20
  =
</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Wednesday, September 06, =
2000 2:56=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Length</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>I was wondering if there's a way to =
use length in=20
  a 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; =

  &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>
  <DIV><FONT face=3DArial =

------=_NextPart_000_000D_01C0182F.E5F45B20--

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

Search



Quick Links

User menu

Not signed in.

Misc Menu