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

Home » Public Forums » archive » renaming a variable without making a copy
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: renaming a variable without making a copy [message #69158 is a reply to message #68935] Fri, 11 December 2009 05:22 Go to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
On 11 déc, 12:51, Reimar Bauer <R.Ba...@fz-juelich.de> wrote:

> what is that doing then?

> IDL> a=bindgen(3)
> IDL> b=ptr_new({s:intarr(3)})
> IDL> reads,a,*b
> IDL> print,*b
> {       0       1       2

Still the same: 'a' is implicitely converted to some string array by
'reads', then read out to *b.
Look at the following:

define some structure:
IDL> a={n:1L,x:2.0}

build its binary content as a byte chain:
IDL> b=[byte(a.n,0,4),byte(a.x,0,4)]
IDL> print,b
1 0 0 0 0 0 0 64

define a void structure to get the result:
IDL> aa={n:0L,x:0.0}

then :
IDL> reads,b,aa
IDL> print,aa
{ 1 0.000000}
does not provide the right result.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Vectorize procedure
Next Topic: array subscripting problem

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

Current Time: Fri Oct 10 04:29:41 PDT 2025

Total time taken to generate the page: 1.83638 seconds