From:
I took a quick crack at this today.
Feel free to make suggestions. :-)
Press to start the macro again.
Put your dos commands in the command window.
Press to execute the command line under the cursor.
Mark several command lines to immediately execute commands one
after the other.
Put a dot in front of a command if you want its screen output
captured. (ie. redirected to a file)
Tip - I like to run ftp << mycmds.ftp from the tse dos prompt.
where mycmds.ftp contains something like:
open ftp.semware.com
anonymous
dir
First edit mycmds.ftp. Next then select
mycmds.ftp then press then add ftp << in front of
mycmds.ftp and hit enter. Put in the password when prompted.
Also, regarding the caps problem. Yup it happended to me.
I found that if I left caps on in the Win 95 password screen
that caused it.
integer winid1 = 0
,winid2 = 0
,tmpbuf1 = 0
,tmpbuf2 = 0
string fn[80] = ""
proc execcmd()
integer sub1 = 0
,isblk = isBlockInCurrFile()
string cmd[255] = ""
if cmd == ""
endif
if winid2 WindowId()
return()
endif
if isblk
PushPosition()
GotoBlockBegin()
sub1 = Query(BlockEndLine) - Query(BlockBegLine) + 1
else
sub1 = 1
endif
repeat
if isblk
PushBlock()
endif
if GetText(1,1) == "."
cmd = GetText(2,CurrLineLen())
if isblk
msgbox("DOS Command",cmd)
endif
Dos(Format(cmd, ">", fn), _DONT_PROMPT_|_TEE_OUTPUT_)
GotoBufferId(tmpbuf1)
EndFile()
AddLine()
AddLine(cmd)
AddLine()
InsertFile(fn)
UnMarkBlock()
EraseDiskFile(fn)
FileChanged(FALSE)
else
cmd = GetText(1,CurrLineLen())
if isblk
msgbox("DOS Command",cmd)
endif
Dos(cmd)
GotoBufferId(tmpbuf1)
EndFile()
AddLine()
AddLine(cmd)
FileChanged(FALSE)
endif
GotoBufferId(tmpbuf2)
if isblk
PopBlock()
Down()
if GotoWindow(winid1)
EndFile()
GotoWindow(winid2)
UpdateDisplay(_ALL_WINDOWS_REFRESH_)
endif
endif
sub1 = sub1 - 1
until sub1 == 0
if isblk
PopPosition()
endif
if GotoWindow(winid1)
EndFile()
GotoWindow(winid2)
endif
FileChanged(FALSE)
UpdateDisplay(_ALL_WINDOWS_REFRESH_)
end
proc main()
fn = MakeTempName("", ".tmp")
if winid1 == winid2
endif
if fn == ""
endif
if isZoomed()
ZoomWindow()
endif
if HWindow()
winid1 = WindowId()
if not GotoBufferId(tmpbuf1)
tmpbuf1 = CreateBuffer("Capture")
endif
else
return()
endif
if HWindow()
winid2 = WindowId()
if not GotoBufferId(tmpbuf2)
tmpbuf2 = CreateBuffer("Command")
endif
else
AbandonFile()
CloseWindow()
return()
endif
end
main()
execcmd()
____________________________________________________________________
Get free e-mail and a permanent address at http://www.amexmail.com
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)
|