Normal Topic A couple of new 2.0 SBasic commands (Read 329 times)
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
A couple of new 2.0 SBasic commands
Mar 19th, 2006 at 4:11pm
Print Post Print Post  
I've been working on a couple of commands to enhance Sesame interconnectivity:

"@HTTPPostHTML(servername as string, path as string, id as string, port as int, post_string as string) as string"

This command allows the SBasic programmer to connect to a web server and send it information like a user posting to a web form using a web browser, getting back the HTML that the server would send the web browser should that form be submitted.

The other:

"@RedirectProcess(command as string, feed as string) as string"

This command allows the SBasic programmer to invoke a command and pass it information using standard input (like the user typing on a command line program) and then retrieve the output of that command that it would ordinarily print to the console. This is useful for invoking scripting languages like Python or Perl, or for using Sesame as a front end for SQL based databases, like MySQL.

Example, run a Python script ("print 'hello world'") in Python and catch the output in a variable:

Code
Select All
var aa as string

aa = @RedirectProcess("python", "print 'hello world'")
writeln(aa)
 

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged