Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
suspected unassigned variable in OI10
I am getting a heap of 'suspected unassigned variable' and with the line numbers also out for the reference.
The variables are assigned. e.g:
Day = Field(Dte,'/',1)
first line number is ok and info message is 'suspected unassigned variable : Day'
version 3.4.0.1
The variables are assigned. e.g:
Day = Field(Dte,'/',1)
first line number is ok and info message is 'suspected unassigned variable : Day'
version 3.4.0.1
Comments
The warning is correct in that both of those are unassigned variables. The first line number is wrong though. Both of those variables exist on the same line, 1155, and that's the only place they exist.
So where does line number 1516 come from for variable "owner"?
Perhaps coincidentally but the word "owner" does exist on that line. It's just that it is contained within a string.
Editor is version 3.3.3.3 and OI 9.4.4 if that makes any difference.
Here's what the OI editor returned
It should be like this
In case it helped.
https://github.com/jgschis/BasicPlusParser/blob/master/BasicPlusParser/Analyser/UnassignedVariableAnalyser.cs
It first builds an abstract syntax tree, then it simulates running the program and keeps track of what's been assigned.