XS0165 Use of unassigned local variable
Posted: Thu Dec 21, 2023 9:58 pm
Another warning which seems incorrect to me:
In the forelast line I get XS0165 Use of unassigned local variable oFTP
But the variable is assigned, and I'd say the FTP connection can just as well be closed in a Recover situation as it is done just a few lines up.
Technically I understand that the assignment of the error handler could cause an exception meaning it reaches the Recover + oFTP:Close before it is assigned.
But practically, this shouldn't be something to warn for I would say?
Dick
Code: Select all
Begin Sequence
bErrorHandler := {|oError| _Break(oError)}
bLastHandler := ErrorBlock(bErrorHandler)
oFTP:=FtpAX{}
......
oFTP:Close()
Recover
oFTP:Close() // This is the warning line
End
But the variable is assigned, and I'd say the FTP connection can just as well be closed in a Recover situation as it is done just a few lines up.
Technically I understand that the assignment of the error handler could cause an exception meaning it reaches the Recover + oFTP:Close before it is assigned.
But practically, this shouldn't be something to warn for I would say?
Dick