I am trying to read a specific line of .txt file, but the file path is derived from a variable defined by function. My problem is that FileReadLine gives an empty value if variable is used, but it works properly if I use a direct path. How can I make this work?
My Code:
Code: Select all
path := % PathChecker("Steam: ", "steamapps") ;function giving first part of path to the file
{
steam_path = %path%\common\game\build-info.txt ;adds second part of path
FileReadLine, Steam, %steam_path%, 6
; Cuts off needed part of line
StringTrimLeft, Steam1, Steam, 13
StringTrimRight, Steam2, Steam1, 2
}
MsgBox, %Steam2%
return