home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / BATWORKS.ZIP / BATCH.PTM < prev    next >
Encoding:
Text File  |  1990-05-22  |  1.2 KB  |  37 lines

  1. ; This PTM will run a PTB file currently being edited.
  2. ; It may also run many  Notepad PTM files
  3. ; Step 2, get notepad file name
  4. debug(@off)
  5. :top
  6.    ;Get name of current window, notepad window in this case
  7.       A7896=WinGetAct()      ; Use real obscure variable name here...
  8.    ;Parse it to extract file name 
  9.       ParseData(A7896)
  10.    ; If it is currently untitled, get user to enter desired name
  11.       If stricmp(param3,"(UNTITLED)")!=0 then goto FileIsNamed
  12.       param3=askline("RUNBATCH","Please enter desired filename","*.PTB")
  13.    ;Write entered name to clipboard for quicker response
  14.       clipput(param3)
  15.    ;Get Save dialog box and boop filename into it.  Also hit enter
  16.       sendkey("!FA+{INSERT}{ENTER}")
  17.       A7896=WinGetAct()
  18.       if stricmp(A7896,"NOTEPAD")!=0 then goto saved
  19.    ;User is overwriting a file.  Drop back into manual operation
  20.       exit
  21.  
  22. :FileIsNamed
  23.    ;Save file
  24.       SendKey("!FS")
  25. :saved
  26.    ;Minimize Window
  27.       SendKey("!{SP}N")
  28.  
  29.    ;Run a PubTech Batch session with the indicated file
  30.       A7895=param3
  31.       call(param3,"")
  32.  
  33.    ;Wait until session over, then restore edit window
  34.       WinWaitCls("Batch - %A7895%")
  35.       Winshow(A7896)
  36.    exit
  37.