Clear String

DiFm

New Member
Reaction score
35
LOl i just searched and could find anything which i find strange. How to clear a string variable? Its a global String variable i want nulled or cleared, and i guess i throw in the question in how the nulling of global unit variables looks?

Might be solved.. if the right answer is: set udg_TARGETSTRING = null
 

Tom Jones

N/A
Reaction score
437
When the GUI ask you to input a string, simply click yes. This will result in a null string.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
in jass it would be
JASS:
set udg_TARGETSTRING = ""
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Strings can be set to null and "". Why do you need this?

To set it to null, you would have to use the custom script you originally posted,
Trigger:
  • Custom Script: set udg_TARGETSTRING = null


If you needed simply "", you can just do as Tom Jones suggested and simply not put in a value. This is the same as setting it to "".

If you're using it for a function, I would recommend "", to avoid any kind of problems that could result from using null.
 

UndeadDragon

Super Moderator
Reaction score
448
Trigger:
  • Set string = ""


Should be fine for that use.
 

Viikuna

No Marlo no game.
Reaction score
265
null and "" are two different things. ( null is null and "" is an empty string )

Note that nulling it wont save any memory at all. String are like unfixxable leaks, because each different string takes some memory.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top