Some help with arrays needed

 

Hello,

I'm struggling to get my head around the following:


#property indicator_buffers 5

double Buff1[];

// ---

int init()

SetIndexBuffer(4, Buff1);

// ---

int start()

CVF()

// ---

void CVF()

double Var1 = 1.33;

Buff1[i] = Var1;

Print("Debug " + Var1 + " - " + Buff[i] + " - " + i);

This will return something like:

Debug 1.33 - 0 - 197

So why isn't Buff[i] taking the value of Var1?

Any pointers greatly appreciated!

 
toast:

Hello,

I'm struggling to get my head around the following:


This will return something like:

So why isn't Buff[i] taking the value of Var1?

Any pointers greatly appreciated!

void CVF()

double Var1 = 1.33;

Buff1[i] = Var1;

Print("Debug " + Var1 + " - " + Buff[i] + " - " + i);
 
int init()

SetIndexBuffer(4, Buff1);
Start with getting your code to compile. ^ that won't.
 
angevoyageur:



Sorry, a typo in what I posted on here. They match in the code (and compile without error; there is no array called Buff[])
 
toast:

Sorry, a typo in what I posted on here. They match in the code (and compile without error; there is no array called Buff[])
Follow WHRoeder advice, please post code that compiles if you need help.
 
WHRoeder:
Start with getting your code to compile. ^ that won't.


It compiles without error or warning (on both old build and new build). There is nearly 1000 lines of code, so I've snipped the relevant parts for simplicity which may be causing confusion. I was merely trying to indicate which sections the various bits came from.


 
toast:


It compiles without error or warning (on both old build and new build). There is nearly 1000 lines of code, so I've snipped the relevant parts for simplicity which may be causing confusion. I was merely trying to indicate which sections the various bits came from.




My stupid mistake.. overlooked increasing the IndicatorBuffers from earlier on.

But it didn't throw up any compile errors. Odd!

Thanks anyway.

Reason: