[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] HOW do I writeval a dynamic variable instead of manual type .. ??


  • To: <amibroker@xxxxxxxxxxxxxxx>
  • Subject: Re: [amibroker] HOW do I writeval a dynamic variable instead of manual type .. ??
  • From: "Tomasz Janeczko" <amibroker@xxxxxx>
  • Date: Tue, 26 Oct 2004 20:29:56 +0200

PureBytes Links

Trading Reference Links

Hello,

Quick answer is:

for( i = 1; i < 10; i++ ) 
 { 
 printf( "%g", VarGet( "C"+i ) ); 
 }


But code like this:


for( i = 1; i < 10; i++ ) 
{ 
VarSet( "C"+i, Ref( C, -i ) ); 
} 

for( i = 1; i < 10; i++ ) 
{ 
Plot( VarGet( "C"+i ), "C"+i, 1+i ); 

}
// writing manually to test 
WriteVal(C1);
WriteVal(C2);
WriteVal(C3);


is awfully redundant. 

Why just not write simply:

for( i = 1; i < 10; i++ ) 
{ 
   temp = Ref( C, -i );
   Plot( temp, "C"+i, 1+i );
   printf( "%g", temp );
}


Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: <das300@xxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, October 26, 2004 8:03 PM
Subject: [amibroker] HOW do I writeval a dynamic variable instead of manual type .. ??


> 
> 
> HI Im playing with DYNAMIC vARIABLES-
> 
> How do I dynamically display in viwer rather than write manually 
> every variable ??
> I tried incorporating Writeval(C+i);  but i get error
> 
> ANy HINTS??
> 
> // BELOW is my code ===============================
> 
> for( i = 1; i < 10; i++ ) 
> { 
> VarSet( "C"+i, Ref( C, -i ) ); 
> } 
> 
> 
> for( i = 1; i < 10; i++ ) 
> { 
> Plot( VarGet( "C"+i ), "C"+i, 1+i ); 
> 
> }
> 
> // writing manually to test 
> WriteVal(C1);
> WriteVal(C2);
> WriteVal(C3);
> 
> 
> 
> 
> 
> 
> Check AmiBroker web page at:
> http://www.amibroker.com/
> 
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/