[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  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] Refresh page


Pages: 1  2  3 

Posted by Bast   (78 posts)  [Biography] 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
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] 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
[Go to top] top

Posted by Bast   (78 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] 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
[Go to top] 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.


76,431 views.

This is page 3, subject is 3 pages long:  [Previous page]  1  2  3 

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]