about getting values from Tlist in delphi -


i storing pixel values file. file reading tlist getting following error:

incompatible type : sortstring string

and

incompatible type : string pointer

what cause this?

code:

segment_point, first_line_point, end_line_point: tpoint; x1, y1, x2, y2, px, py: integer;  segment_point := templist.items[y]; first_line_point := mylist.items[y]; end_line_point := mylist.items[y + 1]; x1 := first_line_point.x; y1 := first_line_point.y; x2 := end_line_point.x; y2 := end_line_point.y; px := segment_point.x; py := segment_point.y; 

the answer simple mentioned before.

"segment_point" defined tpoint.

"templist.items" of type pointer (see delphi or hover mouse on code). different!!!. can't assign different types. missing code should show how deal "tlist".

when expected can use cast access data like: tpoint(templist.items[y]).

but please follow hints before , inform generic container!!


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

android - MPAndroidChart - How to add Annotations or images to the chart -