I think I mentioned this before. It would be really handy to have the ability to pass a string output from a command execution.
something like
string <- exec("cmd.exe", "cmd \c dir", exec_wait+sw_showminnoactive)
function Exec(in name:string[*] args:string[*] mode:integer inout captureText:string[*])
//
// Run a command line program and capture the output.
//
// name - Name of EXE file to run
// args - EXE file's arguments
// mode - must be EXEC_WAIT
// captureText - returns the output
//
Get the folder containing [i]Name[/i] ...
Create a temp file in this folder ...
Change the logged folder to this folder ...
newName <- "cmd.exe /c " + """" + ...the EXE file part of Name as a short name ...
newArgs <- args (all filenames must be in short form) + " > " + tempfile + """"
call Exec(newName, newArgs, EXEC_WAIT)
at this point, tempfile exists and has the captured output ...
call Loadfile(tempfile, FILE_TEXT, captureText)
call Filedel(tempfile)
end functionReturn to Language Suggestions
Users browsing this forum: No registered users and 1 guest