Sign in to follow this  
Followers 0
DaleHohm

How long can a variable name be?

3 posts in this topic

How many characters long can a variable name be in AutoIt3?

This is a question and a suggestion...

I looked in the helpfile in the "Language Reference -> Variables" section, under the "Dim" statement, and under the "FAQ -> What are the current Technical Limits of AutoIt V3" and didn't find the info. The suggestion is that the answer be placed in all three sections of the helpfile.

Thanks,

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

How many characters long can a variable name be in AutoIt3?

´

I'm new to autoit, but according to the sources:

==> script_lexer.cpp:91

// Token variable must be recreated before use as it has limited housekeeping
  static char       szTemp[AUT_MAX_LINESIZE+1];

Thus a token must be less than AUT_MAX_LINESIZE long.

==> AutoIt.h:73

#define AUT_MAX_LINESIZE        4095

According to this the maximum length of a variable name depends on

the "extra" charaters (comments, etc.) in a line. The maximum length

for a variable name would be 4090 characters, if there are no comments

and other "useless" extras.

However, you would not be able to use that variable, as there would be no

room for the characters of the other commands in a line, e.g. (msgbox).

Realistically, the maximum length for a variable name is something

lt 4000 characters to be still usefull. I guess, that should be enough for

most of the "average" scripts.... ;-)

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

4095 -- thanks for digging that out Kurt.

I guess that could explain why no one has complained :-)

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
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
Sign in to follow this  
Followers 0