Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   More Missing Values (https://forums.graalonline.com/forums/showthread.php?t=69751)

Novo 10-30-2006 12:35 AM

More Missing Values
 
PHP Code:

function onCreated()
  {
  
temp.var = new TStaticVar();
  
temp.var."0";
  
temp.var.savevars"levels/...");
  
  
temp.newvar loadvars"levels/..." );
  echo( 
temp.newvar.getvarnames() );
  } 

PHP Code:

initialized,joinedclasses,name,scriptlogmissingfunctions,timeout 

Where did my Variable 't' go?!

It seems as though the string "0" becomes the integar 0 in the process, and when loaded, it is set to false, removing the variable completely.

Couldn't we claim that considering that it was saved in the savevar that it has no choice but to be a string? ( due to the fact that if it was not a string, it wouldn't have been saved in the first place )

Skyld 10-30-2006 12:49 AM

Will temp.newvar.t not == 0 anyway, since it is an "uncreated" variable?

Novo 10-30-2006 02:21 AM

Quote:

Originally Posted by Skyld (Post 1237697)
Will temp.newvar.t not == 0 anyway, since it is an "uncreated" variable?

Yes, however, there is a difference when I want... Well, put it in context.

I want to make a system in which options are set.

PHP Code:

setting.hasStaffBoots=true 

However, if I want to remove it, I want to apply another file to an account...

PHP Code:

setting.hasStaffBoots=false 

The way to know on such ambiguous terms is through

PHP Code:

for ( itemp.var.setting.getdynamicvarnames() )
  
player.setting.(@ ) = temp.var.setting.(@ ); 

Because the variable is equal to false, it vanishes completely!
By cause, however, when I do the getdynamicvarnames(), it doesn't interpret the hasStaffBoots=false, and therefore, it doesn't set it to player.setting.(@ i )... Thereby, the old value remains true: the player.setting.(@ i ) doesn't get changed because the hasStaffBoots isn't part of the variable anymore.

Ultimately, there IS a difference, even though the shorthand of setting.hasStaffBoots is still equal to 0.

Novo 10-30-2006 02:26 AM

Err... I made an error in my debugging... It's further on in the script that it gets removed... :: continues research ::

Alright -- The error occurs in savevarstoarray( 0 ) – It doesn't save empty vars.

Setting

var.hasStaffBoots=false instead of var.hasStaffBoots=0 has changed the results to the expected ones.


All times are GMT +2. The time now is 10:21 AM.

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