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 do I send multiple files using ASPECT?

Status
Not open for further replies.

bdsopt

Technical User
May 31, 2002
10
US
Hello:

I'm current using 4.8 to fax files from the A:\ to various companies. I've created a radiobutton for every company including a ALL button to fax to the entire list. If I chose each company individually the program works fine but the ALL function does not. The ALL program performs a search on the A:\ but doesn't want to start the fax process. Here is my code for the ALL function:

proc SendToAll
string fname = "a:\*.doc"
string coname = ""
string temp
long sizeoffile = 0 ;to check that filesize is not 0 before sending

if findfirst fname
fname = $FILENAME
coname = ""
coname = GetConameFname(Coname, Fname)
if not nullstr coname
if not nullstr fname
fileget fname SIZE sizeoffile
if sizeoffile > 0
temp = "a:\*.doc"
strcat temp fname
faxsend DIALDIR coname SINGLE temp
SendTheFax(fname,coname)
pause 30
endif
endif
endif
; set coname based off the filename use SendTheFax function to send the faxes
while findnext
fname = $FILENAME
coname = ""
coname = GetConameFname(Coname, Fname)
if not nullstr Coname
if not nullstr Fname
fileget fname SIZE sizeoffile
if sizeoffile > 0
temp = "a:\*.doc"
strcat temp Fname
faxsend DIALDIR coname SINGLE temp
SendTheFax(fname,coname)
pause 30
endif
endif
endif
endwhile
else
usermsg "No files on disk!"
endif
endproc

Any help would be appreciated.

Thanks,
Brad
 
My hunch is that your problem is due to the faxsend command needing:

while $FAXSTATU
yield
endwhile

after it, similar to the while loop that needs to be placed after a file transfer to "pause" the script while the transfer (or fax, in your case) is ongoing. I haven't tested this yet, but what I think is happening is that the first fax is being created and while that process is underway, the second fax is being created and may be having issues since the first fax operation is still underway. Also, I'm not sure what the SendTheFax procedure is doing, so that could be causing some unexpected interaction as well. Is that procedure used when only a single recipient is chosen?

Do any faxes ever get created in the outbox of Fax Manager? Try adding the while loop I mention above (you can see how it's used by looking at the example for the faxsend command in the ASPECT help file) and see if that clears up the problem.

One other possible thing to try is adding all of the Connection Directory entries to a group in the directory, and then dial that group in the faxsend command, instead of dialing each entry separately.
 
I've added the step above with the same results. Yes, the SendTheFax procedure is called when a single entry is choosen from the menu...which works just fine. Maybe this doens't need to be in the SendToAll procedure?

When I do choose a single entry Procomm starts up the Fax Status window and begins to fax the file from the A:\. If I open up Fax Manager I do see the file in the outbox folder.

Here is the change that I made:

proc SendToAll
string fname = "a:\*.doc"
string coname = ""
string temp
long sizeoffile = 0
;to check that filesize is not 0 before sending

if findfirst fname
fname = $FILENAME
coname = ""
coname = GetConameFname(Coname, Fname)
if not nullstr coname
if not nullstr fname
fileget fname SIZE sizeoffile
if sizeoffile > 0
temp = "a:\*.doc"
strcat temp fname
faxsend DIALDIR coname SINGLE temp
while $FAXSTATUS
yield
endwhile
SendTheFax (fname, coname)
pause 30
endif
endif
endif
; set coname based off the filename use SendTheFax function to send the faxes
while findnext
fname = $FILENAME
coname = ""
coname = GetConameFname(Coname, Fname)
if not nullstr Coname
if not nullstr Fname
fileget fname SIZE sizeoffile
if sizeoffile > 0
temp = "a:\*.doc"
strcat temp Fname
faxsend DIALDIR coname SINGLE temp
while $FAXSTATUS
yield
endwhile
SendTheFax(fname,coname)
pause 30
endif
endif
endif
endwhile
else
usermsg "No files on disk!"
endif
endproc

Any other suggestions or ideas?
 
Can you post what the SendTheFax procedure looks like? I think you can just remove the SendTheFax procedure calls (both of them) from the SendToAll procedure, but want to see what the SendTheFax procedure looks like first. Also, you might want to do some checking on what GetConameFname is returning, just to make sure you are getting a valid name back from the Connection Directory.

Everything else looks OK to me, I'll try it on my home machine tonight if you are still running into problems with the script (no modem on my work machine).
 
Here is my SendTheFax procedure:

proc SendTheFax
param string fname
param string coname
string temp ;temporary string for file concatinations
long sizeoffile = 0
;to check that filesize is not 0 before sending

temp = "a:\"
strcat temp fname

if isfile temp
fileget temp SIZE sizeoffile
if sizeoffile > 0
;usermsg "filefound! attempting to send fax"
faxsend DIALDIR coname SINGLE temp
else
temp = "File '"
strcat temp fname
strcat temp "' for '"
strcat temp coname
strcat temp "' is empty!"
usermsg temp
endif
else
temp = "File '"
strcat temp fname
strcat temp "' not found!"
usermsg temp
endif

endproc ; and exit the script file.

Thanks for your help!

Brad
 
Looks like I forgot about this one! Did you get the script working OK?
 
Yes I did. I added the values:

temp = "a:\"
strcat temp fname
fileget temp SIZE sizeoffile
if sizeoffile > 0
faxsend DIALDIR coname SINGLE temp
while $FAXSTATUS
yield
endwhile
else

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top