I did a search on the matter but in most cases the 'type values must use the same type' error topic in the forums tend to be related to returning UDTs from functions. But I can't return a UDT from an array into a UDT variable.
It is not the end of the world, and this snippet is not the most useful form of local UDT variable usage, but I posted this one because it is brief.
It would be nice to not have to keep telling the CPU where the entry is in the array for every operation and expression.
InitPerformanceLog:
Dim UpdateRating( UpdateRatingRows, UpdateRatingColumns ) as UpdateRatingType
Return
//========================================================
Type UpdateRatingType
Ticks as Double Integer
Ms as Double Integer
Text$
Endtype
//========================================================
Function UpdateRate(Name$, ticks as Double Integer, ms )
Local r as UpdateRatingType
r = UpdateRating( UpdateRatingRow, UpdateRatingColumn )
r.Text$ = Name$
r.Ticks = ticks
r.Ms = ms
UpdateRating( UpdateRatingRow, UpdateRatingColumn ) = r
If UpdateRatingRow < UpdateRatingRows
Inc UpdateRatingRow
Endif
Endfunction
rem Not the most useful form of local UDT variable usage, but I posted this one because it is brief.