Jump to content

Limit of StringLen and Numbers of Autoit?


Recommended Posts

Hi,

what is the limit of StringLen and what is the limit of Autoit calculating with numbers?

What does StringLen do with bumbers?

Global Const $zahl1 = 132132132343242349898989898989834324234
Global Const $zahl2 = "132132132343242349898989898989834324234"
ConsoleWrite(StringLen($zahl1) & @CRLF)
ConsoleWrite(StringLen($zahl2) & @CRLF)

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

hmmh it is kind of strange to me. Maybe somebody knowing the func can explain it to me.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

The limitation isn't set by StringLen().

I think it is no numbers can be that big in autoit. <---- waiting to be proved wrong... probably by a penguin :)

15. What are the current technical limits of AutoIt v3?

...

Number range (integers): 64-bit signed integer

...

Link to comment
Share on other sites

From help:

Maximum length of a single script line: 4,095

Maximum string length: 2,147,483,647 characters

Number range (floating point): 1.7E308 to 1.7E+308 with 15-digit precision

Number range (integers): 64-bit signed integer

Hexadecimal numbers: 32-bit signed integer (0x80000000 to 0x7FFFFFFF)

Arrays: A maximum of 64 dimensions and/or a total of 16 million elements

Maximum depth of recursive function calls: 384 levels

Maximum number of variables in use at one time: No limit

Maximum number of user defined functions: No limit

Maximum number of GUI windows: 1024

Maximum number of GUI controls per window: 4096

Link to comment
Share on other sites

Hi,

:) I know the helpfile.

But if the number is greater than 19 digits, shouldn't there occur an error in lieu of returning 19?

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

:) I know the helpfile.

But if the number is greater than 19 digits, shouldn't there occur an error in lieu of returning 19?

So long,

Mega

Gosh, was I confused when I posted.

Deleted.

Start over: it shouldn't return an error, because it can't hold a number that big to ever PASS to StringLen(), right? So maybe it truncates it to a number it can actually understand. Same thing if you try and String() the number...it can't pass that large a number to the String() function, so that doesn't work either.

I think you'd have to take the first 18 digits (to be safe), String() them, then take the next 18 digits, String them and append them to your first string, and so on until the end of the number...then run StringLen on that final string. Of course, that only works if you're getting that number from an external source (reading it, a database, etc), since AutoIt can't hold that large a number in the first place to break it apart.

Or just keep ignoring me...I don't really know what I'm talking about, I'm just speculating and thinking out loud :P

Edited by james3mg
"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

Hi,

I'm not searching for a workaround. I just wanted to show that the behaviour is kind of weird, cause there is no exact answer from StringLen passing numbers greater then 19 digitis and there also no error appearing.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

See my edit - my brain was elsewhere.

As an example, try this:

MsgBox(0,"hi",132132132343242349898989898989834324234)

I get 9223372036854775807, which is 111111111111111111111111111111111111111111111111111111111111111 in binary. So trying to use a number that long as a number will just get 'rounded' down to the largest possible number AI can hold...9223372036854775807

So it's not really an error - you've just filled up all of AutoIt's resources and it does the best it can. It doesn't understand larger numbers, so anything larger than 9223372036854775807 will be considered equivalant to it...since AutoIt's only looking at the first 64 bits to interpert a number.

There won't be an error, because the function isn't passed a number that's too big...it's passed the largest number AutoIt can understand. To be passed a number that's too big, AutoIt would have to be holding that number first.

But you're right - point well taken. It's weird, and one of those situations you don't expect that you'll have to test for manually.

..somehow.

Edited by james3mg
"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

Hi,

yes. I have to search the helpfile for that. IMO this is totally wrong! If Autoit cannot handle the number it should return an error othwerwise I think all works well, but obviously it doesn't cause Autoit reduces the numbers to its limit.

So long,

Mega

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

yes. I have to search the helpfile for that. IMO this is totally wrong! If Autoit cannot handle the number it should return an error othwerwise I think all works well, but obviously it doesn't cause Autoit reduces the numbers to its limit.

So long,

Mega

That would be nice. But AutoIt doesn't think there IS a problem - it's just looking at the first 64 bits of a number, and working with those - it doesn't REALIZE there's anything above the 64th bit (speculation on my part).

Also, to what function would you have it return an @error?

$var=132132132343242349898989898989834324234
? That's when the 'error' actually occurs, but I know that I don't check for errors after a simple variable assignment!

Like I said, point taken, but I think that's the nature of computers, isn't it?

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...