Re: Testing the type of the structure? [message #30461] |
Tue, 23 April 2002 00:28 |
P.T.Kenter
Messages: 2 Registered: April 2002
|
Junior Member |
|
|
Thanks, that's it!
On Mon, 22 Apr 2002, Pavel A. Romashkin wrote:
> TAG_NAMES(a, /STRUCTURE_NAME), maybe?
> Cheers,
> Pavel
>
> "P.T.Kenter" wrote:
>>
>> Hi all.
>>
>> Can I test which type of structure a certain variable (parameters) is?
>>
>> For example, let's say i've got a variable a of type star:
>>
>> a = {star, name:'sirius', size:2.1}
>>
>> and a function that expects a star as input:
>>
>> function is_a_star, s
>> ; i would like to test here if s is of type 'star'
>> end
>>
>> How can i test if parameter s is a star-structure?
>>
>> I've found the obj_isa function but it only seems to work with objects. A
>> similar function for structures would be perfect.
>>
>> Regards, Pepijn Kenter.
>
|
|
|
Re: Testing the type of the structure? [message #30468 is a reply to message #30461] |
Mon, 22 April 2002 08:57  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
TAG_NAMES(a, /STRUCTURE_NAME), maybe?
Cheers,
Pavel
"P.T.Kenter" wrote:
>
> Hi all.
>
> Can I test which type of structure a certain variable (parameters) is?
>
> For example, let's say i've got a variable a of type star:
>
> a = {star, name:'sirius', size:2.1}
>
> and a function that expects a star as input:
>
> function is_a_star, s
> ; i would like to test here if s is of type 'star'
> end
>
> How can i test if parameter s is a star-structure?
>
> I've found the obj_isa function but it only seems to work with objects. A
> similar function for structures would be perfect.
>
> Regards, Pepijn Kenter.
|
|
|