Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   My "0" DOES exist! >=O (https://forums.graalonline.com/forums/showthread.php?t=70530)

Yen 12-01-2006 11:37 PM

My "0" DOES exist! >=O
 
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..
PHP Code:

temp."0123456789";
temp."abc";
temp.@= temp.a.substring(0,1);
temp.@= temp.a.substring(1,1);
temp.@= 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

PHP Code:

temp."abc123";
temp.@= 0;
temp.@= 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

Quote:

Originally Posted by Yen (Post 1249161)
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

Quote:

Originally Posted by coreys (Post 1251140)
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?


All times are GMT +2. The time now is 04:13 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.