You can adjust pointers by casting them to PtrInt on FreePascal or NativeInt on Delphi.

However, I would advice that you change your code so that you don't need this comparison. For instance, try comparing actual indices to an array instead. The way you want to compare the pointers is very troublesome; it could be both unpredictable and unreliable.