Jump to content
Sign in to follow this  
spirit6

String and/or clipboard lenght limitations

Recommended Posts

Hey people,

As i took of with my self made mission generator i was looking for a way to "safe" the generator results.

It looked kinda nice to start filling a string that could then be [] spawn {string}; to execute all generator code back.

As i make use of the copytoclipboard functionality i ran into a limit of lenght considering either strings or the clipboard as i saw that my added generator code was abrubly broken and nothing more could be added when i saw the result coming out of my clipboard by simple paste into notepad.

As http://community.bistudio.com/wiki/String#Limitations suggests that strings seem to have unlimited lenght i came to the conclusion that they do not and that it does not seem to be the clipboard functionality that seems to be the bugger. So my question is anybody actualy knows if they are "unlimited" or there is some other variable or trick to get longer and more characters into the clipboard?

Anybody has indepth knowledge of stuff like that and might know a way to work around?

Cheers,

Spirit

Edited by spirit6

Share this post


Link to post
Share on other sites

How many characters did it treat?

I am a trial. copytoclipboard "a of 100,000 characters" was carried out. It succeeded.

Share this post


Link to post
Share on other sites
How many characters did it treat?

I am a trial. copytoclipboard "a of 100,000 characters" was carried out. It succeeded.

Did you successfully have a string with 100.000 characters in it and did copytoclipboard STRING? Mmm i go see what my "maximum" achieved score is tonight.

Share this post


Link to post
Share on other sites

Yes, it is successful. I tested this.

clipboardtest.utes.zip

The copyToClipboard command is used by init.sqf.

The number of characters included in a clipboard is 109,466 correctly.

Share this post


Link to post
Share on other sites

format is limiting the length of a string.

Share this post


Link to post
Share on other sites

I reconfirmed it with format command.

It seems that surely it is restricted to 2047 characters by the format command. Probably, it will be good to divide, in order to treat a longer character.

_str1 = "max2047characters";

_str2 = "max2047characters";

copyToClipboard ( format[ "%1", _str1 ] + format[ "%1", _str2 ] );

Share this post


Link to post
Share on other sites
format is limiting the length of a string.

Cheers its indeed what i do. Basicly what i do is this:

		mcc_safe = FORMAT ["%1
					  mcc_spawntype='%2';
					  mcc_classtype='%3';
					  mcc_isnewzone=%4;
					  mcc_spawnwithcrew=%5;
					  mcc_spawnname='%6';
					  mcc_spawnfaction='%7';
					  mcc_zone_number=%8;
					  mcc_zoneinform='%9';
					  mcc_zone_markername='%10';
					  mcc_spawn_behavior='%11';
					  mcc_grouptype     ='%12';
					  script_handler = [0] execVM 'mcc\general_scripts\mcc_SpawnStuff.sqf';
					   waitUntil {scriptDone script_handler};
					  "
					  ,mcc_safe
					  ,mcc_spawntype
					  , mcc_classtype
					  , mcc_isnewzone
					  , mcc_spawnwithcrew
					  , mcc_spawnname
					  , mcc_spawnfaction
					  , mcc_zone_number
					  , mcc_zoneinform
					  , mcc_zone_markername
					  , mcc_spawnbehavior
					  , mcc_grouptype 
					  ];

So format might indeed be the bugger. I go check into it mate.

---------- Post added at 02:10 PM ---------- Previous post was at 02:09 PM ----------

I reconfirmed it with format command.

It seems that surely it is restricted to 2047 characters by the format command. Probably, it will be good to divide, in order to treat a longer character.

_str1 = "max2047characters";

_str2 = "max2047characters";

copyToClipboard ( format[ "%1", _str1 ] + format[ "%1", _str2 ] );

Cheers for your find and solution! Thanks guys, i have had lots of time in this generator just to goof up on this area:0 What would i be without the community :P

---------- Post added at 02:12 PM ---------- Previous post was at 02:10 PM ----------

Yes, it is successful. I tested this.

clipboardtest.utes.zip

The copyToClipboard command is used by init.sqf.

The number of characters included in a clipboard is 109,466 correctly.

Cheers for your test and putting time into it!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×