Intrinsic-5 Extend

Top  Previous  Next

5: variable:= Extend(value);

 

This intrinsic extends the sign bit of the low byte to a 32-bit integer. It is useful when fetching signed numbers from a character array. For example:

 

       X:= Extend($FD);        \X gets $FFFFFFFD (= -3)

       X:= Extend(3);                \X gets $00000003