Looking for a New Solution to Existing SPIN to SPIN2 code
CJMJ
Posts: 226
in Propeller 2
The following method worked fine in SPIN:
PUB limitRange(value, lowest, highest)
value #>= lowest
value <#= highest
RETURN value
SPIN2 doesn't like the 'RETURN value'.
PUB limitRange(value, lowest, highest) : value
value #>= lowest
value <#= highest
The above errors to: Expected a unique result name
PUB limitRange(value, lowest, highest)
value #>= lowest
value <#= highest
RETURN value
SPIN2 doesn't like the 'RETURN value'.
PUB limitRange(value, lowest, highest) : value
value #>= lowest
value <#= highest
The above errors to: Expected a unique result name
Comments
PUB limitRange(value, lowest, highest):result
result := value
result #>= lowest
result <#= highest
This code is giving you a problem because you are using "value" as a parameter name and the name of the return variable.