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

RE: [amibroker] Declaring array and determining size



PureBytes Links

Trading Reference Links

Here is an example of using array with set initial array values that I use

//Price range values

Price[0] = 0;
Price[1] = 0.1;
Price[2] = 0.25;
for( n=3; n<=HighLevel; n++ )
{
 Price[n] = 2*Price[n-1];
}



Cheers,
Graham
http://groups.msn.com/ASXShareTrading
http://groups.msn.com/FMSAustralia 

-----Original Message-----
From: Tomasz Janeczko [mailto:amibroker@xxxxxx] 
Sent: Monday, 24 November 2003 8:23 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Declaring array and determining size


Gordon,

1. The value of UNINITIALIZED elements is just that - uninitialized
(random).

To initialize it is enough to write

 a = 0; // initialize with zero (at this point it is simple numeric variable
// but will be upsized to array on first index operation.  a[0] = 33;  a[2]
= 34;

2. The size of array is equal to BarCount

Hope this helps.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Gordon" <amibroker@xxxxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, November 24, 2003 1:10 AM
Subject: [amibroker] Declaring array and determining size


> Apparently, I can create an array in AFL merely by a statement such 
> as:
> 
> a[0] = 33;
> 
> This works as well:
> 
>  a[0] = 33;
>  a[2] = 34;
> 
> _TRACE("" + a[0]);
> _TRACE("" + a[1]);
> _TRACE("" + a[2]);
> 
> btw, the value I get for a[1] is:
> 
>  3.32455e-038
> 
> not sure why -- I would have expected 0. At any rate, can anyone tell
> me how to find the number of elements in a dynamcially created array? 
> Thanks,
> 
> Gordon
> 
> 
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/
> 
> 
> 

------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy
Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark Printer
at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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