Page 1 of 1
Properties of an array value?
Posted: 21 Jan 2022, 00:58
by chinagreenelvis
Code: Select all
ObjRelease(ListedGames)
ListedGames := Object()
Loop, Files, %SearchFolder%\*.*, FR
{
SplitPath, A_LoopFileFullPath, , , , FileNameNoExt
ListedGames.Push(A_LoopFileFullPath)
For Index, ListedGame in ListedGames
{
If (ListedGame = A_LoopFileFullPath)
{
ListedGames[A_Index].FileNameNoExt := FileNameNoExt
MsgBox, % ListedGames[A_Index].FileNameNoExt
}
}
}
Not sure what I'm doing wrong here, but the messagebox returns a blank in this section of my code. Any help is appreciated.
Re: Properties of an array value? Topic is solved
Posted: 21 Jan 2022, 03:05
by amateur+
Code: Select all
ObjRelease(ListedGames)
ListedGames := [{}]
Loop, Files, %SearchFolder%\*.*, FR
{
SplitPath, A_LoopFileFullPath, , , , FileNameNoExt
ListedGames.Push({FileFullPath: A_LoopFileFullPath})
For Index, ListedGame in ListedGames
{
If (ListedGame.FileFullPath = A_LoopFileFullPath)
{
ListedGames[Index].FileNameNoExt := FileNameNoExt
MsgBox, % ListedGames[Index].FileNameNoExt
}
}
}
Re: Properties of an array value?
Posted: 21 Jan 2022, 03:24
by chinagreenelvis
Interesting, thanks very much!