Okay, I have found the solution, but I do not fully understands why it
works. Apparently I have to add to GetLocal the instance
attribute to distinguish them. So these calls should become:
out2,link2 = GetLocal(1) [instance:1];
and.
out2,link2 = GetLocal(11) [instance:2];
,respectively.
According to the userguide page 202 the instance attribute is only used
for error reporting so that in case of an error also the appropriate
function is mentioned.
Can anybody explane me why exactly for Get en SetLocal the instance *has*
to be given to distinguish them?
Regards
Eelco van Vliet
On Fri, 18 Jan 2002, Eelco Van Vliet wrote:
> >From MAILER-DAEMON Fri Jan 18 09:38:25 2002
> Date: 18 Jan 2002 09:38:25 +0100
> From: Mail System Internal Data <[EMAIL PROTECTED]>
> Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA
> X-IMAP: 1011343105 0000000000
> Status: RO
>
> This text is part of the internal format of your mail folder, and is not
> a real message. It is created automatically by the mail system software.
> If deleted, important folder data will be lost, and it will be re-created
> with the data reset to initial values.
>
> >From [EMAIL PROTECTED] Wed Jan 16 15:28:14 2002 +0100
> Status: R
> X-Status:
> X-Keywords:
> Date: Wed, 16 Jan 2002 15:28:13 +0100 (MET)
> From: Eelco Van Vliet <[EMAIL PROTECTED]>
> To: <[email protected]>
> Subject: a loop problem
> In-Reply-To: <[EMAIL PROTECTED]>
> Message-ID: <[EMAIL PROTECTED]>
> MIME-Version: 1.0
> Content-Type: TEXT/PLAIN; charset=US-ASCII
>
>
> Okay, perhaps this is a very simple question and am I just being stupid.
> But can anybody say why this small script isn't working using opendx in
> script mode (called as dx -script loop.net)
>
> loop.net:
>
> macro doloop()
> {
> current=ForEachN (1,3,1);
> Echo("------------- step ", current," ------------------------");
>
> out1,link1 = GetLocal(1);
> sum1 = Compute("$0 + 1", out1);
> SetLocal(sum1,link1);
>
> out2,link2 = GetLocal(11);
> sum2 = Compute("$0 + 1", out2);
> SetLocal(sum2,link2);
>
> Echo("out1=",out1," out2=",out2);
> Echo("sum1=",sum1," sum2=",sum2);
> }
>
> doloop();
>
> ------------------------------
>
> It consists of two sums that are Get en Stored with Get en Set Local.
> In this simple example, I want to loop three times over the macro, and
> keep track of two sums: sum1 starting at 1 and sum2 starting at 11.
> In case of one sum, the script works as expected. Adding the second seems
> to mix up both variables.
>
> I have the folowing dx output
>
> -------------------------------------
> Starting DX executive
> Open Visualization Data Explorer
> More Info at www.research.ibm.com/dx
> and www.opendx.org
> Version - 4.1.1
> Memory cache will use 500 MB (30 for small items, 470 for large)
>
> 0: worker here [12865]
> 0: ECHO: ------------- step 1 ------------------------
> 0: ECHO: out1= 1 out2= 11
> 0: ECHO: sum1= 2 sum2= 12
> 0: ECHO: ------------- step 2 ------------------------
> 0: ECHO: out1= 12 out2= 13
> 0: ECHO: sum1= 13 sum2= 14
> 0: ECHO: ------------- step 3 ------------------------
> 0: ECHO: out1= 14 out2= 15
> 0: ECHO: sum1= 15 sum2= 16
> 0: cleaning up and exiting
>
> -------------------------------------------------
> As you can see is the second variable retrieve in the second step, where
> the first is expected. Strange ???
>
> Hopefully anybody can help me.
>
> Kind Regards
>
> Eelco
>
>
>
>