I made some changes (still analyzing what is wrong), and getting the following error without any line number:
Operator cannot be applied to these types
The following lines are causing it:
on ControlChangeEvent(ccMessage : ControlChangeMessage) from MidiInFcb1010
var
ccValue : integer = GetCCValue(ccMessage)
lowestLowerChannel : string = "5678"
x : integer
x = lowestLowerChannel - 1
String lowestLowerChannel is a string and the operation - 1 is not allowed for strings, the error is given correctly, however, the line is not shown (and the cursor jumps to the first line of the script).