First off, all the code is not listed in the while loop so please don't focus on that part of the code. I do have it working going backwards thru the TList.
Now I'm not using the for...eachin loop because I want to go through the list backwards. When I get to my previous link I want to update the type info but when I do that and get back to the main loop my changes didn't take.
The problem I'm having is with 'lstObject'. I want to increment 'lstObject.ypos_i' by 55 but when I leave my loop the change doesn't take.
I test this by running a for...eachin loop after it and it doesn't show the value has been changed.
Type TTile
Field xpos_i:Int
Field ypos_i:Int
Field zpos_i:Int
Field tileColor:String
Field pic:TImage
End Type
Type TEngine Extends TTile
Global Tilelist:TList = New TList
Method GoThruListBackwards()
Local LastTEngineObject:TLink
Local CurrentTEngineObject:TLink
Local lstObject:TEngine
LastTEngineObject = Tilelist.LastLink()
lstObject = TEngine(LastTEngineObject._value)
While(1)
CurrentTEngineObject = LastTEngineObject.PrevLink()
If CurrentTEngineObject = Null
Exit
EndIf
lstObject = TEngine(CurrentTEngineObject._value)
lstObject.ypos_i:+55 ***This Doesn't Take***
Wend
'**When I iterate thru the list my ypos hasn't been
'**updated
For k:TEngine = Eachin TileList
Next
End Method
End Type
|