I'm looping through the a folder collecting specific types of files
when I have multiple records to collect in a single folder the code is not generating a New instance of my structure...its writing over the First Instance
Below is pseudo of what I am doing
my List (or collection) is WorkMonster\AnimationCollection()
.Animations is my Structure containing
\TypeID
\Graphic
Code: Select all
If ExamineDirectory(0, MPATH$, "*.png")
While NextDirectoryEntry(0)
LoadImage(#imgSrcImage, MPATH$+FileName$, 0)
If FindString(LCase(DirectoryEntryName(4)), "walk") > 0
Move = 1
endif
If FindString(LCase(DirectoryEntryName(4)), "run") > 0
Move = 1
endif
switch Move
case 1
WorkFacAnimation.Animations
WorkFacAnimation\TypeID = #Movement
FreeImage(WorkFacAnimation\Graphic)
WorkFacAnimation\Graphic = CopyImage(#imgSrcImage, #PB_Any)
AddElement(WorkMonster\AnimationCollection())
WorkMonster\AnimationCollection() = WorkFacAnimation
endswitch
wend
endif
Animations WorkFacAnimation = new Animations()
this forces a new instance of the class or structure
how do I force this NEW concept?