I'm working on a project where I need to dynamically position lines on the screen. I have structures for what these lines represent, and they are in an array. Is there a way to create an array of lines so I can loop through and do something like:
FOR i := 0 TO 10 DO
.....line[i].Position.Points[0].X := bin[0].left;
.....line[i].Position.Points[1].X := bin[0].right;
END_FOR
How and where would I declare such an array? Is there a structure somewhere that represents the positional data of the line?
You can do this using a polyline element in your visualization. Under the "Dynamic Points" properties of the element you specify a pointer to the points array. The structure of the points is VisuElems.VisuStructPoint. Some of your code would look like:
VAR
  aGraphPoints    :  ARRAY[0..99] OFVisuElems.VisuStructPoint;
  iCount   :  INT;END_VARFORiCount :=0TO99DO
  aGraphPoints[iCount].iX :=SOMEVALUE_X[iCount];
  aGraphPoints[iCount].iY :=SOMEVALUE_Y[iCount];END_FOR
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm working on a project where I need to dynamically position lines on the screen. I have structures for what these lines represent, and they are in an array. Is there a way to create an array of lines so I can loop through and do something like:
FOR i := 0 TO 10 DO
.....line[i].Position.Points[0].X := bin[0].left;
.....line[i].Position.Points[1].X := bin[0].right;
END_FOR
How and where would I declare such an array? Is there a structure somewhere that represents the positional data of the line?
Thanks!
Joe
Related
Talk.ru: 1
You can do this using a polyline element in your visualization. Under the "Dynamic Points" properties of the element you specify a pointer to the points array. The structure of the points is VisuElems.VisuStructPoint. Some of your code would look like: