Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Access Violation: Crashes Graal. (https://forums.graalonline.com/forums/showthread.php?t=66832)

JustBreathe 06-22-2006 02:41 PM

Access Violation: Crashes Graal.
 
PHP Code:

function onCreated()
  {
  
this.loadvarsfromarray( string );
  for ( 
temp.varsthis.vars )
    echo( 
temp.vars );
  } 

Accessing an array that was built by loadvars, when loadvars was used in the syntax this.loadvars, causes Graal to crash with Access Violation.

Side Note:
Sorry for all the errors. I just got access to Forums, and I was saving them up. I'll be adding them as I think of the problems I've encountered in the past.

ApothiX 06-22-2006 07:37 PM

Quote:

Originally Posted by JustBreathe
PHP Code:

function onCreated()
  {
  
this.loadvarsfromarray( string );
  for ( 
temp.varsthis.vars )
    echo( 
temp.vars );
  } 

Accessing an array that was built by loadvars, when loadvars was used in the syntax this.loadvars, causes Graal to crash with Access Violation.

Side Note:
Sorry for all the errors. I just got access to Forums, and I was saving them up. I'll be adding them as I think of the problems I've encountered in the past.

You really shouldn't be directly loading this. variables like that anyway. Just for curiosity's sake, though. What is in the array? Are you attempting to modify read-only variables?

JustBreathe 06-22-2006 08:06 PM

this.vars was set to something like this.vars = {{"stuff","otherStuff"},{"stuff"}};
It isn't in trying to modify it that the problem arrises. It's just trying to read it.

ApothiX 06-22-2006 09:32 PM

Quote:

Originally Posted by JustBreathe
this.vars was set to something like this.vars = {{"stuff","otherStuff"},{"stuff"}};
It isn't in trying to modify it that the problem arrises. It's just trying to read it.

Ah, that's not how you're supposed to do it anyway.

this.vars = { "varname=foo", "varname2=bar" };
this.obj.loadvarsfromarray(this.vars);

this.obj.varname now has the value of 'foo' and this.obj.varname2 now has the value of 'bar'

JustBreathe 06-22-2006 09:42 PM

Quote:

Originally Posted by ApothiX
Ah, that's not how you're supposed to do it anyway.

this.vars = { "varname=foo", "varname2=bar" };
this.obj.loadvarsfromarray(this.vars);

this.obj.varname now has the value of 'foo' and this.obj.varname2 now has the value of 'bar'

If you read my example, I am reading from 'strings', not this.vars. I thought you were inquireing about the contents of this.vars. The string was saved using savevarstoarray( false ) , and therefore, syntax error shouldn't be a problem.

ApothiX 06-23-2006 12:37 AM

Quote:

Originally Posted by JustBreathe
If you read my example, I am reading from 'strings', not this.vars. I thought you were inquireing about the contents of this.vars. The string was saved using savevarstoarray( false ) , and therefore, syntax error shouldn't be a problem.

wait a sec.. You are still using that wrong then. this.loadvarsfromarray() will load all of the variables into the 'this.' object, not a 'this.vars' object. You should be doing this.vars.loadvarsfromarray();


All times are GMT +2. The time now is 05:46 PM.

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