PDA

View Full Version : Access Violation: Crashes Graal.


JustBreathe
06-22-2006, 02:41 PM
function onCreated()
{
this.loadvarsfromarray( string );
for ( temp.vars: this.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
function onCreated()
{
this.loadvarsfromarray( string );
for ( temp.vars: this.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
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
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
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();