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

Home » Public Forums » archive » Re: Storing !NULL in struct
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: Storing !NULL in struct [message #83640 is a reply to message #83525] Fri, 15 March 2013 01:10 Go to previous message
tom.grydeland is currently offline  tom.grydeland
Messages: 51
Registered: September 2012
Member
> On 3/13/13 2:17 am, Tom Grydeland wrote:
>> And it would be useful _to me_ if I could put a !NULL in a struct.
>> I'm using the struct for UVALUEs in widgets, and it would be nice if
>> they allowed _any_ well-defined IDL value.

On Wednesday, March 13, 2013 2:46:17 PM UTC, Mike Galloy wrote:
> But !null is undefined:

Not so undefined that I cannot assign it to a variable, or return it from a function, or use it as a good 'missing value' indicator in most cases. It is also pretty damn useful if you want to build an array by parts (although, as Bob pointed out, I could use a LIST for that last case).

See, I was trying to stash away an arbitrary value (provided by the user for their later retrieval) under a given tag in a structure, and I didn't want to restrict what values they were allowed to use.

So instead of using a struct { internal: <whatever>, public: <your value here> }, I thought I could use a List(<whatever>, <your value here>), but that didn't work either, since I'm not allowed to assign to a struct that lives in a List.

IDL> c = List({ t: 0})
IDL> print, c[0].t
0
IDL> c[0].t = 1
% Attempt to store into an expression: Structure reference.
% Execution halted at: $MAIN$

:-(

> Mike

--T
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Findind NANs in unformatted image data
Next Topic: Re: Annular Zernike polynomials

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

Current Time: Mon Dec 01 12:03:46 PST 2025

Total time taken to generate the page: 1.52224 seconds