newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: axtens on April 09, 2009, 09:22:27 AM

Title: interface to CScript.EXE (VBScript)
Post by: axtens on April 09, 2009, 09:22:27 AM
G'day everyone



Here's something I just cooked up as part of a test frame. It's a way of evaluating VBScript code from newLISP.



(define (vbscript text)
(begin
(set 'aFile (open "c:/temp/temp.vbs" "write"))
(write-line aFile (string text))
(close aFile)
(exec "cmd.exe /C c:\windows\system32\cscript.exe c:\temp\temp.vbs >c:\temp\temp.out" )
(set 'aFile (open "c:/temp/temp.out" "read"))
(set 'result (string (read-line aFile)))
(close aFile)
result
)
)


And here's an example of its use:



(set 'foo "dim a
a = "hello world"
msgbox a
")

(vbscript foo)


Kind regards,

Bruce.
Title:
Post by: m35 on April 09, 2009, 10:35:26 AM
Good to see you're exploring and trying new things. You might also be interested in this (//http). ;)
Title:
Post by: axtens on April 10, 2009, 08:39:21 AM
Quote from: "m35"Good to see you're exploring and trying new things. You might also be interested in this (//http). ;)


Oh wow, that looks so cool. I've gotta try that out real soon.



Thanks.



Bruce.