05-31-2003, 11:57 PM
Got a little problem that is beyond my (very) remedial
QBasic skills that I would like some help with...
I have written a small grade averaging program that
works great for my wife's needs. There is one
refinement though that I just can't seem to figure
out. I know it can't be that difficult, but with my serious
lack of programming skills, I haven't been able to
solve this.
As the program is currently written, once I enter
however many grades that I want to average, I enter a
"-1" to get the program to then GOTO the averaging
subroutine.
Now the above works just fine, but I would prefer for
the program to do the average when I merely hit the
"enter" key without entering any grade.
I know that I can't just write something similar to this:
IF (grade = "") THEN GOTO AverageGrades
since this will cause a type mismatch error because
the program is looking for an integer to be entered
here for the grade variable. So while I sort of
understand WHY I can't do something similar to the
above, I can't figure out how to do what I want to do.
I know that I have come across a way to cause a
program to respond to a simple enter key press, but
doggone if I can remember how I saw it done!
Could someone please give me some clue as to how to
accomplish what I am trying to do?
Thanks...
QBasic skills that I would like some help with...
I have written a small grade averaging program that
works great for my wife's needs. There is one
refinement though that I just can't seem to figure
out. I know it can't be that difficult, but with my serious
lack of programming skills, I haven't been able to
solve this.
As the program is currently written, once I enter
however many grades that I want to average, I enter a
"-1" to get the program to then GOTO the averaging
subroutine.
Now the above works just fine, but I would prefer for
the program to do the average when I merely hit the
"enter" key without entering any grade.
I know that I can't just write something similar to this:
IF (grade = "") THEN GOTO AverageGrades
since this will cause a type mismatch error because
the program is looking for an integer to be entered
here for the grade variable. So while I sort of
understand WHY I can't do something similar to the
above, I can't figure out how to do what I want to do.
I know that I have come across a way to cause a
program to respond to a simple enter key press, but
doggone if I can remember how I saw it done!
Could someone please give me some clue as to how to
accomplish what I am trying to do?
Thanks...