Code: Select all
"case3 " a + b "`n" ; 24 ?? could be. but, I guess, it is wrong. Should be "123"
Certainly not,
+ is not used to concatenate strings. Again,
This problem can be avoided by assigning the value to a variable
and
General Conventions wrote:No typed variables: Variables have no explicitly defined type; instead, a value of any type can be stored in any variable (excluding built-in variables). Numbers may be automatically converted to strings (text) and vice versa, depending on the situation.
For case 6, the reason only the
good part is left is because, since the
- is preceded by a quoted string, it cannot be binary minus (i.e., substraction), so it must be unary minus, hence the following quoted string yields an error,
Expression wrote:Except where noted below, any blank value (empty string) or non-numeric value involved in a math operation is not assumed to be zero. Instead, it is treated as an error, which causes that part of the expression to evaluate to an empty string
For case 5, now it is unary plus since the preceding operand is a quoted string, but
Unary minus wrote:On a related note, any unary plus signs (+) within an expression are ignored.
so there is no error since it the unary plus is ignored. Hence the concatenation.
Cheers.