comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: crazy question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: crazy question [message #65374] Mon, 02 March 2009 13:55 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Vince Hradil writes:

> What about using EXECUTE, or CALL_METHOD, CALL_PROCEDURE, or
> CALL_FUNCTION? Isn't that what those are for?

It wouldn't work with CALL_METHOD, CALL_PROCEDURE,
or CALL_FUNCTION, since these only allow you to
specify the method, function, or procedure name
as a string. But I suppose you could get it to
work somehow with EXECUTE. I just usually rule
that out since I prefer my code be able to run
on the IDL Virtual Machine. (Only God knows why,
though, since I don't think anyone in the world
has actually run my code using the Virtual Machine!)

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: crazy question [message #65375 is a reply to message #65374] Mon, 02 March 2009 13:37 Go to previous messageGo to next message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
llo wrote:
> There is a way to do that for a ROUTINES or FUNCTIONS that uses
> KEYWORDS ?
>
>
try with execute(), but your code will not run in the virtual machine...

Jean
Re: crazy question [message #65376 is a reply to message #65375] Mon, 02 March 2009 13:47 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Mar 2, 3:27 pm, David Fanning <n...@dfanning.com> wrote:
> llo writes:
>> There is a way to do that for a ROUTINES or FUNCTIONS that uses
>> KEYWORDS ?
>
> Alas, no. Whatever it is ITTVIS is doing, they are
> doing out of sight. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

What about using EXECUTE, or CALL_METHOD, CALL_PROCEDURE, or
CALL_FUNCTION? Isn't that what those are for?
Re: crazy question [message #65377 is a reply to message #65375] Mon, 02 March 2009 13:27 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
llo writes:

> There is a way to do that for a ROUTINES or FUNCTIONS that uses
> KEYWORDS ?

Alas, no. Whatever it is ITTVIS is doing, they are
doing out of sight. :-)

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: crazy question [message #65378 is a reply to message #65377] Mon, 02 March 2009 13:19 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
There is a way to do that for a ROUTINES or FUNCTIONS that uses
KEYWORDS ?
Re: crazy question [message #65379 is a reply to message #65378] Mon, 02 March 2009 13:16 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
Thanks david
Re: crazy question [message #65380 is a reply to message #65379] Mon, 02 March 2009 13:16 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Make your object inherit from an IDLitComponent object,
> then you can use the SetPropertyByIdentifier method
> to do this. (You probably have to register the properties
> you want to set this way, first. See the RegisterProperty
> method.) This will work for *any* object, not just object
> graphics objects. I use it extensively in the Catalyst
> Library.

I'm wrong about the registering part. You have to
register the properties you want to display in a
PropertySheet widget, which is *another* wonderful
benefit of subclassing the IDLitComponent object.
But registering doesn't have anything at all to do with
the SetPropertyByIdentifier method.

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: crazy question [message #65381 is a reply to message #65380] Mon, 02 March 2009 13:10 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
llo writes:

> Is it possible to do something like that?
>
> ex='KEYWORD_NAME'
> aa=OBJ_NEW('AN_OBJECT')
> aa->SetProperty, ex=5
>
> I know this is imposible but maybe there is way to use strings (as a
> keywords) to set values.

Make your object inherit from an IDLitComponent object,
then you can use the SetPropertyByIdentifier method
to do this. (You probably have to register the properties
you want to set this way, first. See the RegisterProperty
method.) This will work for *any* object, not just object
graphics objects. I use it extensively in the Catalyst
Library.

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: crazy question [message #65469 is a reply to message #65378] Tue, 03 March 2009 01:04 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Mon, 2 Mar 2009, llo wrote:

> There is a way to do that for a ROUTINES or FUNCTIONS that uses
> KEYWORDS ?

You can do that with _EXTRA and CREATE_STRUCT:

; cut here, keytest.pro
pro keytest, key1=key1, key2=key2, _extra=ex
help, key1, key2
end
; cut here

IDL> keytest
% Compiled module: KEYTEST.
KEY1 UNDEFINED = <Undefined>
KEY2 UNDEFINED = <Undefined>
IDL> keytest, _extra=create_struct('key1', 1, 'key2', 2)
KEY1 INT = 1
KEY2 INT = 2
IDL>


regards,
lajos
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: the problem of using CALL_EXTERNAL()
Next Topic: Re: the problem of using CALL_EXTERNAL()

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:43:32 PDT 2025

Total time taken to generate the page: 0.00489 seconds