? 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 ✎ 1619 12Me21 Head Admin Second Year My account is over 2 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself 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 ✎ 132 DFrost Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength what is it with the IF FALSE THEN DIM UNTYPED[0]? why not just declare UNTYPED? Posted
  • #3 ✎ 1619 12Me21 Head Admin Second Year My account is over 2 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself
    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 ✎ 132 DFrost Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength HOLY COW! is it possible to make it into a function: DEF Untyped() IF FALSE THEN DIM UNTYPED[0] RETURN UNTYPED END Posted
  • #5 ✎ 1619 12Me21 Head Admin Second Year My account is over 2 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself
    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 ✎ 132 DFrost Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength well, Posted