Hi All,
I would like to call a command line ruby script from within a PB program, but I am unsure of how to do it. Would you use the console functions or program functions? What would be the best way of passing data back?
Thanks
Calling a command line script from PB program
The easy way would be to use runprogram() with the commandline ruby interpreter. However passing data back and forth eitehr had to be over a shared memory area or a database ( both ways have their tricky side about synchronization ).
The better way would be to use the ruby.dll (which you also can ship with your program - unaltered or with source ofc since its GPLed ) - the dll can be called from purebasic and basically gives you the functionality to call your own ruby scripts from file / memory from inside pb. Personally i havent done this yet with ruby ( i tried the similar with php - which worked ). Personally i now use Dracscript as scripting language as its written in PB and pretty easy to extend.
In case you havent seen that one yet check out: http://www.purebasic.fr/english/viewtopic.php?t=20312
Whats it for btw ? Writing your own webserver ? =)
Thalius
The better way would be to use the ruby.dll (which you also can ship with your program - unaltered or with source ofc since its GPLed ) - the dll can be called from purebasic and basically gives you the functionality to call your own ruby scripts from file / memory from inside pb. Personally i havent done this yet with ruby ( i tried the similar with php - which worked ). Personally i now use Dracscript as scripting language as its written in PB and pretty easy to extend.
In case you havent seen that one yet check out: http://www.purebasic.fr/english/viewtopic.php?t=20312
Whats it for btw ? Writing your own webserver ? =)
Thalius
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone!
"
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone!
hmmm - depending what format that data is ( some use RSS which is pretty common ) and if or not https then this would be pretty easy also to write in a simple set of PB Procedures ( faster too ) - and if its about pluggability then you could just epxort this as a dll ( much smaller and more compact than distributing the whole ruby incl your script etc =)ac667788 wrote:Thalius,
... take advantage of a ruby script that can download stock data from Yahoo Finance.
Thalius
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone!
"
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone!

