Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if..then within do until...loop?

Status
Not open for further replies.

yayawatson

Technical User
Apr 11, 2003
4
US
Is it possible to write a conditional statement within a do until loop?
 
umm.. yes

you can write as many conditional statements in as many loops as you like

that is until you get so deep in them you get all backwards and forget what you were trying to validate for. [lol]

_________________________________________________________
$str = "sleep is good for you. sleep gives you the energy you need to function";
$Nstr = ereg_replace("sleep","coffee",$str); echo $Nstr;

onpnt2.gif
[/sub]
 
do
a=a+1
if a = 7 then
exit do
else
a = a * a
end if
until a >= 20

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
 
The reason I asked that is because I have a do until..loop where the conditional part of the loop doesn't work. Here is the code:

do until rs.eof
'Set the variables
iret = iim.iimSet("-var_case", rs.fields(0))
'Run the macro
iret = iim.iimPlay("pacersearch")
iret = iim.iimGetLastMessage()
if iret = "Chapter 13" then
iret = iim.iimPlay("pacercase")
Dim data1
Dim s
data1 = iim.iimGetLastMessage() s = data1
objOutputFile.WriteLine(s)
End If
rs.movenext
loop

Do you know why it won't work? Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top