PureBytes Links
Trading Reference Links
|
<SPAN
class=845121912-25102003>thanks william, that's what I'll do
then.
<SPAN
class=845121912-25102003>
<SPAN
class=845121912-25102003>dave
<SPAN
class=845121912-25102003>
<BLOCKQUOTE
>
I don't believe the AFL has a
function that returns the number of elements in an array.
If you are constructing your
own arrays as opposed to using the stock arrays I would simply maintain the
element count within a variable.
As stated in the first post
when you refer to elements in the stock arrays the first bar is 0 and the last
bar is Barcount -1 (these arrays are zero based).
Regards,William Peters<A
href="">www.amitools.com
<FONT face=Tahoma
size=2>-----Original Message-----From: Dave Merrill
[mailto:dmerrill@xxxxxxx]Sent: October 25, 2003 1:02
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker]
size of an array in AFL?
<SPAN
class=299235307-25102003>in most languages, it's possible to find out the size
of an array directly, by examining some property of the array itself or
applying some function to it, without having to know how it was created. some
examples are:
<SPAN
class=299235307-25102003>
<SPAN
class=299235307-25102003> array.length
<SPAN
class=299235307-25102003> array.size
<SPAN
class=299235307-25102003>
SizeOfArray(array)
<SPAN
class=299235307-25102003>
<SPAN
class=299235307-25102003>is that possible in AFL? if not, it can be worked
around since we do in general know how every array was created, but it's less
elegant and less self contained.
<SPAN
class=299235307-25102003>
<SPAN
class=299235307-25102003>dave
<SPAN
class=299235307-25102003>
<BLOCKQUOTE
>I'm
not sure how to answer this because it depends on which array you are
refering too.Are you refering to a stock data array of some
description? If so you could use the Barcount constant which will return the
number of bars in the array. Remember it's zero based so the last bar is
refered to as: Barcount - 1Regards,William
Peterswww.amitools.com-----Original
Message-----From: Dave Merrill
[mailto:dmerrill@xxxxxxx]sorry for the dumb question, but what's
the syntax for getting the size(number of elements) in an array? I want
to do something like this, onlythat
works: for(i=1; i<=array.length;
i++) {thanks,daveSend BUG
REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Send
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
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 the Yahoo! Terms of Service.
|