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

Dialling From Connection Directory

Status
Not open for further replies.

KeithFrench

Programmer
Jul 20, 2001
25
GB
When dialling from an ASPECT script (V4.8) I use the syntax

dial data EntryName

How can I check that the script has actually found an entry in the directory called "EntryName"? The documentation does not seem to say it will generate the usuall SUCESS or FAILURE conditions. Any ideas?
 
Keith,

See if this Helps..

;* Is File in Directory
;* Show User ( Test Script )

proc Main
integer x
string Junk
clear
if isfile "C:\TEXT FILES\Delout.txt"
x=0
usermsg " Found File in Text Files"
strfmt Junk "%d" x
termwrites Junk
termwrites "`n`r"
else
x=1
usermsg " No File Found !"
strfmt Junk "%d" x
termwrites Junk
termwrites "`r`n"
endif
endproc

Let me Know..

Hank
 
Keith,

Played with Script some more and thought I would add this in case it might help.

;* Is File in Directory
;* Show User ( Test Script )
;* Is 5551212 in Information.txt

proc Main
integer x
string Junk
string sLine
string sNumber
clear
if isfile "C:\TEXT FILES\DIALDIR\5551234\INFORMATION.TXT"
fopen 1 "C:\TEXT FILES\DIALDIR\5551234\INFORMATION.TXT" READ TEXT
while not feof 1
fgets 1 sLine
if strfind sLine "5551212"
sNumber=sLine
x=0 ; Found it
endif
endwhile
fclose 1
usermsg " 5551212 Found in File"
strfmt Junk "%d %s" x sNumber
termwrites Junk
termwrites "`n`r"
else
x=1 ; Not there
usermsg " Information.txt File Not Found !"
strfmt Junk "%d" x
termwrites Junk
termwrites "`r`n"
endif
endproc

Hank
 
Keith,

Sorry.. I lead you astray... This One does work... Too Many hours at work...

;* Is File in Directory
;* Show User ( Test Script )
;* Is 5551212 in Information.txt

proc Main
integer x
string Junk
string sLine
string sNumber
clear
if isfile "C:\TEXT FILES\DIALDIR\5551234\INFORMATION.TXT"
fopen 1 "C:\TEXT FILES\DIALDIR\5551234\INFORMATION.TXT" READ TEXT
while not feof 1
fgets 1 sLine
if strfind sLine "5551212"
sNumber=sLine
x=0 ; Found it
usermsg " 5551212 Found in File"
strfmt Junk "%d %s" x sNumber
termwrites Junk
termwrites "`n`r"
else
x=1 ; Not there
usermsg " 5551212 Not Found !"
strfmt Junk "%d" x
termwrites Junk
termwrites "`r`n"
endif
endwhile
endif
fclose 1
endproc
 
Darn, I'm going on Vacation.... Got the Bugs Out Finally !!! Sorry for the Confusion..

;* Is File in Directory
;* Show User ( Test Script )
;* Is 5551212 in Information.txt

proc Main
integer x
string Junk
string sLine
string sNumber
clear
if isfile "C:\TEXT FILES\DIALDIR\5551234\INFORMATION.TXT"
fopen 1 "C:\TEXT FILES\DIALDIR\5551234\INFORMATION.TXT" READ TEXT
while not feof 1
fgets 1 sLine
if strfind sLine "5551212"
sNumber=sLine
x=0 ; Found it
usermsg " 5551212 Found in File"
strfmt Junk "%d %s" x sNumber
termwrites Junk
termwrites "`n`r"
else
x=1 ; Not there
usermsg " 5551212 Not Found !"
strfmt Junk "%d" x
termwrites Junk
termwrites "`r`n"
endif
endwhile
fclose 1
else
Usermsg "Information.txt File NOT Found !!"
endif
endproc
 
It looks to me like the dial command does return success if the entry is found in the Connection Directory and failure if the entry does not exist. However, the dial command can return failure even if the entry name was found if some other error occurs, such as a dialing or file transfer operation is already underway.

You could use the dialfind command to search for an entry and then check for the success or failure of the dialfind command before dialing the entry in question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top