Re: Application["TotalPlayings"]++ doesn't work
- From: "Hans Kesting" <news.2.hansdk@xxxxxxxxxxxxxxx>
- Date: Fri, 25 Nov 2005 15:58:03 +0100
Compiler Error Message: CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
And: (int)Application["TotalPlayings"]++; Makes no sense.
Application["TotalPlayings"] returns an object,
(int)Application["TotalPlayings"] unboxes that object and returns
an int as a *copy* of that value,
When you use the "++" operator, you will use that on that copy,
not on the original. So the original Application["TotalPlayings"] is not updated.
Plus you might have a precedence problem: what would be evaluated first: the (int) or the ++?
Hans Kesting
.
- References:
- Application["TotalPlayings"]++ doesn't work
- From: farmer
- Application["TotalPlayings"]++ doesn't work
- Prev by Date: How to receive keyboard input?
- Next by Date: Re: How to receive keyboard input?
- Previous by thread: Re: Application["TotalPlayings"]++ doesn't work
- Next by thread: How to add a small HTML table under a row of a GridView
- Index(es):
Relevant Pages
|