Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Removing a variable from DB (https://forums.graalonline.com/forums/showthread.php?t=80442)

Knight 07-11-2008 09:25 AM

Removing a variable from DB
 
When you have a database that holds a bunch of different variables (dynamics in my case) and you take one of the variable values and you set it to NULL, it takes the value of the var and sets it to NULL, but the variable itself still remains. The same is true if you use
DBName.variablename.clear();
and
DBName.variablename = "";

Does anyone know of a surefire way to remove a variable from a database NPC? There are ways such as using = ""; to make it appear as though the variable has been deleted (because variables with this value are not displayed in the NPCdump for that DB) when infact they still remain.

Thanks for the help!

- Knight

Crow 07-11-2008 11:25 AM

I'm pretty sure they are non-existant when being set to nil, since the ones set to nil, NULL, 0 or false won't be shown anymore after an NPC Server restart.

Dan 07-11-2008 12:38 PM

PHP Code:

function onCreated() {
  
this.myvar "";
  
this.myvar.clear();
  echo(
this.getdynamicvarnames());


Output: myvar,onCreated

I have shown Stefan and I believe all he said was ' insert nothing here '.

Admins 07-11-2008 04:12 PM

Well you can do clearemptyvars() but normally it should remove it anyway when you do var = "" or similar, will need to check it.

zokemon 07-12-2008 06:54 PM

Quote:

Originally Posted by Dan (Post 1402189)
PHP Code:

function onCreated() {
  
this.myvar "";
  
this.myvar.clear();
  echo(
this.getdynamicvarnames());


Output: myvar,onCreated

I have shown Stefan and I believe all he said was ' insert nothing here '.

As in '' like null character?


All times are GMT +2. The time now is 09:56 PM.

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