|
-
Jan 31st, 2012, 01:55 PM
#4
Thread Starter
New Member
Re: adding totals?
 Originally Posted by jmcilhinney
I would imagine that this is a scope issue. If you are declaring 'weekTotal' inside a method then it only exists inside that method, so it's value defaults to zero each time. If you want it to maintain its value between method calls then it must exist outside the method, i.e. you must declare it outside the method.
erm do you mean a global variable? if so how do i go about setting it up? iv only started rogramming recently as part of my ict class, and had a few lessons so fr, so tryin to do a crash course!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|