LoginLogin
Might make SBS readonly: thread

Multiplying an empty string never throws an error

Root / SmileBASIC Bug Reports / [.]

12Me21Created:
All of these work:
PRINT "" * 2
PRINT "" * "A"
DIM ARRAY[0]
PRINT "" * ARRAY
PRINT "" * -1
DEF NOTHING():END
PRINT "" * NOTHING()
IF FALSE THEN DIM UNTYPED[0]
PRINT "" * UNTYPED

what is it with the IF FALSE THEN DIM UNTYPED[0]? why not just declare UNTYPED?

what is it with the IF FALSE THEN DIM UNTYPED[0]? why not just declare UNTYPED?
That's how you make an untyped variable.
IF FALSE THEN DIM TEST1[0],TEST2[0]
TEST1 = 7
TEST2 = "STRING"

HOLY COW! is it possible to make it into a function:
DEF Untyped()
 IF FALSE THEN DIM UNTYPED[0]
 RETURN UNTYPED
END

HOLY COW! is it possible to make it into a function:
DEF Untyped()
 IF FALSE THEN DIM UNTYPED[0]
 RETURN UNTYPED
END
No, it has to be when you create the variable. (And you can't return an untyped variable from a function anyway, that just throws an error)
VAR X=UNTYPED() 'won't work because X is already a number variable

well,