I have a procedure that is throwing me an error from an

IF statement and I’m struggling trying to find out what

the problem is. Here is my entire code in the procedure:

```
local XXXHomeWinsR1, XXXHomeWinsR2, XXXHomeWinsR3,
XXXHomeWinsR4, XXXHomeWinsR5, XXXHomeWinsR6,
XXXHomeWinsR7, XXXAwayWinsR1, XXXAwayWinsR2,
XXXAwayWinsR3, XXXAwayWinsR4, XXXAwayWinsR5,
XXXAwayWinsR6, XXXAwayWinsR7
for theRound, 1, 7
IF
fieldvalue("HomeR" + theRound + "TotalPointsIncludingHCap") >
fieldvalue("AwayR" + theRound + "TotalPointsIncludingHCap")
set "XXXHomeWinsR" + theRound, 1
set "XXXAwayWinsR" + theRound, 0
ELSEIF
fieldvalue("HomeR" + theRound + "TotalPointsIncludingHCap") <
fieldvalue("AwayR" + theRound + "TotalPointsIncludingHCap")
set "XXXHomeWinsR" + theRound, 0
set "XXXAwayWinsR" + theRound, 1
ELSE // must be equal points so now count the Wins and use that:
shortcall calcRoundTotals
IF
HomeWins > AwayWins
set "XXXHomeWinsR" + theRound, 1
set "XXXAwayWinsR" + theRound, 0
ELSEIF
HomeWins < AwayWins
set "XXXHomeWinsR" + theRound, 0
set "XXXAwayWinsR" + theRound, 1
ELSE // the Wins must be equal
set "XXXHomeWinsR" + theRound, .5
set "XXXAwayWinsR" + theRound, .5
ENDIF
ENDIF
message "Round " + theRound + " " +
"Home = " + datavalue("XXXHomeWinsR" + theRound) + " " +
"Awat = " + datavalue("XXXAwayWinsR" + theRound)
ENDLOOP
calcRoundTotals:
FOR theLine, 1, 5
// calculate the Away player's number
let APNumbr = ((theLine + theRound + 3) MOD 5) + 1
// reset both Win counters
makelocals HomeWins = 0, AwayWins = 0
// the error happens in the following IF statement:
IF (fieldvalue("", "HP"+theLine+"R"+theRound+"Score") ≥ 10) OR
((fieldvalue("", "HP"+theLine+"R"+theRound+"Score") = 7) AND
(fieldvalue("","AP"+APNumbr+"R"+theRound+"Score")) = 0)
increment HomeWins
ELSEIF fieldvalue("", "AP"+APNumbr+"R"+theRound+"Score") ≥ 10 OR
fieldvalue("", "AP"+APNumbr+"R"+theRound+"Score") =7 AND
fieldvalue("", "HP"+theLine+"R"+theRound+"Score" ) = 0
increment AwayWins
ELSE
increment HomeWins, .5 increment AwayWins, .5
ENDIF
ENDLOOP
RETURN
```

Here is the error message:

Any help would be greatly appreciated.