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

Home » Public Forums » archive » Re: make_scalar?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: make_scalar? [message #54358] Sat, 02 June 2007 17:13
Jim Pendleton is currently offline  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 Go to previous message
jkj is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Why does '[1,2,3] EQ [2]' yield zero but '[1,2,3] EQ 2' yield [0,1,0] ?
Next Topic: archived data

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

Current Time: Wed Oct 08 15:47:41 PDT 2025

Total time taken to generate the page: 0.00556 seconds