Announcement

Collapse
No announcement yet.

String max length

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    String max length

    Can't find this answer after numerous searches, dunno must be either blind or something.

    I'd like to know the max length of a string variable in script?

    I ask as I'm getting truncation at 1000 bytes of usable data (thinking there's 1024 limit) when my TCP client receives data from the windows IIS server ( its for my server browser query).

    Could of course be the Windows IIS server but am investigating this from both sides as I have no idea as yet how to investigate the IIS server

    #2
    Just run a quick test function like this (WARNING: untested and not compiled)
    Code:
    function MaxStringLength()
    {
    	local string teststring;
    	local int expectedlength;
    
    	teststring = "";
    	expectedlength = 0;
    
    	for (expectedlength = 0; expectedlength < 4096; ++expectedlength)
    	{
    		if (len(teststring != expectedlength)
    		{
    			`log("Test failed: '" $teststring $"' length" @len(teststring) @"versus" @expectedlength);
    		}
    
    		teststring = teststring $ "a";
    	}
    }

    Comment


      #3
      Thanks good idea, yeah it went up to 4k never tried to see where it would break. You'd think it would be easy to find the length of a string and one wouldn't need to revert to writing code ...

      Anyway, its helped cause it shows me that my issue must be outside of UDK. Cheers.

      Comment

      Working...
      X