packing external executable within a stack?..
Jan Schenkel
janschenkel at yahoo.com
Mon Apr 17 11:54:02 EDT 2006
--- Viktoras Didziulis <viktoras at ekoinf.net> wrote:
> And one more question related to the previous one...
> Is it possible in
> Revolution to include external executables as
> resources into a stack or some
> kind of shared library/resource ? Any references...
>
> Thanks!
> Viktoras
>
Hi Viktoras,
You can read a ny file into a custom property, unpack
that into the temp directory and then use the 'shell'
command to execute it (or open process and its friends
if you need to interact via stdin/stdout).
To import it, use something like this:
##
on mouseUp
answer file "Select file to import"
if it is empty then exit mouseUp
put it into tFullPath
set the itemDelimiter to "/"
put item -1 of tFullPath into tFileName
put URL ("binfile:" & tFullPath) into tFileData
set the uImportedFile[tFileName] of this stack \
to tFileData
end mouseUp
##
To use it, you can use something similar to:
##
on ExecuteImportedFile pFileName
put tempname() into tFullPath
set the itemDelimiter to "/"
put pFileName into item -1 of tFullPath
put the uImportedFile[pFileName] of this stack \
into URL ("binfile:" & tFullPath)
get shell(tFullPath)
return it
end ExecuteImportedFile
##
Hope this helped,
Jan Schenkel.
Quartam Reports for Revolution
<http://www.quartam.com>
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the use-livecode
mailing list