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

KenHorse

  • Newbie
  • *
  • Posts: 10
Running an outside call?
« on: January 22, 2012, 12:22:16 PM »
Is there anyway to call a binary from within Scriba (Linux)?

support

  • Administrator
  • *****
  • Posts: 859
    • Script BASIC Open Source Project
Re: Running an outside call?
« Reply #1 on: January 22, 2012, 12:31:12 PM »
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.


Script BASIC Project Manager

KenHorse

  • Newbie
  • *
  • Posts: 10
Re: Running an outside call?
« Reply #2 on: January 22, 2012, 12:39:05 PM »
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: 859
    • Script BASIC Open Source Project
Re: Running an outside call?
« Reply #3 on: January 22, 2012, 12:46:38 PM »
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
Script BASIC Project Manager

KenHorse

  • Newbie
  • *
  • Posts: 10
Re: Running an outside call?
« Reply #4 on: January 22, 2012, 12:48:30 PM »
Excellent, thank you!

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