Xenobiologist Posted January 9, 2008 Share Posted January 9, 2008 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 More sharing options...
DW1 Posted January 9, 2008 Share Posted January 9, 2008 Looks like 19 to me... bummer Global Const $zahl1 = 132132132343242349898989898989834324234 Global Const $zahl2 = "132132132343242349898989898989834324234" ConsoleWrite(StringLen(String($zahl1)) & @CRLF) ConsoleWrite(StringLen(Number($zahl2)) & @CRLF) AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 9, 2008 Author Share Posted January 9, 2008 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 More sharing options...
DW1 Posted January 9, 2008 Share Posted January 9, 2008 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 AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Paulie Posted January 9, 2008 Share Posted January 9, 2008 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 More sharing options...
Xandl Posted January 9, 2008 Share Posted January 9, 2008 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 More sharing options...
Xenobiologist Posted January 9, 2008 Author Share Posted January 9, 2008 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 More sharing options...
james3mg Posted January 9, 2008 Share Posted January 9, 2008 (edited) 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,MegaGosh, 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 Edited January 9, 2008 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 More sharing options...
DW1 Posted January 9, 2008 Share Posted January 9, 2008 (edited) That workaround still says 19... didn't change anything EDIT: Damn penguins... I knew it. Edited January 9, 2008 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 9, 2008 Author Share Posted January 9, 2008 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 More sharing options...
james3mg Posted January 9, 2008 Share Posted January 9, 2008 (edited) 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...9223372036854775807So 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 January 9, 2008 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 More sharing options...
Xenobiologist Posted January 9, 2008 Author Share Posted January 9, 2008 (edited) 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 January 9, 2008 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 More sharing options...
james3mg Posted January 9, 2008 Share Posted January 9, 2008 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, MegaThat 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 More sharing options...
DW1 Posted January 10, 2008 Share Posted January 10, 2008 I was just wondering the same thing... where would the error come from..... but maybe there should be a macro to see if there are any variables that were changed from what was originally requested. would be nice anyways. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 10, 2008 Author Share Posted January 10, 2008 Hi,see here : http://www.autoitscript.com/forum/index.php?showtopic=61439So 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now