Author Topic: Running an outside call?  (Read 8995 times)

Ken Arck

  • Guest
Running an outside call?
« on: January 22, 2012, 11:22:16 AM »
Is there anyway to call a binary from within Scriba (Linux)?

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Running an outside call?
« Reply #1 on: January 22, 2012, 11:31:12 AM »
Is there anyway to call a binary from within Scriba (Linux)?

Do you mean call an external library function in a shared object? (.so)

ScriptBasic has a nice extension module API that makes extending the language rather easy. The API is composed of macros that allows wrapping an external library with very few lines of code.

The Windows version of ScriptBasic has an extension module called DYC that will let you call generic DLLs. Under Linux I use GTK-Server as my FFI interface.



Ken Arck

  • Guest
Re: Running an outside call?
« Reply #2 on: January 22, 2012, 11:39:05 AM »
I mean lets say (as an example only) that I want to call a compiled binary in /usr/local/bin from within a Scriba program and then return to the Scriba program and continue onward

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Running an outside call?
« Reply #3 on: January 22, 2012, 11:46:38 AM »
Ken,

When you say CALL, I assume you mean calling a function in a script or an external library. If you mean execute a system or external executable, (program) then ScriptBasic supports two methods.

EXECUTE - can wait for the external program to finish.

SYSTEM - start an external program in a separate process in asynchronous mode

John

Ken Arck

  • Guest
Re: Running an outside call?
« Reply #4 on: January 22, 2012, 11:48:30 AM »
Excellent, thank you!

(I was looking though the documentation searching for the wrong keywords!)