Question about "Array" in "Loop function"

Hi

Normally when I do loop function, I put [i] behind all of arrays and other variables.
ex.
close[i];
H[i];
L[i];
C[i];
ABC[i];

but some Array for example Day(), Year(), timenum(), etc…
I can’t put [i] behind them. So I tried many ways and found a solution like this

DDay = day();
for( i=0; i <barcount; i++)
{
DDay[i]
}

My question is ; Are there any ways to skip “DDay = day();” line and put [i] directly in Array
such as day(i), day()[i], or day[i] ?

Thank you for all the answers

my appologize if someone else already asked this question.

You mix up everything.

Array is a DATA TYPE.

Data type should not be confused with type of IDENTIFIER.

Close / High / Low / Open are built-in VARIABLE identifiers.

Day() or Year() are NOT variables. These are FUNCTION indentifiers.
Use google or wikipedia to find out what is the difference between function and variable, what is data type and what is an identifier.

Also read carefully (possibly many times until it sinks) http://www.amibroker.com/guide/a_language.html

Subscript operator [] can only be applied to variables that hold arrays.

3 Likes