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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to dial only a certain number of times

Status
Not open for further replies.

ppeel

Programmer
Dec 7, 2004
18
US
I have a simple script that dials a number until it gets a connection. I want to limit the number of times it tries to connect. How do I do that?

Current code:

Dial DATA "XXXXXX"
while $DIALING ; Loop while dialing.
endwhile

if $connectopen ; See if we're connected.
DownloadFiles() ; Goto downloadfiles proc
 
Here's one way to do it:

for iLoop = 1 upto X
Dial DATA "XXXXXX"
while $DIALING ; Loop while dialing.
yield
endwhile

if $connectopen ; See if we're connected.
DownloadFiles() ; Goto downloadfiles proc
exitfor
endif
endfor

You would need to change X to the number of times you want the script to try to dial and also define an integer variable called iLoop.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top