home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / comm / brc_3asp.zip / EXECAUTO.ASP next >
Text File  |  1993-05-28  |  24KB  |  667 lines

  1. ; Script File: EXECAUTO.ASP
  2.  
  3. comment  ; begin a comment block
  4.   Note: This script is written for ProComm Plus version 2.  !!!
  5.   It does the following things:
  6.    ■ reads my personal mail and leaves it marked for the QWK facility
  7.      to pick up.
  8.    ■ displays the new files in selected collections.
  9.    ■ does downloads, access displays, and extra information displays in
  10.      selected collections.
  11.    ■ downloads new messages via the QWK door.
  12.    ■ uploads any replies I have written.
  13.  
  14.   It also takes into account the new display mode in the file system
  15.   where there is a letter and a space in front of the file names as well
  16.   as the apparent '50 files at a time' limit on downloads.
  17.  
  18.   This script can be used in a cold-start mode (let it do the dialing
  19.   in an unattended session) -or- it can be called up after a connection
  20.   is made (you must be at the main menu).  For instance, I sometimes start
  21.   a call from my 'get connected and log-on' script to read/send/answer
  22.   messages, do file scans or whatever and then invoke this script so
  23.   that it can do the rest of my business for me.
  24.  
  25.   This script is written for a modem that uses the Hayes/AT command set.
  26.   If your modem is different, change the dialing command and response code.
  27.  
  28.   *****  Instant commands must be "on" on EXEC-PC.          *****
  29.   *****  Your download protocol on EXEC-PC must be Zmodem.  *****
  30.   *****  You should be logged into your download directory. *****
  31.  
  32.   The files 'EXECFILE.?, 'EXECEXTR.?' and 'EXECACCS.?' used in the 
  33.   (D)ownload, (E)xtra info and (A)ccess procedures respectively contain 
  34.   filenames and descriptions.  I build them with the LIST program, 
  35.   selecting and writing/appending lines to them while viewing file lists 
  36.   in logfiles.  After the downloads are finished for each file area, 
  37.   It appends the EXECFILE.? file to another file named 'download.log'.
  38.   The leading letter and space, if any, are stripped off.
  39.   A program runs at the end of the script that inserts these descriptions
  40.   into the downloaded ZIP files and changes the DATE/TIME of the ZIP
  41.   files to the date/time of the newest file each contains.
  42.  
  43.   EXECFILE.*/EXECEXTR.*/EXECACCS.* (and 'download.log') look like this:
  44. JOKIN-31.ZIP  28383 110591 JOKIN AROUND JOKE SERIES  #31
  45. EXECSRCH.ZIP  27984 123188+SEARCH EXEC-PC LISTINGS FOR STRINGS - OFFLINE SAVE
  46. XFERNREV.ZIP   7660 020689 UTILITY TO REVERSE ORDER OF EXEC-PC XFER.ARC FILES
  47.  
  48.  The file extension is the letter of the file area.  This script uses:
  49.       ..... Regular collections .....
  50.  (A) [NDEA] Mahoney IBM Compatible MS-DOS    
  51.  (B) [ DEA] FREE! - DOWNLOAD LISTS           
  52.  (C) [ DEA] FREE! - UTILITIES AND VARIETY    
  53.  (D) [NDEA] MS Windows                       
  54.  (G) [NDEA] Adult Pictures & Files PG,R,X    
  55.  (H) [NDEA] Picture files (.GIF,.PIC,etc)    
  56.  
  57.       ..... CD-ROM collections .....
  58.  (A) [ DEA] >> ALL CD-ROMs Combined!
  59.  (B) [ DEA] >> ALL ADULT CD-ROMs Combined!
  60.  
  61.   As noted within the brackets:
  62.      N = Do a (N)ew files list
  63.      D = Do a (D)ownload
  64.      E = Do an (E)xtra info
  65.      A = Do an (A)ccess
  66. endcomment   ; end the comment block
  67.  
  68. ;  start of script processing  *******************************************
  69. define MaxDlCount 50 ; maximum # of files that can be downloaded at one shot
  70. define DownLog "c:\pcplus\download.log"        ; name of d/l log file
  71. define QwkDlDir "c:\pcplus\download\" ; download directory for mail file
  72. define QwkUlName "c:\pcplus\download\execpc.rep"
  73. ; ************************************************************************
  74. proc main          ; Let's get started.
  75. string QwkDlName
  76. string QwkNewName
  77. string ExecMmDd = "EXEC"
  78.  
  79. restart:           ; we may come back here if we lose our connection
  80.  
  81. ; These two 'when' statements are active for the life of the call.
  82. when 0 "Press any key to continue ->" transmit "^M"
  83. when 1 "More? ([Y]/Stop/Continuous"   transmit "~~~~~~C"
  84.  
  85. substr S0 $DATE 0 2     ; extract month
  86. strcat ExecMmDd S0      ; add month to name
  87. substr S0 $DATE 3 2     ; extract day
  88. strcat ExecMmDd S0      ; add day to name
  89.  
  90.  
  91. if connected       ; this statement allows use of this script during a call
  92.    goto do_files   ; skip the log open/dialing/mail procedures
  93.    endif
  94.  
  95. call execlogon                    ; get connected and log on
  96.  
  97. ; I expect to get new bulletins in the QWK mail packet ...
  98. ;transmit ";"                      ; should be at Top Menu
  99. ;waitfor "Chain->"
  100. ;transmit "~~B;*^M"                ; read bulletins
  101. ;waitquiet 10 forever              ; end of bulletins
  102. ;transmit "q"                      ; quit bulletin menu
  103. ;waitfor "?=HELP)"                 ; wait for top command
  104.  
  105. ; Read my personal mail (if any) and leave it marked for later retrieval
  106. transmit ";"
  107. waitfor "Chain->"
  108. transmit "R;N^M"
  109. waitquiet 15 forever   ; wait forever for 15 seconds of quiet
  110.  
  111. ;  start of file processing **********************************************
  112. ;  call each procedure using the file area designation
  113. do_files:
  114.  
  115. ;  get lists of the NEW files  ********************************************
  116. call newfiles with "a"         ; Mahoney IBM Compatible MS-DOS
  117. call newfiles with "d"         ; MS Windows
  118. call newfiles with "g"         ; Adult Pictures & Files PG,R,X
  119. call newfiles with "h"         ; Picture files (.GIF,.PIC,etc)
  120.  
  121. ;  see if any files to (D)ownload  ****************************************
  122. findfirst "c:\pcplus\download\execfile.?"
  123. if found
  124.    call download with "a"         ; Mahoney IBM Compatible MS-DOS
  125.    call download with "b"         ; FREE! - DOWNLOAD LISTS
  126.    call download with "c"         ; FREE! - UTILITIES AND VARIETY
  127.    call download with "d"         ; MS Windows
  128.    call download with "g"         ; Adult Pictures & Files PG,R,X
  129.    call download with "h"         ; Picture files (.GIF,.PIC,etc)
  130.    endif
  131.  
  132. ;  see if any files to (E)xtra info  **************************************
  133. findfirst "c:\pcplus\download\execextr.?"
  134. if found
  135.    call extrainf with "a"         ; Mahoney IBM Compatible MS-DOS
  136.    call extrainf with "b"         ; FREE! - DOWNLOAD LISTS
  137.    call extrainf with "c"         ; FREE! - UTILITIES AND VARIETY
  138.    call extrainf with "d"         ; MS Windows
  139.    call extrainf with "g"         ; Adult Pictures & Files PG,R,X
  140.    call extrainf with "h"         ; Picture files (.GIF,.PIC,etc)
  141.    endif
  142.  
  143. ;  see if any files to (A)ccess  ******************************************
  144. findfirst "c:\pcplus\download\execaccs.?"
  145. if found
  146.    call accesser with "a"         ; Mahoney IBM Compatible MS-DOS
  147.    call accesser with "b"         ; FREE! - DOWNLOAD LISTS
  148.    call accesser with "c"         ; FREE! - UTILITIES AND VARIETY
  149.    call accesser with "d"         ; MS Windows
  150.    call accesser with "g"         ; Adult Pictures & Files PG,R,X
  151.    call accesser with "h"         ; Picture files (.GIF,.PIC,etc)
  152.    endif
  153.  
  154. ;  see if any CD-ROM files to do  *****************************************
  155. findfirst "c:\pcplus\download\exec????.?zz" ; requests for cd-rom files
  156. if found
  157.    ;  see if any files to (D)ownload  *************************************
  158.    call download with "azz"       ; >> ALL CD-ROMs Combined!      
  159.    call download with "bzz"       ; >> ALL ADULT CD-ROMs Combined!
  160.  
  161.    ;  see if any files to (E)xtra info  ***********************************
  162.    call extrainf with "azz"       ; >> ALL CD-ROMs Combined!      
  163.    call extrainf with "bzz"       ; >> ALL ADULT CD-ROMs Combined!
  164.  
  165.    ;  see if any files to (A)ccess  ***************************************
  166.    call accesser with "azz"       ; >> ALL CD-ROMs Combined!      
  167.    call accesser with "bzz"       ; >> ALL ADULT CD-ROMs Combined!
  168.    endif
  169.  
  170. if not connected               ; if connection was lost
  171.    log close                   ; close the logfile
  172.    hangup                      ; hang up the phone
  173.    goto restart                ; start over again
  174.    endif
  175.  
  176. ; the following is just to see if the designations have changed
  177.  
  178. transmit "f"                   ; log into the files area
  179. waitfor "?=HELP"  90           ; wait for top command
  180. transmit "z"                   ; log into the CD-ROM files area
  181. waitfor "?=HELP"  90           ; wait for top command
  182. transmit "^^^"                 ; go to the main menu
  183. waitfor "?=HELP"  90           ; wait for top command
  184.  
  185. ;  end of file processing *************************************************
  186.  
  187. ; now let's gather and download a QWK mail packet
  188. transmit "K"                        ; select QWK processing
  189. WaitFor ") ? -" 30
  190. transmit "N"                        ; select [N]ew messages
  191. WaitFor "[Q]uit" 30
  192. transmit "~~Z"                      ; select [Z]modem protocol
  193. waitquiet 30 forever                ; wait for end of Zmodem d/l
  194. QwkDlName = QwkDlDir
  195. strcat QwkDlName "execpc.qwk"
  196. QwkNewName = QwkDlDir
  197. strcat QwkNewName ExecMmDd
  198. strcat QwkNewName ".qwk"
  199. rename QwkDlName QwkNewName
  200. transmit "^^^"
  201.  
  202. if not connected
  203.    goto lost_it
  204.    endif
  205.  
  206.  
  207. ; if we have a QWK message response packet, UPLOAD it here!
  208.  
  209. isfile QwkUlName
  210. if success
  211.    transmit "K"                        ; select QWK processing
  212.    WaitFor ") ? -" 30
  213.    transmit "U"                        ; select [U]pload
  214.    WaitFor "[Q]uit" 30
  215.    transmit "Z"                        ; select [Z]modem protocol
  216.    sendfile zmodem QwkUlName           ; transmit the file
  217.    if success                          ; if it worked Ok
  218.       QwkNewName = QwkDlDir
  219.       strcat QwkNewName ExecMmDd
  220.       strcat QwkNewName ".rep"
  221.       rename QwkUlName QwkNewName
  222.       endif
  223.    transmit "^^^"
  224.    endif
  225.  
  226. if not connected
  227.    goto lost_it
  228.    endif
  229.  
  230.  
  231. transmit "^^^"                 ; go to TOP MENU
  232. waitfor "?=HELP)" 90
  233.  
  234. if not connected
  235.    goto lost_it
  236.    endif
  237.  
  238. ;transmit "W"                              ; do a 'who is on' list
  239. ;waitfor  "'W' to repeat, Q=quit) ->" 90   ; end of list
  240. ;transmit "Q"
  241. ;waitfor  "?=HELP)" 90
  242.  
  243. transmit ";"
  244. waitfor "Chain->" 30
  245. transmit "~~g;n^M"             ; <G>oodbye, <N>o message
  246. waitfor "click"                ; EXEC-PC's disconnection signal
  247.  
  248. lost_it:
  249. log close                      ; close the logfile
  250.  
  251. if connected                   ; if we're still connected
  252.    hangup                      ; hang up the phone
  253.    endif
  254.  
  255. comment
  256. The following line runs the 'add comment & fix date' program.  It uses 
  257. the file 'c:\pcplus\download.log' to insert the EXEC-PC file list 
  258. description into the comment area of downloaded ZIP files and changes
  259. their date to reflect the latest date of any file within the ZIP.
  260. The 'zipcomdt' program should be accessible through your 'path'.
  261. See the download procedure regarding the download log file.
  262. endcomment
  263.  
  264. dos "zipcomdt c:\pcplus\download.log" noclear
  265. quit     ; exit ProComm Plus, go back to DOS
  266. endproc  ; end of the Main procedure
  267.  
  268. ;**********************************************
  269. proc execlogon
  270.  
  271. start_logon:       ;  Build a name for the log file: EXECmmdd.LOG
  272.  
  273. assign s0 "exec"
  274. date s2            ; capture the date as mm/dd/yy
  275. substr s1 s2 0 2   ; extract the month
  276. strcat s0 s1       ; append: execMM
  277. substr s1 s2 3 2   ; extract the day
  278. strcat s0 s1       ; append: execMMDD
  279. strcat s0 ".log"   ; append: execMMDD.log
  280. log open s0        ; open (create or append) the logfile
  281.  
  282. dialexec:
  283. if not fromddir    ; if not called via the dialing directory
  284.    clear
  285.    strfmt S0 "Dialing EXEC-PC at %s on %s" $TIME1 $DATE
  286.    message S0
  287.    transmit "ATDT~789-4210^M"  ; dial EXEC-PC with commands to the modem
  288.    waitfor "connect" 60        ; wait 60 seconds for a connection
  289.    if not waitfor              ; if modem did not return "connect"
  290.       hangup
  291. ;;;;  pause 9900               ; pause for 2 hours & 45 minutes
  292.       pause 3600               ; pause for 1 hour
  293.       goto dialexec            ; try again
  294.       endif
  295.    endif
  296.  
  297. if not connected               ; if connection was lost
  298.    log close                   ; close the log file
  299.    hangup                      ; hang up the phone
  300.    goto start_logon            ; try again
  301.    endif
  302.  
  303. if not fromddir      ; if not originated from the dialing directory
  304.    waitfor  "What is your FIRST name ->" 90
  305.    transmit "Bruce^M"
  306.    waitfor  "What is your  LAST name ->" 90
  307.    transmit "Clawson^M"
  308.    waitfor  "Password ->" 90
  309.    transmit "hoosierknights;Q^M"  ; go directly to the top menu
  310.    waitfor "?=HELP)" 90           ; wait for top command
  311.    if not connected               ; if connection was lost
  312.       log close                   ; close the logfile
  313.       hangup                      ; hang up the phone
  314.       goto start_logon            ; start over again
  315.       endif                       ; (if not connected)
  316.    endif                          ; (if not fromddir)
  317. endproc
  318.  
  319. ;**********************************************
  320. proc newfiles                  ; list new files since last call
  321. strparm filearea               ; file area to list (A/B/C/D/etc)
  322. string request = "~~f;?^M"     ; Files/area
  323.  
  324. strupdt request filearea 4 1   ; plug file area in place of ?
  325.  
  326. transmit ";"
  327. waitfor "Chain->" 90
  328. transmit request               ; go to file area
  329. waitquiet 10 forever           ; wait for prompt
  330. transmit "n"                   ; get new files
  331. waitquiet 10 forever           ; wait for end of list
  332. pause 2
  333. transmit "^^^"                 ; go to top menu
  334. waitfor "?=HELP)" 15
  335. endproc                        ; end of 'newfiles' procedure
  336.  
  337. ;**********************************************
  338. proc download                  ; download a list of files
  339. strparm filearea               ; file area to download
  340. string  filename = "c:\pcplus\download\execfile."  ; name of the file
  341. string  request = "~~f;"       ; Files
  342. string  dlstat                 ; status from WaitForIt
  343. integer count1 = 0             ; current file count
  344. integer count2 = 0             ; cumulative file count
  345. integer endoffile = 0          ; end of input file = 1
  346.  
  347. strcat filename filearea       ; add file area to file name
  348. isfile filename                ; does the file exist?
  349. if not success
  350.    goto exitdlproc             ; no, exit the procedure
  351.    endif
  352. find filearea "zz"
  353. if found
  354.    strcat request "z;"         ; switch to cd-rom collections
  355.    strcat request filearea 1   ; file area designation
  356.    strcat request "^M"
  357.   else
  358.    strcat request filearea 1
  359.    strcat request "^M"
  360.    endif
  361.  
  362. dlagain:
  363. if not connected               ; if we lost our connection
  364.    call execlogon              ; dial and log on
  365.    endif
  366.  
  367. transmit ";"
  368. waitfor "Chain->" 90
  369. transmit request               ; log into the proper file area
  370. waitfor "?=HELP)"  90          ; wait for top command
  371. call waitforit with &dlstat
  372. strcmp dlstat "OK"
  373. if failure
  374.    goto dlagain
  375.    endif
  376.  
  377. morefiles:
  378. fopen 0 filename "rt"          ; open the file as read/text
  379. transmit "D"                   ; (D) is for (D)ownload
  380. waitfor  "from the BBS ->"
  381. call waitforit with &dlstat
  382. strcmp dlstat "OK"
  383. if failure
  384.    goto dlagain
  385.    endif
  386. count1 = 0
  387. if count2 > 0
  388.    for count1 upto count2
  389.        fgets 0 s0              ; read up to where we left off
  390.        endfor
  391.    count1 = 0
  392.    endif
  393.  
  394. dl_read:
  395. fgets 0 s0                     ; read a record
  396. if eof 0                       ; was end-of-file encountered?
  397.    endoffile = 1               ; set switch
  398.    goto end_dl_file            ; yes, quit this loop
  399.    endif
  400. inc count1
  401. call pullfilename with s0 &s1  ; pull out the filename
  402. strcat s1 "^M"                 ; append a CR
  403. transmit s1                    ; transmit the filename/CR
  404. waitfor  "from the BBS ->" 45
  405. call waitforit with &dlstat
  406. strcmp dlstat "OK"
  407. if failure
  408.    goto dlagain
  409.    endif
  410. if count1 == MaxDlCount
  411.    goto end_dl_file
  412.    endif
  413. goto dl_read
  414.  
  415. end_dl_file:
  416. fclose 0                       ; close the file
  417. transmit "^M"                  ; no more files to download
  418. waitfor "OK? (YNG) ->" 15
  419. call waitforit with &dlstat
  420. strcmp dlstat "OK"
  421. if failure
  422.    message "^M^J!! Failure in DownLoad proc !!^M^J"
  423.    transmit "Q"                   ; go to top menu
  424.    waitfor "?=HELP)" 90
  425.    goto exitdlproc
  426.    endif
  427. transmit "Y"                   ; Yes, do Zmodem transfer
  428. ; At this point, ProComm Plus detects the Zmodem signal and begins reception
  429. waitquiet 30 forever           ; wait for silence (downloads are complete)
  430.  
  431. if not connected               ; if connection was lost
  432.    goto dlagain                ; start over again
  433.    endif
  434.  
  435. if endoffile == 0              ; if we're not finished
  436.    count2 = count2 + MaxDlCount
  437.    goto morefiles
  438.    endif
  439.  
  440. ; Now we're going to add the list of downloaded files to the download log.
  441. ; It's a handy way to remember what files we've downloaded.
  442.  
  443. fopen 0 filename "rt"          ; open the download file as read/text
  444. isfile DownLog                 ; does the logfile already exist?
  445. if success
  446.         fopen 1 DownLog "at"     ; yes, open in append mode
  447.    else
  448.         fopen 1 DownLog "wt"     ; no, open in write mode
  449.    endif
  450.  
  451. add_to_log:
  452. fgets 0 s0                     ; read a record from EXECFILE.?
  453. if eof 0                       ; if end-of-file,
  454.    goto end_log_add            ;    get out
  455.    endif
  456.  
  457. strlen s0 n0                   ; get length of input record
  458. substr s2 s0 1 1               ; pull out the second byte
  459. strcmp s2 " " 1                ; compare to space
  460. if success
  461.    n0 = n0 - 2                 ; decrease length by two bytes
  462.    substr s1 s0 2 n0           ; new EXEC-PC display format
  463.  else
  464.    substr s1 s0 0 n0           ; old EXEC-PC display format
  465. endif
  466.  
  467. fputs 1 s1                     ; write the record to DOWNLOAD.LOG
  468. goto add_to_log
  469.  
  470. end_log_add:                   ; finished adding to download.log
  471. fclose 0                       ; close EXECFILE.?
  472. fclose 1                       ; close DOWNLOAD.LOG
  473. delete filename                ; delete EXECFILE.?
  474.  
  475. transmit "Q"                   ; go to top menu
  476. waitfor "?=HELP)" 90
  477. exitdlproc:
  478. return                         ; exit the procedure
  479. endproc                        ; end of 'download' procedure
  480.  
  481. ;**********************************************
  482. proc extrainf     ; do an 'extra' on each file name in a list
  483. strparm filearea  ; file area to access
  484. string  filename = "c:\pcplus\download\execextr." ; name of list file
  485. string request = "~~f;"        ; Files
  486. string extrstat                ; status from WaitForIt
  487.  
  488. strcat filename filearea       ; add file area to file name
  489. isfile filename                ; does the file exist?
  490. if not success
  491.    goto exit_extra             ; no, skip this procedure
  492.    endif
  493.  
  494. find filearea "zz"
  495. if found
  496.    strcat request "z;"         ; switch to cd-rom collections
  497.    strcat request filearea 1   ; file area designation
  498.    strcat request "^M"
  499.   else
  500.    strcat request filearea 1
  501.    strcat request "^M"
  502.    endif
  503.  
  504. extragain:
  505. transmit ";"
  506. waitfor "Chain->" 90
  507. transmit request               ; log into the proper file area
  508. waitfor "?=HELP)" 90           ; wait for top command
  509. call waitforit with &extrstat
  510. strcmp extrstat "OK"
  511. if failure
  512.    goto extragain
  513.    endif
  514. transmit "E"                   ; (E) is for (E)xtra information
  515. waitfor  " ->"
  516. call waitforit with &extrstat
  517. strcmp extrstat "OK"
  518. if failure
  519.    goto extragain
  520.    endif
  521.  
  522. fopen 0 filename "rt"          ; open the file as read/text
  523.  
  524. extra_read:
  525. fgets 0 s0                     ; read a record
  526. if eof 0                       ; was end-of-file encountered?
  527.    goto end_extra_file         ; yes, exit the procedure
  528.    endif
  529. call pullfilename with s0 &s1  ; pull out the filename
  530. strcat s1 "^M"                 ; append a CR
  531. transmit s1                    ; transmit the filename/CR
  532. waitquiet 10 forever           ; wait forever for 10 seconds of quiet
  533. goto extra_read
  534.  
  535. end_extra_file:
  536. fclose 0
  537. transmit "^M"                  ; quit the (E)xtra area
  538. waitfor "?=HELP)" 15           ; wait for top command
  539. if waitfor
  540.    delete filename             ; delete the access-request file
  541.    endif
  542.  
  543. transmit "^^^"                 ; go to top menu
  544. waitfor "?=HELP)" 90
  545.  
  546. exit_extra:
  547. return                         ; exit the procedure
  548. endproc                        ; end of 'extra' procedure
  549.  
  550. ;**********************************************
  551. proc accesser     ; do an 'access' on each file name in a list
  552. strparm filearea  ; file area to access
  553. string  filename = "c:\pcplus\download\execaccs." ; name of list file
  554. string request = "~~f;"        ; Files
  555. string accstat                 ; status from WaitForIt
  556.  
  557. strcat filename filearea       ; add file area to file name
  558. isfile filename                ; does the file exist?
  559. if not success
  560.    goto exit_access            ; no, skip this procedure
  561.    endif
  562.  
  563. find filearea "zz"
  564. if found
  565.    strcat request "z;"         ; switch to cd-rom collections
  566.    strcat request filearea 1   ; file area designation
  567.    strcat request "^M"
  568.   else
  569.    strcat request filearea 1
  570.    strcat request "^M"
  571.    endif
  572.  
  573. accagain:
  574. transmit ";"
  575. waitfor "Chain->" 90
  576. transmit request               ; log into the proper file area
  577. waitfor "?=HELP)" 90           ; wait for top command
  578. call waitforit with &accstat
  579. strcmp accstat "OK"
  580. if failure
  581.    goto accagain
  582.    endif
  583.  
  584. fopen 0 filename "rt"          ; open the file as read/text
  585.  
  586. access_read:
  587. fgets 0 s0                     ; read a record
  588. if eof 0                       ; was end-of-file encountered?
  589.    goto end_acc_file           ; yes, exit the procedure
  590.    endif
  591. call pullfilename with s0 &s1  ; pull out the filename
  592. strcat s1 "^M"                 ; append a CR
  593. transmit "A"                   ; (A) is for (A)ccess
  594. waitfor  " ->"
  595. call waitforit with &accstat
  596. strcmp accstat "OK"
  597. if failure
  598.    goto accagain
  599.    endif
  600. transmit s1                    ; transmit the filename/CR
  601. when 2 "RETURN to quit) ->" transmit "^M"   ; if filename was not found
  602. waitquiet 10 forever           ; wait forever for 10 seconds of quiet
  603. cwhen 2                        ; clear when/2
  604. goto access_read
  605.  
  606. end_acc_file:
  607. fclose 0
  608. transmit "Q"                   ; quit the (A)ccess area
  609. waitfor "?=HELP)" 15           ; wait for top command
  610. if waitfor
  611.    delete filename             ; delete the access-request file
  612.    endif
  613.  
  614. transmit "^^^"                 ; go to top menu
  615. waitfor "?=HELP)" 90
  616.  
  617. exit_access:
  618. return                         ; exit the procedure
  619. endproc                        ; end of 'accesser' procedure
  620.  
  621. ;**********************************************
  622. proc waitforit
  623. strparm status                 ; status of waitfor: OK or NG
  624.  
  625. status = "OK"
  626. if not waitfor                 ; if we got lost
  627.    status = "NG"
  628.    transmit "^^^"
  629.    waitfor "?=HELP)" 90        ; wait for top command
  630.    if not waitfor              ; if we lost our connection
  631.       call execlogon           ; dial and log on
  632.       endif
  633.    endif
  634.  
  635. return
  636. endproc
  637.  
  638. ;**********************************************
  639. proc pullfilename     ; extract the filename from the input record
  640. strparm record                 ; record from input file
  641. strparm filename               ; extracted filename
  642. string  temp
  643.  
  644. substr temp record 1 1         ; pull out the second byte
  645. strcmp temp " " 1              ; compare to space
  646. if success
  647.    substr filename record 2 12 ; new EXEC-PC display format
  648.  else
  649.    substr filename record 0 12 ; old EXEC-PC display format
  650. endif
  651.  
  652. return
  653. endproc
  654.  
  655. comment
  656. ****************************************************************************
  657.   If you find this script useful, please let me know.  If you make 
  658.   improvements to it, definitely let me know.  I have tried to think of 
  659.   everything but that is, of course, impossible.  Even if you try this 
  660.   script and don't like it, I would appreciate hearing about it.  All 
  661.   comments are welcome.  Over 400 people have downloaded my first two 
  662.   DOS scripts and I got one response.  Oh, well.
  663.  
  664.   Bruce Clawson  -  Wauwatosa, WI  (USA)
  665. ****************************************************************************
  666. endcomment
  667.