Hi,
I'm trying to figure out what is wrong with my function... I'm having trouble using boolean variables. I find this function works fine (returns a constant):
- bool PlayerGameAlreadyExists(string PlayerName, date GameStart)
- {
- Exists = true;
- return true; // this line works fine, returning a constant
- // return Exists; // this line doesn't work, attempting to return a variable
- }
but if I try to return a boolean
variable instead (see the commented out line above), I get an error message:
- Encountered ";" at line 4, column 18.
- Was expecting:
- "(" ...
I wondered if there's anything wrong with the way I'm defining / returning the variable?
Many thanks,
Katie