Unexpected results with LockTry
ke4pjw
Posts: 1,169
I was expecting repeat until not locktry(EthernetLock)
to work, as lockset does. But it does not. It returns a -1 ($FFFF_FFFF) as expected, however it never breaks out of the loop. repeat until locktry(EthernetLock) < 0
does work. Is this expected?
Thanks,
Terry
Comments
How about
repeat while locktry(EthernetLock)
Mike
locktry
andlockset
have opposite return values, IIRC; one of the "gotchas" when porting from Spin1 to Spin2.Also note that your two loops:
repeat until not locktry(EthernetLock)
and
repeat until locktry(EthernetLock) < 0
have opposite tests:
not locktry(EthernetLock)
will be true only when the locktry returns 0 (thenot
flips all the bits), whereaslocktry(EthernetLock) < 0
will be true only when locktry returns -1.