Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 20:17:06 +0000



Post From: the possibility of two consecutive manual looping

[2018-12-26 01:53:51]
Andy Sureway - Posts: 93
Hello SC staff,

I am working on an indicator which uses two passes of manual looping (from sc.UpdateStartIndex to sc.ArraySize). It seems that ACSIL has some format restraint, which disallow this to happen.

To make it clearer, what I want is:

for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++) {
// pass 1
}
for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++) {
// pass 2
}

I have done several tests. It seems impossible to even add two or more additional statements after the first manual looping.

I know how to bypass this format constraint, as seen below. But just want to confirm whether my understanding is correct.

for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++) {
// pass 1
if(BarIndex == sc.ArraySize-1)
for (int BarIndex2 = sc.UpdateStartIndex; BarIndex2 < sc.ArraySize; BarIndex2++) {
// pass 2
}
}

Thanks a lot!
Date Time Of Last Edit: 2018-12-26 01:54:56