PDA

View Full Version : My "0" DOES exist! >=O


Yen
12-01-2006, 11:37 PM
I'm angry at gscript right now.

I want to append a '0' taken as a substring to the end of a string, but gscript just won't let me. It seems to be converting the 0 to nothing, and adding nothing to the end of a string isn't really considered adding.

Basically..
temp.a = "0123456789";
temp.b = "abc";
temp.b @= temp.a.substring(0,1);
temp.b @= temp.a.substring(1,1);
temp.b @= temp.a.substring(2,1);
echo(temp.b);

The echo is 'abc12'
The 0 is converted to a NULL.

Can we get some functionality to read "0" as 0, instead of nothing? Or maybe a workaround?

Tolnaftate2004
12-01-2006, 11:47 PM
temp.a = "abc123";
temp.a @= 0;
temp.a @= 1;
echo(temp.a);

Yen
12-01-2006, 11:49 PM
Yeah, I noticed that I gave a bad example code and editted it to better reflect the problem.

Tolnaftate2004
12-02-2006, 12:09 AM
Yeah, I noticed that I gave a bad example code and editted it to better reflect the problem.
try
temp.b @= (temp.a.substring(0,1) == "-1"? -1: (float(temp.a.substring(0,1) == -1? temp.a.substring(0,1):float(temp.a.substring(0,1)) ));

Admins
12-07-2006, 01:08 PM
It's fine in my version(s), server-side and client-side. The 0 is correctly seen as string and appended as string. So it should probably work with the next npcserver-update and Graal client version.

coreys
12-07-2006, 03:41 PM
And when is that going to happen? D=
Me wants new npc server

Gambet
12-07-2006, 10:00 PM
And when is that going to happen? D=
Me wants new npc server


When he feels he's fixed enough bugs worth an actual update?