Upgrading to new-style Strings: Difference between revisions

Jump to navigation Jump to search
Link to online manual
*>Monkey 05 06
(→‎StrComp -> String.CompareTo: Bad logic is bad man.)
(Link to online manual)
Line 11: Line 11:


* New-style Strings have a '''capital''' 'S'! Old-style strings use a lower-case 's'.
* New-style Strings have a '''capital''' 'S'! Old-style strings use a lower-case 's'.
* New-style Strings are [[Pointers in AGS|pointer]] based. The pointer is internally managed, however new-style Strings can still hold the value '''null'''. Remember that operating on null pointers will crash your game!
* New-style Strings are [https://www.adventuregamestudio.co.uk/manual/index.html?page=ags31.htm pointer] based. The pointer is internally managed, however new-style Strings can still hold the value '''null'''. Remember that operating on null pointers will crash your game!
* As long as it is non-global (i.e., it is within a function) new-style Strings can have a default value assigned at the same time as you declare the String. Note that if you don't define a default value (or if the String is global (outside of all functions)) then it will hold the value '''null'''.
* As long as it is non-global (i.e., it is within a function) new-style Strings can have a default value assigned at the same time as you declare the String. Note that if you don't define a default value (or if the String is global (outside of all functions)) then it will hold the value '''null'''.


Navigation menu