I have a question about adding languages to the wsh so that rev can use them as alternatelanguages.
I have activeperl installed and recognized by livecode as an alternate language (python too, but it has issues) I can't figure out how to get a result back out!
With vbscript something like
do "result = 1+1" as "vbscript"
works fine.
With perl, nothing i've tried will work.
do "$result=1+1;" as "perlscript"
do "return 1+1;" as "perlscript"
all fail to return the value 2.
No errors, it seems to actually execute correctly. Anyone know how to get a result back out when "doing" as "perlscript" ?
The python engine won't fire at all and spawns a windows error message, so its otu for now. May try with ruby just to see whats up.
Windows script host languages
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Windows script host languages
Easy enough from ruby with a puts statement (or a thrown error or anything else that goes to stdout:
ruby test.rb:
LC:
ruby test.rb:
Code: Select all
begin
buildString = "hello, sailor"
puts buildString
end
Code: Select all
put "test.rb" into tRubyFile
put <pathToFileDirectoryGoesHere> into tPath
put shell("ruby" && tPath & tRubyFile)
Re: Windows script host languages
Yeah, doing it as a shell gets around the problem. Mostly just curious how to talk to these other languages using the windows scripting host.
perl is installed correctly and shows up with "put the alternativelanguages" like it should, so it seems that
do "$result=1 + 1;" as "perlscript"
Should work fine. And it seems to, but there is nothing in the result.
It works this way with jscript and vbscript. Whatever the 'result' variable is set to, ends up in the result of the do call. But as you say, shell calls avoid the whole issue so back I go!
perl is installed correctly and shows up with "put the alternativelanguages" like it should, so it seems that
do "$result=1 + 1;" as "perlscript"
Should work fine. And it seems to, but there is nothing in the result.
It works this way with jscript and vbscript. Whatever the 'result' variable is set to, ends up in the result of the do call. But as you say, shell calls avoid the whole issue so back I go!
Re: Windows script host languages
Here in linuxland the alternatelanguages is always empty, no matter how many other environments I have installed, so shell's the answer to many of LC's shortcomings.
Re: Windows script host languages
Hmm. I think perl has an interactive mode so I can probably open the process and then just write whatever I want executed to the process. (think even php has an interactive mode) as do python and ruby. I guess this makes things work out in the end. Thx for helping to point me away from what would most likely be a futile waste of time!
mwieder wrote:Here in linuxland the alternatelanguages is always empty, no matter how many other environments I have installed, so shell's the answer to many of LC's shortcomings.