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

[amibroker] Setting the variable type - Close minus Close



PureBytes Links

Trading Reference Links

Someone asked earlier about why I had used the expression
Count = Close-Close;
 in initializing my arrays to zero and I found out from my tutor 
this morning why I had been taught that convention.
 
Most of the time you will not get into any issues if you write
 
Count = 0;
 
rather than
 
Count = Close - Close;  or    Count = C-C;
 
However if you call or exit to VBscript or potentially jScript utilities in the same AFL module,
the script  functions don't know in what context you used Count = 0;  i.e. was it  a scalar you
are passing or an array(vector) as a parameter; but if you initialize it as an array there will be no doubt.
 
An example would be if you call a VB utility and use the variable count as a parameter
without defining it as an array you could get some wierd errors,  for example if you
tried to intierate count[i]  inside the VB script you probably would get a surpise.    
 
The flexibility of AFL is great in that it doesn't require you to define arrays and scalars,
it figures in what context you used it for the most part without any hickups.  There have
been many versions of AB since that convention was adopted but it doesn't take much
time to TYPE your variable as an array.
 
I'll be happy to stand corrected by someone knowegable in programming and AFL
if I didn't represent this correctly.  Let me know.
 
Hope this helps.
JOE


Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





YAHOO! GROUPS LINKS