| 05-21-2009, 10:22 PM | #1 |
aka strings ALLWAYS should be null and not "". and never do comparisions like this JASS:if str!="" then endif cause after map is saved and loaded (game save) this comparision will fail. and only null will succeed. i mean JASS:if str!=null then endif maybe it's obvious. but i bet someone have such checks ;P (including me well i had.) It may lead to malfunctions or even to game crash (if operationg with gamecache or ExecuteFunc or similar). and other "news" are what on bnet (now after the update) all maps with code returns will be unable to be hosted. JASS:function xxx takes nothing returns code return null endfunction // as example |
| 05-21-2009, 10:31 PM | #2 |
Well, doesn't everybody do both? JASS:if str!="" and str!=null then endif At least I do. Except for crashes when using gamecache or ExecuteFunc (etc.) there are no problems with that then, right? |
| 05-22-2009, 01:59 AM | #3 |
why use both when u can use null |
| 05-22-2009, 04:42 AM | #4 | |
Quote:
If this is true, maybe jasshelper should give a compile warning about it, at least in debug mode. |
| 05-22-2009, 05:49 AM | #5 |
Does null still work if you pass "" as a string argument? At one point I didn't think it would (and that "" and null are two different values). |
| 05-22-2009, 10:15 AM | #6 | ||||
Quote:
Quote:
Quote:
Quote:
|
| 05-22-2009, 02:30 PM | #7 | |
Quote:
Alternatively (StringLength(s) > 0) Actually I think this was known ever since the first Jass vault's times. Hence the reason I always compared with both "" and null. |
| 05-22-2009, 02:31 PM | #8 | |
Quote:
|
