PDA

View Full Version : Array access through index



Balasaravanan
07-10-2014, 04:21 PM
I would like to know how to access a array through an index

Dim indicator_buffer()
CopyHigh 0,1, bars(0),indicator_buffer
Dim buffer_val

buffer_val = indicator_buffer[0]
he above line causes a compile error

Hassan-HS
07-11-2014, 08:44 AM
Hello,


You can do this as following.



Dim indicator_buffer()
CopyHigh 0,1, bars(0),indicator_buffer
msgbox indicator_buffer(1)


Note: note that if any array is returned form one of CopyXXXXX methods, the first index of it will be 1 not 0.

Hassan-HS
07-11-2014, 08:45 AM
Hello Again,


This Article (http://www.hybrid-solutions.com/VTL%20Course.pdf)will help you to know the basics in VTL