almost done.....
Ben Damon
Posts: 42
Hi all, I've almost completed a simple calculator.· It's only flaw is it jumps to the beginning every time the second number is put in.· Also when the function is entered (-,+,x or /) it starts the next line with out the enter key·being pushed. thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ben Damon
And may God Bless America!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ben Damon
And may God Bless America!
bs2
933B
Comments
You are mixing GOTO syntax and GOSUB syntax. Change you GOTO function_name to GOSUB function_name and that will solve you're jumping to the beginning problem.
I'd suggest, as a refreshed, to reread the help text on both the GOTO and GOSUB/RETURN command.
Jim
Oh yeah, the DEBUGIN, try using the 'STR' modifier for your function. Then in you IF test for '-', '+', etc. It will make the code a lot easier to read.
You probably will want to add an additional ELSE to the IF so that an invalid function is trapped. As it stands right now, and invalid function will fall through the IF and display zero (the initialized value of the variable total) the first time through, if you add the "again" loop, an invalid function will cause the result of the previous calculation to be displayed. In any case, not what you intended.
Post Edited (Jim McCorison) : 2/28/2005 10:32:01 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ben Damon
And may God Bless America!
·
Ben,
One thing I've learned to do is to read, and reread, the manual for whatever language I'm learning. And by read, I don't mean look up the syntax of a specific command, I mean start at page 1 and work all the way through. You won't absorb all of it by any means. But you'll learn some of it, some it will stick in the back of your mind, and some will just leak out and fall on the floor.
Then after you've been using the language for a few weeks, read through again. Guaranteed you'll be reading along and find at least one "Ah ha! So that's how you do that." By doing this you'll have at a minimum a passing acquaintance with all the commands. Then later, when you're trying to get something done, you'll remember about a command and be able to go look it up.
Jim
You're right though...many of the questions asked on the forum could easily be sorted out by reading the WAM book or any of the others!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
you'll be there forever!! But you'll know a hell of a lot
everything you need is there(at least a great start)
http://www.parallax.com/html_pages/downloads/index.asp
sometimes people get pissed when you tell them to go read something but your really doing them a favor.
they asked 1 question probably had ten that could get answered by reading something.
my 2 cents
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ
Jim
Bens was legit. unless you get to play and see the difference between using one over the other or mixing them the correct way that wont mess you up.
Someone has been down that road before and can provide great insight into why certain things were happening a certain way in the code.
Also though there is alot of great info posted in the forum that you can search for.
I was refering more or less to some of the questions like how do I hook up a basic button or why doesnt my USB adapter work.
I was also pushing people to take a look at all of the good resouses parallax has on there site.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ
Guess I should have clarified. I didn't think your comments were about Ben's question. I was just afraid that Ben might have thought so as the written form of our language is so hard to communicate in. Heck, the verbal form isn't much better. So I figured I'd say it up front.
The posts that get me the most are the "I just bought a Widgets Electronics QX23-19. How do I connect it up to something?". Oh well.
Jim
anyways back on the main note
did ya get it working correctly yet Ben?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ben Damon
And may God Bless America!
·