Re: make_scalar? [message #54358] |
Sat, 02 June 2007 17:13 |
Jim Pendleton
Messages: 13 Registered: July 2001
|
Junior Member |
|
|
"jkj" <kevin@vexona.com> wrote in message
news:1180815896.610302.271370@u30g2000hsc.googlegroups.com.. .
> On Jun 1, 6:19 pm, Marshall Perrin <mperrin+n...@serpens.berkeley.edu>
> wrote:
>> Is there an equivalent of make_array that will create a scalar variable,
>> of a type only specified at runtime? Of course I can just create an
>> array and then truncate it to a scalar,
>> v = (make_array(1,type=typecode))[0]
>> but that seems kind of convoluted. I searched around a bit and didn't
>> find anything, but perhaps I'm missing something obvious. I do that
>> from time to time. :-)
>>
>> - Marshall
>
> I resemble the mark about missing obvious things :-) so I'll reply
> that it seems to me all scalar variables in IDL match your
> description. That is, any scalar variable can be of any type and
> dynamic assignment is the norm, therefore the equivalent of make_array
> for scalars would be completely redundant.
>
> So, what obvious thing am I missing in your question?
> -Kevin
>
I've run into situations like this when I have a data description in a
separate
place from a data stream. For example, if I have a socket client that must
read
a data type before allocating the appropriate amount of space to read the
subsequent data.
The FIX function has a TYPE keyword to allow the creation of a scalar of a
particular IDL numeric data type.
Jim P.
|
|
|
Re: make_scalar? [message #54360 is a reply to message #54358] |
Sat, 02 June 2007 13:24  |
jkj
Messages: 48 Registered: April 2007
|
Member |
|
|
On Jun 1, 6:19 pm, Marshall Perrin <mperrin+n...@serpens.berkeley.edu>
wrote:
> Is there an equivalent of make_array that will create a scalar variable,
> of a type only specified at runtime? Of course I can just create an
> array and then truncate it to a scalar,
> v = (make_array(1,type=typecode))[0]
> but that seems kind of convoluted. I searched around a bit and didn't
> find anything, but perhaps I'm missing something obvious. I do that
> from time to time. :-)
>
> - Marshall
I resemble the mark about missing obvious things :-) so I'll reply
that it seems to me all scalar variables in IDL match your
description. That is, any scalar variable can be of any type and
dynamic assignment is the norm, therefore the equivalent of make_array
for scalars would be completely redundant.
So, what obvious thing am I missing in your question?
-Kevin
|
|
|