C
C#16mo ago
Papa Quill -

❔ Maximum value in a text box

Trying to get a text box to have a max value of 2147483647/int32 limit. It works fine for setting things to 0 if they're below it but above 2147483647 isn't working, the message box won't show either
8 Replies
Haze.
Haze.16mo ago
Please read what you just typed again, you're trying to set an int to higher than the max int value?
Papa Quill -
Papa Quill -16mo ago
Hm?
Papa Quill -
Papa Quill -16mo ago
It's 4 bytes I want to make it so if the value in the text box is above 2,147,483,647 then it sets the text to 2,147,483,647
Haze.
Haze.16mo ago
But value can never be greater than 2147484647?
mtreit
mtreit16mo ago
You're going to need to parse it into a long (64 bit int)...clearly you can't have an int value greater than the maximum int value...that's a contradiction
Papa Quill -
Papa Quill -16mo ago
Right, sorry I had a brain malfunction. Thanks
mtreit
mtreit16mo ago
If it's guaranteed to never be negative you might also be able to use unsigned int instead of long Depending on your actual needs.
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server