Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-04-2007, 09:58 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Unexpected object links

It seems if you create a new TStaticVar with the name of an existing object, that it becomes a reference to that object from the global scope as opposed to creating a new object in the current scope of that object name. Is this supposed to happen?

NPC "DB_Skyld":
PHP Code:
function onCreated()
{
  
this.flag "Something";

  
temp.obj = new TStaticVar("DB_Skyld");
  echo(
temp.obj.flag);

Produces "Something".
__________________
Skyld
Reply With Quote
  #2  
Old 06-06-2007, 06:49 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
That is supposed to be like that. Giving it a name will make it a global variable, and you cannot just create another object with the same name, it will try to replace the existing object if possible though (if it's just "TGraalVar").
This is partially like that to make it possible to use 'new GuiControl("name")' and such without needing to check if the control is already existing
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:49 AM.


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