Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Lua
➜ New feature in version 4.55 - extended CallPlugin syntax
New feature in version 4.55 - extended CallPlugin syntax
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
3
Posted by
| Bast
(78 posts) Bio
|
Date
| Reply #30 on Wed 28 Jul 2010 02:22 PM (UTC) |
Message
| Hey all,
What is the max length for a string. I ask because if I serialize a table, what is the max size I can send through callplugin?
Bast |
Bast
Scripts: http://github.com/endavis | Top |
|
Posted by
| Worstje
Netherlands (899 posts) Bio
|
Date
| Reply #31 on Wed 28 Jul 2010 02:46 PM (UTC) Amended on Wed 28 Jul 2010 02:48 PM (UTC) by Worstje
|
Message
| I don't think believe there is any practical limit. Lua supports strings as long as memory allows, so at most it would imo depend on the WSH kit and the other languages. And I _think_ that the string type used in COM has a 32 bit length field, so that would imply 2^32-1 length is the maximum.
Or in other words - what the hell are you doing? In my experience when you ask what the maximum is for something, you are going about things the wrong way, and need to explain what brought you to ask the question so people can help you find a better solution.
Edit: Ooh, my guess was right on the spot according to http://www.codeguru.com/forum/archive/index.php/t-242083.html | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #32 on Wed 28 Jul 2010 10:58 PM (UTC) |
Message
|
Bast said:
What is the max length for a string. I ask because if I serialize a table, what is the max size I can send through callplugin?
CallPlugin, in its new incarnation of Lua-to-Lua, won't use the WSH at all, so the real issue is "what is the maximum Lua string length?".
I suspect, but can't find a definite answer right now, that 2^31 bits is indeed likely to be it. I hope you weren't asking with the intention of using the maximum (which is around 2 Gb) because you are likely to fill up your memory.
Especially as to push the string from one script space to another, it would be making a copy of it. And then there would be the intermediate pieces that go up into the serialization process.
However if you are asking "can the string be more than 100 bytes?" the answer is "yes it can".
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #33 on Wed 28 Jul 2010 11:06 PM (UTC) |
Message
| A quick browse of the source seems to indicate that it could possibly go up to size_t bytes, which in our case is probably an unsigned 32-bit integer.
So basically, unless you are doing something, ah, crazy, it should be able to hold whatever you want to put into it. For really large amounts of data, it might be sensible to consider holding data in a SQLite3 database instead. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Bast
(78 posts) Bio
|
Date
| Reply #34 on Wed 28 Jul 2010 11:20 PM (UTC) |
Message
| No, I do not intend to send a 2GB of text to another plugin. I was just wondering because I came across a similar limitation in mousemenu.
In my miniwindows, I have a popup menu for the mouse that is autogenerated from plugin variables and commands and it hit a limit of some sort (which I did not measure) so I had to break the menu up into 2 menus.
Bast |
Bast
Scripts: http://github.com/endavis | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #35 on Wed 28 Jul 2010 11:56 PM (UTC) |
Message
| I'm not sure what that limit was, but I increased the number of menu items you can display from 30 to 100 in version 4.55.
The limit of 30 seemed sensible with flat menus, but with the nested menus a higher limit might be desirable. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
87,181 views.
This is page 3, subject is 3 pages long:
1
2
3
It is now over 60 days since the last post. This thread is closed.
Refresh page
top