pointer to function [message #85822] |
Wed, 11 September 2013 23:20  |
Moritz Fischer
Messages: 32 Registered: June 2013
|
Member |
|
|
Hi All,
Is there any way to implement something like a pointer to a function (
as in C )?
I'd like to avoid using 'execute', but i do want something like this:
t = exectute( 'value = '+ user_written_func +'( argument )' )
And a related question:
How can I compile a file that is *not* named as the function it contains
without a dot command ( = at runtime)?
It works ok with .compile, but not with resolve_routine.
Any suggestions are apprechiated!
cheers
|
|
|
Re: pointer to function [message #85824 is a reply to message #85822] |
Thu, 12 September 2013 01:26  |
Lajos Foldy
Messages: 176 Registered: December 2011
|
Senior Member |
|
|
On Thursday, September 12, 2013 8:20:35 AM UTC+2, Moritz Fischer wrote:
> Is there any way to implement something like a pointer to a function (
> as in C )?
>
> I'd like to avoid using 'execute', but i do want something like this:
>
> t = exectute( 'value = '+ user_written_func +'( argument )' )
Use the CALL_* routines, CALL_FUNCTION, CALL_PROCEDURE or CALL_METHOD.
> And a related question:
>
> How can I compile a file that is *not* named as the function it contains
> without a dot command ( = at runtime)?
>
> It works ok with .compile, but not with resolve_routine.
http://cow.physics.wisc.edu/~craigm/idl/down/file_compile.pr o (the filename must end with .pro)
regards,
Lajos
|
|
|