Click here to Skip to main content
15,796,132 members

Comments by FreedMalloc (Top 29 by date)

FreedMalloc 13-Jul-23 14:29pm View    
Yes. But also that the field you are using is the one for the current instance of the class.
Graeme_Grant has listed a very good link in Solution 2. I think it explains things far better than I can and also gives other usages for 'this' in C#.
FreedMalloc 19-Apr-23 11:44am View    
Is the item in your inventory named "health" or "health potion"? Those 2 strings are not equal. Perhaps you instead need to change your comparison from equals to contains "health".
FreedMalloc 10-Mar-23 23:56pm View    
First off, all you've done is dumped a bunch of code pasted as text instead of using the code block tool so the formatting/indenting is very hard to follow.
Secondly, you don't show any errors. I'm supposed to take your poorly formatted code and try to compile it myself? I don't think you'll get much help with that.

I would suggest you compile the code. Then take each error one at a time and try to figure it out. The compiler should tell what line and column it doesn't like. I'll bet you can clear quite a few on your own. Then if there are still some you don't understand use the green Improve Question link to show 2 or 3 of those errors along with the relevant code. I think people here will be much more willing to help if you do that.
FreedMalloc 10-Mar-23 18:17pm View    
Above you stated: where 0 means "true" and any non-zero value means "false". Don't you have that backwards? 0 == false, non-zero == true.
FreedMalloc 30-Jan-23 16:26pm View    
Which I did by using his CP contact email in my reply to you.