1. executing dos command line after leaving euphoria prgram

--=====================_867697795==_

On a request from Daniel Bernstein  here is a method to execute a dos
command line at leaving an euphoria program.

  The keyboard can be stuffed with the command but it is limited to 16
characters.  For more space it's better to set an environment variable in
the parent process (command.com) and then stuf the keyboard buffer with the
name of that variable inclose between % character.  To access parent
environment I wrote an include name parent.e which is attached to thhis message.


-- with trace

include parent.e

constant CMD_LINE ="dir /w *.ex"
SetParentVar("CMDLINE",CMD_LINE)
constant ENVAR = "%CMDLINE%\r"
--constant ENVAR = "dir /w *.e\r"  -- if smaller than 16 char. stuf it to
--keyboard buffer

mem_set(#41E,0,32) -- clean keyboard buffer.
for i = 1 to length(ENVAR) do-- stuff name of environment variable to keybuffer
  poke(#41E+2*(i)-2,ENVAR[i])
end for
poke(#41A,#1E)
poke(#41C,#1E+2*length(ENVAR))


note: I don't know if it work with dos version prior to 7.

--=====================_867697795==_

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu