Difference between revisions of "StrClear"
Jump to navigation
Jump to search
imported>Tibixe (new function) |
imported>Tibixe (oops, this should be StrClear) |
||
Line 1: | Line 1: | ||
'''Syntax:''' | '''Syntax:''' | ||
StrClear ''strToClear:stringID'' | |||
Deletes the '''contents''' of the string associated with the | Deletes the '''contents''' of the string associated with the strToClear, but does not delete the string itself. | ||
It is equivalent to ''StrSet | It is equivalent to ''StrSet strToClear ""'' | ||
StrClear should not be confused with StrDelete. For example, | |||
set str to StrNew "Hello" | set str to StrNew "Hello" | ||
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.