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

Home » Public Forums » archive » 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 #83638 is a reply to message #83531] Fri, 15 March 2013 06:31 Go to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le vendredi 15 mars 2013 09:10:45 UTC+1, Tom Grydeland a écrit :
>> 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

Are'nt you mixing three different concepts: undefined value, unassigned value and missing data ?
In IDL, you can use : !Null, New_Ptr() and !Values.F_NAN, respectively.

alx.
[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
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HASH makes too many temporaries
Next Topic: MGlib IDL library

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

Current Time: Thu Oct 09 20:31:54 PDT 2025

Total time taken to generate the page: 0.86175 seconds