Passing parameters to external subroutines 
Author Message
 Passing parameters to external subroutines

Hello there.  I wrote a PERL subroutine that does what I want it to.
However, I want to pass it a parameter from within my RB GUI application.  I
know how to pass parameters to PERL subroutines within PERL, but not RB.
Help, please?

TIA
td



Tue, 20 Sep 2005 23:57:48 GMT  
 Passing parameters to external subroutines


Quote:
> Hello there.  I wrote a PERL subroutine that does what I want it to.
> However, I want to pass it a parameter from within my RB GUI application.  I
> know how to pass parameters to PERL subroutines within PERL, but not RB.
> Help, please?

RB can't call PERL subroutines any more than PERL can call RB
subroutines.  They're different languages entirely (and PERL can't be
compiled to a shared library, which you could access in RB via Declares).

I suggest you just rewrite the subroutine in RB.

Cheers,
- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Wed, 21 Sep 2005 04:13:32 GMT  
 Passing parameters to external subroutines

Quote:

> Hello there.  I wrote a PERL subroutine that does what I want it to.
> However, I want to pass it a parameter from within my RB GUI application.  I
> know how to pass parameters to PERL subroutines within PERL, but not RB.
> Help, please?

Use the Shell object and call the perl script like you would from the
command line.


Wed, 21 Sep 2005 04:30:55 GMT  
 Passing parameters to external subroutines


Quote:


>> Hello there.  I wrote a PERL subroutine that does what I want it to.
>> However, I want to pass it a parameter from within my RB GUI application.  I
>> know how to pass parameters to PERL subroutines within PERL, but not RB.
>> Help, please?

> RB can't call PERL subroutines any more than PERL can call RB
> subroutines.  They're different languages entirely (and PERL can't be
> compiled to a shared library, which you could access in RB via Declares).

> I suggest you just rewrite the subroutine in RB.

Is there no way to require it?  I'm thinking in terms of web scripts.  For
instance, in a PERL cgi script, I build my subroutine, and name it something
like 'sub.lib'.  Then the first line in my script is 'require "sub.lib"'.
There's nothing like that in RB?

td



Wed, 21 Sep 2005 04:53:15 GMT  
 Passing parameters to external subroutines


Quote:
> > RB can't call PERL subroutines any more than PERL can call RB
> > subroutines.  They're different languages entirely (and PERL can't be
> > compiled to a shared library, which you could access in RB via Declares).

> > I suggest you just rewrite the subroutine in RB.

> Is there no way to require it?  I'm thinking in terms of web scripts.  For
> instance, in a PERL cgi script, I build my subroutine, and name it something
> like 'sub.lib'.  Then the first line in my script is 'require "sub.lib"'.
> There's nothing like that in RB?

I think "require" is Perl-ism for "include" and yes, there's something
like that in RB.  Just hold down Option while you drag an exported class
or module into your project, and it'll import it as an alias rather than
copying it in.

But this has nothing to do with one language making calls into another.  
Try using "require" to make calls into a REALbasic (or C or fortran or
any other non-Perl) module and see how far it gets you.  :)

Cheers,
- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Wed, 21 Sep 2005 06:46:42 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Passing arrays to an external subroutine.

2. Passing pointers to external subroutines

3. newbie: passing parameters to subroutine

4. Passing of different types to same parameter of a subroutine

5. Pass an external parameter to VMRL

6. passing functions or subroutines in a subroutine

7. Passing logical variables from Fortran subroutine to C subroutine

8. pass a subroutine (use derived data type) as an argument to another subroutine

9. Passing a parameter Rexx to JCL and return a parameter to JCL

10. language rules question: using a (passed in) parameter to define a parameter

11. Steps to create an external subroutine

12. Calling external subroutines

 

 
Powered by phpBB® Forum Software