Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


property remains null after it gets assigned a value.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Fri May 22, 2009 5:29 am    Post subject: property remains null after it gets assigned a value. Reply with quote

Ok so I'm really confused. Why is this happening to me? The picture kind of explains the issue. If not then I send a string as a argument into a method and assigns the flashvars parameter of the flash control. Then it reaches the breakpoint and still flashvars is empty. why, WHY?!


wai.jpg
 Description:
WHY THE FUCK?!!
 Filesize:  77.08 KB
 Viewed:  9108 Time(s)

wai.jpg



_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
92Garfield
I'm a spammer
Reputation: 57

Joined: 20 Dec 2007
Posts: 5871
Location: Banana Republic Germany

PostPosted: Fri May 22, 2009 8:10 am    Post subject: Reply with quote

this is c#?

maybe you shouldnt name them the same as the propereity

_________________
Back to top
View user's profile Send private message
Odecey
Master Cheater
Reputation: 1

Joined: 19 Apr 2007
Posts: 259
Location: Scandinavia

PostPosted: Fri May 22, 2009 11:52 am    Post subject: Re: property remains null after it gets assigned a value. Reply with quote

Beloved Hero wrote:
Ok so I'm really confused. Why is this happening to me? The picture kind of explains the issue. If not then I send a string as a argument into a method and assigns the flashvars parameter of the flash control. Then it reaches the breakpoint and still flashvars is empty. why, WHY?!

This isnt really enough information to conclude what the problem is. Are you sure that the variable that is used as FlashVars parameter in the call is not empty? I'd also like to add a small suggestion to use the naming convention to use a small letter for the first word, followed by a capital sized letter in each subsequent word in the variable name.

_________________
Never confuse activity with productivity. You can be busy without a purpose, but what's the point?- Rick Warren
Back to top
View user's profile Send private message MSN Messenger
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Sun May 24, 2009 12:22 pm    Post subject: Reply with quote

Ok.

To the previous poster. Did you take a look at the picture above? It tells you the value of the string.

So the string I send to the flash control is not null.

Plus it doesn't matter if I name the variable the same as the property..

Will someone that know's the thing come please?

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
hehewaffles
How do I cheat?
Reputation: 0

Joined: 23 Apr 2009
Posts: 5

PostPosted: Thu May 28, 2009 6:03 pm    Post subject: Reply with quote

If this is Visual Studio, you could try Cleaning the project and then rebuilding and running it. That very rarely solves it, but it's helped me once before.

The reason it would work is because Visual Studio kept old stuff that you changed, but didn't realize you really changed it, and it kept the old debug files, and linked those into the exe. Cleaning clears out the old folder, and then rebuilding it would completely remake it.


Another possibility is that you're passing an invalid value, and the property setter doesn't like that?

Remember that a property works like this, most of the time:

Code:

private string _field;
public string Property
{
    get{ return _field; }
    set{ _field = value; }
}


but can also sometimes work like this:

Code:

private string _field;
public string Property
{
    get{ return _field.Substring(0,1); }
    set
    {
        if (value == "something stupid")
            return;
        _field = value.Substring(0,1);
    }
}


When you compile it, it basically ends up like this:

Code:

private string _field;
private string get_field()
{
    return _field.Substring(0,1);
}

public void set_field(string value)
{
    if (value == "something stupid")
        return;
    _field = value.Substring(0,1);
}
Back to top
View user's profile Send private message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Fri May 29, 2009 3:47 am    Post subject: Reply with quote

I'm sorry that im such a noob but it is suppoed to be null :/ the property works like a method. It parses the string and add the vars.
_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Scathe
I post too much
Reputation: 0

Joined: 02 Aug 2006
Posts: 3631
Location: Smoking a blunt

PostPosted: Fri May 29, 2009 8:33 am    Post subject: Reply with quote

You're setting flashvars equal to itself.

You need to use different names, even if its flashvars_1 or something.

Code:
AxShockwaveFlash.FlashVars

Here you're accessing member "FlashVars" from class AxShockwaveFlash.

Code:
.FlashVars=FlashVars


Seeing as you didnt post any other code its impossible to tell whether the member FlashVars is public or not, but if it is then you are just setting it = to itself.

If FlashVars is NULL and you set it equal to itself, it will remain NULL.

Try changing your variable names.

_________________

<Moose> they will call me beard penis
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
hehewaffles
How do I cheat?
Reputation: 0

Joined: 23 Apr 2009
Posts: 5

PostPosted: Fri May 29, 2009 9:52 am    Post subject: Reply with quote

Scathe wrote:
You're setting flashvars equal to itself.

You need to use different names, even if its flashvars_1 or something.

Code:
AxShockwaveFlash.FlashVars

Here you're accessing member "FlashVars" from class AxShockwaveFlash.

Code:
.FlashVars=FlashVars


Seeing as you didnt post any other code its impossible to tell whether the member FlashVars is public or not, but if it is then you are just setting it = to itself.

If FlashVars is NULL and you set it equal to itself, it will remain NULL.

Try changing your variable names.


Nope.

The "FlashVars" when used without a class is implied to be currently in scope; either having been declared in the current method, or declared in the current class (which would be the same as this.FlashVars).

By saying AxShockwaveFlash.FlashVars, he's specifying the "FlashVars" within the "AxShockwaveFlash" object, rather than the one currently in scope.

Also, just so you know, a variable declared in scope has higher precedence than one declared in the current class:

Code:

class Test
{
    public string Hello
    {
        { get { return "Hi!"; } } //only an accessor; if one were to try to set
         //this property, there would be a compile error
    }

    public void SetHelloText(ref string Hello)
    {
        Hello = "Hi!";
    }
}


That would compile, and work like this:

Say we have an external class:

Code:

class Tester
{
    private Test _test;
    public void Foo()
    {
        string Bar;
       
        _test = new Test();
        _test.SetHelloText(ref Bar);
    }
}


Bar gets the text "Hi!"
We could have just as easily made Bar get something completely different, though, like "C# is cool" or "High school sucks," etc.

Edit:

Also, just FYI, he already found the answer, haha.
Back to top
View user's profile Send private message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Fri May 29, 2009 10:01 am    Post subject: Reply with quote

hehewaffles is correct at both points.
_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Scathe
I post too much
Reputation: 0

Joined: 02 Aug 2006
Posts: 3631
Location: Smoking a blunt

PostPosted: Fri May 29, 2009 11:35 am    Post subject: Reply with quote

Well..i tried. Rolling Eyes
_________________

<Moose> they will call me beard penis
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Fri May 29, 2009 1:14 pm    Post subject: Reply with quote

Check the return value. That's what you do ALWAYS, ppl tend to forget error checking nowdays.

Probably incompatible types or something and hence it's return value marks false -> RTFM(?) or should I say docs for property and your Flash class.

EDIT: Eh, reading earlier posts (hehewaffles), I notice my point is already mentioned :(
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites