Login Page - Create Account

Support Board


Date/Time: Sat, 20 Apr 2024 05:19:32 +0000



Post From: Pointer error - Help with Tool.LineWidth[]

[2022-09-25 13:57:03]
User92573 - Posts: 475
Dear Support

I'm using the SC Tool and have tried both the following:


Tool.LineWidth[2] = Input_LineWidth_02.GetInt();
Tool.LineWidth[2] = 2;
  
But I can't seem to solve the following error.

error C2109: subscript requires array or pointer type

It's all very simple.



SCInputRef Input_Level_02_LineWidth = sc.Input[2]; // array for line 2 width

and in Set Defaults

Input_Level_02_LineWidth.SetInt(2); // set the int value for line width,

followed in the Processing section by either:

Tool.LineWidth[2] = Input_LineWidth_02.GetInt(); // get width value for line 2 "Tool[2]"

or

Tool.LineWidth[2] = 2; // set directly width for Tool.LineWidth[2]


which produces the above error:

error C2109: subscript requires array or pointer type

What I can't understand is why even
Tool.LineWidth[2] = 2;
is causing an error?

Any help appreciated.

Many thanks