Looping Concerns for Stat Tracking

I'm trying to wrap my head around looping. I'm honestly not even sure if it's necessary for what I want. Any help would be greatly appreciated. I'm a super noob...so forgive me if this is too far above my level. I'm trying to build a live (auto updating) stat tracker program. For example I'll use number of "A" key presses. I want my program to count and display updated results for each instance where the A key is pressed. However, I don't want to require the "Enter" key. Simply nothing will happen for any other key except "A". I also don't want to require "Enter" to close the program, but assign "X" as the close out the program.

My program needs to count how many times the "A" button is pressed. I also need a simple duplication process done to a named variable. (Each instance "A" [buttonPress declared variable] is pressed doubles the value of dupeCount variable) I want the screen to display "Pressed "A" __ times" and "Duplicated Value = ". The issue is I don't want thousands of lines of displayed results. I'm concerned that will be the case if I loop such a process. I want each press to result in clearing the screen and repopulating updated data for the two items displayed. Is there a way to instruct the program to close after pressing "X" as well?

Or should I build this process as a module? I will likely (after this stage is learned of course) want to export those results to an external database or file and import them at a later time.


EDIT: I'm working on Windows 10 using the Visual Studio IDE.
Last edited on
Topic archived. No new replies allowed.