18,700
edits
(→Arithmetical: copy edit) |
m (→string: copy edit) |
||
Line 518: | Line 518: | ||
Trying to give a string a non-textual value (bool/int/float) gives the error "illegal type convertion" (sic). Trying to add two strings together simply crashes the game, rather than concatenating them as it would in some other languages. Adding a float to a string crashes too. Bools have no effect whatsoever. | Trying to give a string a non-textual value (bool/int/float) gives the error "illegal type convertion" (sic). Trying to add two strings together simply crashes the game, rather than concatenating them as it would in some other languages. Adding a float to a string crashes too. Bools have no effect whatsoever. | ||
Trying to add an int value to a string creates some cool and unexpected results. For instance, adding a number between 5 and 11 removes the first character from the string. A number greater than or equal to 12 removes the first two, and so on. Subtraction does not yield the reverse effect, even if you try it with the maximum int value (in which case, Oni crashes). Subtracting | Trying to add an int value to a string creates some cool and unexpected results. For instance, adding a number between 5 and 11 removes the first character from the string. A number greater than or equal to 12 removes the first two, and so on. Subtraction does not yield the reverse effect, even if you try it with the maximum int value (in which case, Oni crashes). Subtracting numbers can, however, result in printing random strings from Oni's memory, such as BSL function names! | ||
"(null)" is the value that strings assume when they have not been given a value yet; it cannot be assigned to a string manually. | "(null)" is the value that strings assume when they have not been given a value yet; it cannot be assigned to a string manually. |