Difference between revisions of "StrClear"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Tibixe
(new function)
 
imported>Tibixe
(oops, this should be StrClear)
Line 1: Line 1:
'''Syntax:'''
'''Syntax:'''
  StrClean ''strToClean:stringID''
  StrClear ''strToClear:stringID''


Deletes the '''contents''' of the string associated with the strToClean, but does not delete the string itself.
Deletes the '''contents''' of the string associated with the strToClear, but does not delete the string itself.
It is equivalent to ''StrSet strToClean ""''
It is equivalent to ''StrSet strToClear ""''




StrClean should not be confused with StrDelete. For example,
StrClear should not be confused with StrDelete. For example,
  set str to StrNew "Hello"
  set str to StrNew "Hello"
  StrClean str
  StrClear str
  StrSet str "Hello"
  StrSet str "Hello"
  StrPrint str
  StrPrint str

Revision as of 06:30, 22 December 2007

Syntax:

StrClear strToClear:stringID

Deletes the contents of the string associated with the strToClear, but does not delete the string itself. It is equivalent to StrSet strToClear ""


StrClear should not be confused with StrDelete. For example,

set str to StrNew "Hello"
StrClear str
StrSet str "Hello"
StrPrint str

This is valid code; It will print "Hello" to the console, as expected.


set str to StrNew "Hello"
StrDelete str
StrSet str "Hello"
StrPrint str

This is not valid code; While this will also seem to work at a basic level, it could break higher level commands.