How to use 'Cardinal' in dwscript
Issue #279
closed
‘Cardinal’ is not a base type in dwscript.If I want to use it, How can I do.
Comments (2)
-
repo owner -
repo owner - changed status to closed
- Log in to comment
No, there is no unsigned base type. If you need a 32bit unsigned for comparisons, you can use the Unsigned32() function on the script side.
When receiving an Int64 on the Delphi-side from a script function you can just cast it with Cardinal().
As script Integer type is actually an Int64, it can be used for UInt32 math, just use Unsigned32() at the end of a computation to trim the excess bits.
If you need an UInt64 however, you may have to rely on the BigInt type on the script-side.