| 01-30-2004, 11:50 PM | #1 |
Does anyone know how many characters maximum you can have in a string in JASS? |
| 01-31-2004, 12:13 AM | #2 |
2048 is what i'm told. |
| 02-11-2004, 07:05 AM | #3 |
I know in GUI its like 255. Also depends on if its a game text string or a regular string. |
| 02-11-2004, 09:06 AM | #4 |
Strings are oh-so-fun. firstly, while Rod is right about GUI limiting them.... "strings" in it's true sense (a type/object) can hold 2048 symbols. BUT.... All non-asc-ii symbols (or whatever) like ÃÅ* or sumtin... takes "2" slots in the string. F.ex., if you have a string with only that symbol, and you SubstringBJ( 1, 1 ) it, it will indeed return nothing.... not unless you do SubstringBJ( 1, 2 ) will it return the symbol. There are also some more oddities about strings.... Cubasis |
| 02-11-2004, 02:32 PM | #5 |
Besides of what you all said, certain natives seem to have a 255 limit of lenght for the strings they take, I am mostly for the SetMapMusic one. |
| 02-11-2004, 08:36 PM | #6 |
@Lord Vexorian: Such long screens can't be displayed anyway (the map name, description, ...). |
| 02-12-2004, 10:17 PM | #7 |
War3 stores strings as multi-byte strings then. This means that most normal characters take 1 byte, while some (most importantly japanese, chinese, korean) take 2 bytes. Best practice would be to assume a maximum length of 1024 characters then. |
| 02-12-2004, 10:31 PM | #8 | |
Quote:
Wouldn't it be better to assume that any string could possibly be 2048 character, but only create strings with maximum 1024 characters. Otherwise long strings created by someone else could be chopped of. |
