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-22-2006, 02:41 PM
JustBreathe JustBreathe is offline
Registered User
Join Date: Jun 2006
Posts: 59
JustBreathe is on a distinguished road
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.
Reply With Quote
  #2  
Old 06-22-2006, 07:37 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #3  
Old 06-22-2006, 08:06 PM
JustBreathe JustBreathe is offline
Registered User
Join Date: Jun 2006
Posts: 59
JustBreathe is on a distinguished road
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.
Reply With Quote
  #4  
Old 06-22-2006, 09:32 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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'
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #5  
Old 06-22-2006, 09:42 PM
JustBreathe JustBreathe is offline
Registered User
Join Date: Jun 2006
Posts: 59
JustBreathe is on a distinguished road
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.
Reply With Quote
  #6  
Old 06-23-2006, 12:37 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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();
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
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 07:28 AM.


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