=> Quoting LANCE REYNOLDS to DOUG WILSON <=-
-=> FidoMail to 1:163/215, please.-=<
LR> if (track_hit(t8))
LR> {
LR> n3 = n3 - 1;
LR> if (n3 == 3)
LR> {
LR> cputs("U");
LR> filefind(fspec, 0, buf);
LR> if (buf == "SHAKEY.REP")
LR> {
LR> delay(30);
LR> send('Z', fspec);
LR> fdelete("c:\UPLD\SHAKEY.REP");
LR> }
LR> else
LR> {
LR> waitfor(".",10);
LR> cputs("^x^x^x^x^x^x^x^x^x^x^x^x");
LR> }
LR> }
LR> if (n3 == 2) //this is suppose to start dld on the second
LR> cputs("D"); //hit of the qwk track.
LR> if (n2 == 1)
LR> cputs("q"); //this is suppose to quit back to the message
LR> track_free(t8); //menu on the 3rd hit of the qwk track
If I might suggest something here....
You're building a loop to handle an upload, a download, and then to
leave the QWK area - and that just complicates what is actually a
simple procedure. Here's what my scripts do after completing the
"login" process:
1) Issue the commands to get to the QWK area and track for the
appropriate prompt.
2) See if there's a packet to upload. If there is, call the upload
subroutine.
3) If not, call the download subroutine.
4) Leave the QWK area.
Here's a code snippet:
//
// Leaves us at the BlueWave door
//
waitfor("to continue...",150);
cputs("^M");
waitfor("Select:",100);
if (fileattr(up_file) > 0)
{
do_up(); // Do the standard upload
if (sflag > 0) fdelete(up_file);
}
do_down(); // Do the standard download
track_free (0);
----- snip -----
do_up()
{
int status=0;
track_free (0);
cputs("U");
trk6=track("Select:",1);
waitfor("*00",100);
result = Send('Z', up_file);
while (carrier() != 0)
{
terminal();
stat=track_hit(0);
if (stat==trk6) // Back to BWave menu
}
return;
}
// _______________________________________________________________
// *** DO_DOWN ***
// This function downloads new mail packets and any files that
// may have been requested.
// _______________________________________________________________
do_down()
{
int status = 0;
track_free(0);
delay_scr(10);
cputs("D");
// Wait for mail to be bundled
trk2 = track("Select:",1);
trk1 = track(bwcol,1);
while (carrier())
{
terminal();
stat = track_hit (0);
if (stat == trk1)
{
cputs("^M");
track_free(trk1);
}
else if (stat == trk2)
{
cputs("^M");
goto dn1;
}
}
return;
dn1:
track_free(0);
//
// Now wait for the mail download to complete
//
trk1 = track("Select:",1);
while(carrier())
{
terminal();
if(track_hit(trk1)) goto dn2;
}
return;
dn2:
track_free(0);
cputs("G");
return;
}
Mine's a little different from what you need because I'm accessing a
BlueWave door, so the sequence of events is a little more complex.
But the basic idea is still there. The subroutines allow you to
better manage what's happening. Yes, you may initiate the same
"track" command more than once, but so what? Your loop is "elegant",
but sometimes a straightforward approach is better. :-)
You may see some "funny" stuff in my script. That's because theres a
portion that I've excised from it that exists for a special situation
that I have to deal with and the code in that section was "paid for"
by someone, and therefore isn't in the public domain. I've also
hacked out the stuff that looks to see it the user has requested a
"file" download and upload as well, and that results in the "trk"
numbers looking a little odd.
TTFN. Rick.
Ottawa, ON 31 May 11:08
--- Blue Wave/DOS v2.20
---------------
* Origin: BitByters BBS, Rockland ON, Can. (613)446-7773 v34, (1:163/215)
|