Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 00:53:39 +0000



Post From: whay do i get no operator "[]" matches these operands error in Visual Studio Debuding?

[2021-07-08 15:17:58]
bradh - Posts: 854
How is it possible that [] operator is not supported? i don't get it.

How do i get to see the value? it makes debugging almost impossible

The [] Operator in this case means the debugger doesn't recognize the individual array elements.

I don't know how to get the VS debugger watch list to let you look at specific elements of an array, or if it is even possible. I asked this a long time ago and got no answer.

This is what I do to work around that. Create a persistent variable, assign it to the value of sc.Close[sc.Index] and add the persistent variable to the watch list. You can use a regular variable, but if you want to only break when the value changes, it will always reset each time the study is called. With a persistent variable you won't have that problem.

float& ClosePrice = sc.GetPersistentFloat(0);
ClosePrice = sc.Close[sc.Index];