? Multiplying an empty string never throws an error (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
💀

Multiplying an empty string never throws an error

  • #1 ✎ 1560 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website 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 Posted
  • #2 ✎ 100 dfrost2 what is it with the IF FALSE THEN DIM UNTYPED[0]? why not just declare UNTYPED? Posted
  • #3 ✎ 1560 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website
    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"
    Posted
  • #4 ✎ 100 dfrost2 HOLY COW! is it possible to make it into a function: DEF Untyped() IF FALSE THEN DIM UNTYPED[0] RETURN UNTYPED END Posted
  • #5 ✎ 1560 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website
    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
    Posted Edited by 12Me21
  • #6 ✎ 100 dfrost2 well, Posted