.. PCPCALL.MEX (04/16/90) .. This script performs the steps necessary to connect to the .. designated city and remote system. %m=100;. clear menu selection %u=0;. flag to show initial run thru script .. *** section omitted here *** .. Branch depending on whether we are presently connected to no .. city, to the requested city, or to a different city. if %p=0 GOTO NEWCITY;. no city connected presently if %c=%p GOTO LOCAL;. already connected to desired city .. ------------------------------------------------------------ .. .. Disconnect from wrong city .. .. ------------------------------------------------------------ %d=%p;GOSUB CITYNAME;. get name of currently connected city say "/n/nDisconnecting from ",A," . . . " %z=3;. max number of tries LABEL DROPCITY screen off sendout "/r@/r";. try to return to PCP command mode wait string 2 "@";. we should get '@' prompt if value>0 GOTO DROP1;. if we do, continue below %z=%z-1;. else decrement count .. abort if count expired if %z<1 A="Cannot quit current city";GOTO ABORT GOTO DROPCITY;. try again LABEL DROP1 screen off sendout "D/r";. tell PCP to disconnect from city %p=0;. show no city connected %v=0;. show not in Vadic mode screen on say "OK";. tell user that it worked .. ------------------------------------------------------------ .. .. Connect to new city .. .. ------------------------------------------------------------ LABEL NEWCITY screen on .. We do different things depending on whether or not we have .. exhausted the first set of attempts. if %u=0 say "/n";. end any line of screen output %u=1;. show no longer first time %e=%t;. number of tries into variable 'e' else A=" city code" gosub GETD;. gets number of times to try say "/nCalling ",F,"/n";.tell user whom we are trying to reach endif %d=%c;GOSUB CITYNAME say "/nDialing city code ",D," (",A,")";.report the city code we¨ are dialing %z=1;. count of tries %o=1;. indicate no auto stepdown yet LABEL CITYCODE if %z>%d goto MORETRIES sleep 1 screen on;say "/n try #",%z," of ",%e," at ",B,"00¨ bps...";screen off %z=%z+1 sendout "C D//";sendout D;. city code sendout "//";sendout B;. baud code sendout ",";sendout "PCP_USERID";. user id sendout ",";sendout "PCP_PW";. user password sendout "/r" wait string 4 "CONNECTED" "BUSY" "FAIL" .. If we connected, set %p to show new city connected and %u to .. indicate the first pass at connecting to the specified RAS. if value=1 %u=0;%p=%c;GOTO LOCAL screen on if value=3 say "Failed Call";goto MORETR1 if value=2 say "Busy" if value=0 say "No Response" goto CITYCODE LABEL MORETRIES if %n=0 goto MORETR1;. no auto step down if %o=0 goto MORETR1;. already stepped down %o=0;. show now stepped down if %b=2400 B="12";%z=1;GOTO CITYCODE;. reset trial count %z LABEL MORETR1 A=" city code" GOSUB ASKMORE if value=1 GOTO NEWCITY;. try again to reach new city READ PCPMENU;. else chain back to main menu .. ------------------------------------------------------------ .. .. In right city; try connecting to specified system .. .. ------------------------------------------------------------ LABEL LOCAL screen on %d=%p;GOSUB CITYNAME say "/n/nConnected to city code ",D," (",A,")" .. initialize destination modem to make sure it is still alive if %v=2;. if in Vadic mode, reinitialize modem sendout "I/r";. exit from it %v=0;. show initialized modem sleep 1 endif LABEL REINIT %z=3;. max attempts to initialize modem LABEL REINIT1 if %z<1 A="Remote modem failure";goto ABORT %z=%z-1 screen on;say "/n initialize remote modem... ";screen off sleep 1 sendout "ATZ/r" wait string 3 "OK" if value=0 goto REINIT1 .. Call destination system LABEL LOCALAGAIN .. *** section omitted *** LABEL DIAL sendout "^E/r";. enter Vadic mode wait string 3 "*" screen on if value=0 say "/nVadic Mode Failed/n";goto REINIT say "/nRemote modem now in Vadic Mode" %v=2;. show Vadic mode LABEL DIAL1 %r=0;. initialize ring count screen on;say "/n/nTry #",%z," of ",%e," (at ",B,"00 bps)/n" sendout "D";sendout E;sendout "/r" LABEL DIAL2 screen on wait string 25 "ANSWER" "BUSY" "DIAL TONE" "RINGING..." if value=1 goto SUCCESS if value=2 goto BUSY if value=3 goto DIALTONE if value<>4 goto BADCODE .. *** many routines omitted *** LABEL SUCCESS screen on say "^G/n/nCONNECTED TO HOST SYSTEM/n/n" READ PCPCONN;. chain to short script to free memory .. ---------- Subroutines .. Ask user for the number of times to connect and put answer is .. %e. If the answer is less than 1, then use a value of 1. PROC GETD say "/nTry how many times to connect to",A,"? " input %e=value if %e<1 %e=1 ENDP .. Ask if user wants to continue trying to connect. Return with .. the answer in VALUE, 1 if YES, 0 if NO. PROC ASKMORE LABEL ASKAGAIN screen on say "/n/nTry",A," some more (Y//N)? " bell 1 accept C,1 screen off comp C "Y" if value=1 ENDP comp C "N" if value=1 value=0;ENDP bell 1 goto ASKAGAIN .. *** remaining routines omitted ***