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

Home » Public Forums » archive » Re: Generating keyword parameters from strings
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Generating keyword parameters from strings [message #67446 is a reply to message #67445] Wed, 22 July 2009 13:46 Go to previous messageGo to previous message
Eric Hudson is currently offline  Eric Hudson
Messages: 19
Registered: June 2006
Junior Member
Hi,

I guess I was unclear, sorry.

What I mean is that I want to take a string and turn it into a
keyword. So continuing my above example:


function GetProperty, object, propertyName
; The below line is pseudocode -- what I want
object->GetProperty, 'propertyName'=value
; using execute I'd say:
; ok = execute('object->GetProperty, '+propertyName+'=value')
; but I'm wondering if there is another way to do this
; that will work when execute is forbidden
return, value
end

pro TestGet
myObj = obj_new('IDLgrPalette')
myvalue = GetProperty(myObj,'N_COLORS')
; Should be functionally equivalent to
; myObj->GetProperty, N_colors=myValue
end

That is, my 'GetProperty' function has to take the string 'N_COLORS'
and then call the GetProperty method using that STRING as a reference
keyword. It is this functionality that I'm interested in (I'm just
using GetProperty as an example).

Thanks,
Eric
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: rIDL
Next Topic: Generating keyword parameters from strings

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

Current Time: Sun Oct 12 16:33:53 PDT 2025

Total time taken to generate the page: 0.01298 seconds