Page 1 of 1

Syntax Issue

Posted: Wed Jul 30, 2014 8:35 pm
by dna
hello.

This may be a stuppid question but why does the syntax

PrintN("#: "+TR) shows on the screen, or console; #: N where N is a designated value or zero if uninitialized

but the syntax

PrintN(TR) gives a syntax error

Re: Syntax Issue

Posted: Wed Jul 30, 2014 8:55 pm
by STARGĂ…TE
PrintN("#: "+TR) is a short version of: PrintN("#: "+Str(TR))

PrintN() needs a string, so you have to use a string

Re: Syntax Issue

Posted: Thu Jul 31, 2014 12:03 am
by Tenaja
To expound on what Stargate said, once you start using a string, if you "add" a number to it, the Str() is implied...or the number type is converted to a string type, or any other variety of ways you can say "done for you".

If you are really worried about keystroke efficiency, you can even type this:
Print(""+TR)
instead of
Print(str(TR))
...saves you two whole keystrokes!