Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Size limit of variables in Applescript?

Size limit of variables in Applescript?
Thread Tools
AJM
Junior Member
Join Date: May 2001
Status: Offline
Reply With Quote
Mar 7, 2002, 05:21 PM
 
Hi all,
is there a limit on the length of variable content (so not the name), especially lists, in Applescript for OS X?
I have a script that keeps crashing on me (and with it the script editor) and I think it is because a list becomes too long.
Thanks,
AJM
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Mar 7, 2002, 06:15 PM
 
Originally posted by AJM:
<STRONG>Hi all,
is there a limit on the length of variable content (so not the name), especially lists, in Applescript for OS X?
I have a script that keeps crashing on me (and with it the script editor) and I think it is because a list becomes too long.
Thanks,
AJM</STRONG>
Not that I know of, I've had lists with thousands of items in them, it's most likely your script itself, maybe if you posted it, we could help troubleshoot it. That or raise the memory of the Script Editor/Smile/Applet
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Mar 8, 2002, 02:21 AM
 
AppleScript string constants can be no longer than 32K. If you need a longer string at compile time, you can concatenate multiple string constants with the & operator. Of course, you won't run into that limitation in Script Editor, because it can't edit scripts whose text is longer than 32K. As far as I know, there's no limitation on string size at runtime other than that imposed by available memory... and there's a lot of that to go around if you're running on OS X.

Numbers automatically transition from integer to real when necessary to preserve place value (precision? who needs it?). Not sure what the biggest floating-point number you can have in AppleScript is, but it's probably well into the 10 ^ 150 range.

Lists and records have no limit that I know of.... though now that I think about it, it might be limited to the maximum integer value in AppleScript (which is somewhere around 5,000,000), since it has to use integers to keep track of list elements.
Rick Roe
icons.cx | weblog
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:16 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2