Musing re "use of unassigned var" warning
Posted: Wed Nov 25, 2020 6:30 pm
Above warning i get for code like:
AFAIU, aFiles CAN'T be used, if the assignment fails - the app will dissappear prior to using the var.
Initializing aFiles further up would remove the warning, but would i really gain something?
Code: Select all
LOCAL aFiles AS FileSystemInfo[]
...
TRY
aFiles:= aDirs[i]:GetFileSystemInfos("*."+ cExtension)
CATCH
System.Environment.Exit(0)
END TRY
...
FOR j:=1 UPTO aFiles:Length
...
Initializing aFiles further up would remove the warning, but would i really gain something?