Help with a code

Monkey Forums/Monkey Beginners/Help with a code

Armoured(Posted 2016) [#1]
Hi,
in this code what is the function of the ">" operator?

Method AddHL(inValue:Short)
Local value:Int = HL + inValue;
SetHL(value)
CARRY = (value > 65535)
End Method


Danilo(Posted 2016) [#2]
'>' is a comparison operator and means 'greater than'.
It's a boolean operator and the result of the expression is True or False (0 or non-null).

CARRY = (value > 65535)

means:
If value > 65535 Then CARRY = True Else CARRY = False

It is used to check overflow of an unsigned Short (16-bit) data type.


Armoured(Posted 2016) [#3]
Thanks Danilo