Click here to Skip to main content
15,888,521 members

Comments by FreedMalloc (Top 31 by date)

FreedMalloc 20-Feb-24 10:54am View    
The commented out line that you indicate gives the error, uses userGV, whereas the other lines are using itemGV. If you uncomment that line and then take OriginalGriff's advice and put a breakpoint there upon inspecting userGV.SelectedRows[0] you would probably see that it's null alerting you to look closer where you would see that userGV should really be itemGV. Unless, of course, userGV actually is the correct variable, in which case the debugger is still your best hope in finding what's going wrong.
FreedMalloc 20-Feb-24 10:53am View    
Deleted
The commented out line that you indicate gives the error, uses userGV, whereas the other lines are using itemGV. If you uncomment that line and then take OriginalGriff's advice and put a breakpoint there upon inspecting userGV.SelectedRows[0] you would probably see that it's null alerting you to look closer where you would see that userGV should really be itemGV. Unless, of course, userGV actually is the correct variable, in which case the debugger is still your best hope in finding what's going wrong.
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.