Forum

> > CS2D > Scripts > Script error (concatenating texts)
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script error (concatenating texts)

3 replies
To the start Previous 1 Next To the start

old Script error (concatenating texts)

I3I3
BANNED Off Offline

Quote
Can you please find the error in this script line ?

1
point[arg1]+""..txt:sub(7,100)..""

My script work when i remove it and won't work when i add it
so i though the error is this line
please how can i fix it

old Re: Script error (concatenating texts)

DC
Admin On Online

Quote
Also it's very important to note that whenever you see something like
X..""..Y
or
X..''..Y
(with X and Y being ANYTHING) it's a POINTLESS operation written by someone who didn't know what he's doing.

You are concatenating an EMPTY STRING. This changes NOTHING.
so
X..""..Y
is equal to
X..Y

and
X..''..Y
is equal to
X..Y
as well.

In math the equivalent operations to
X..""
would be
X+0
,
X-0
,
X*1
or
X/1
. It's neutral. It doesn't change anything. It only wastes performance. So why do you do it? Don't do it.
edited 1×, last 19.06.17 07:20:20 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview