New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsigned datatypes #9
Comments
Like! For consideration, though, we may need to also support the equivalent of C#'s Furthermore, for Automation compatibility, this may need to be flagged if it is exposed. I don't think it should be prevented from doing so but this can cause problem in the clients that expect the COM server to be Automation-compatible. |
'ULongPtr' would also makes sense to enable easier pointer arithmetic. I know that you will have this in mind, just for the records. |
Another option is to keep I'm really baffled that this is not already implemented in VBA 7 ( Btw, do |
@wqweto Yes, you're quite right there. I suspect the proposed change would not affect the vast majority of code adversely, but I'd prefer to see the overflow checks on LongPtr to be removed only via a project flag (or perhaps automatically applied when the current LAA flag is set in the project settings), purely due to maintaining full backwards compatibility with VBA. With regards to unsigned type overflows, yes we'll be following the existing (unsigned) Byte behaviour. And also yes, we'll be adding the U suffix for the datatype characters. Thanks! |
Btw, in VBA x64
Notice how the overflow spills into the sign bit which is probably a bug, a useful one too :-)) |
Yes, looks the same in tB, which would be expected with it using the same OS variant functions (VarMul etc) |
Is your feature request related to a problem? Please describe.
VB6/VBA has no unsigned datatypes, except the 'Byte' datatype.
Describe the solution you'd like
Unsigned datatype for 'Integer', 'Long' and 'LongLong'.
And a signed version of 'Byte'.
Additional context
Naming proposals:
UInteger (unsigned integer)
ULong (unsigned long)
ULongLong (unsigned long long)
SByte (signed byte)
Edit: (and corresponding conversion functions)
CUInteger()
CULong()
CULongLong()
CSByte()
The text was updated successfully, but these errors were encountered: