09-30-2017 12:13 AM
Hello,
My goal is to create a button that will display the sum of two random integers in a frequency chart one at a time. Every time this button is pressed, a new value should be displayed. I also need to create a button to clear the data in the frequency chart.
So far, I am able to run the program and put my values on the chart. However, I do not know how to create a button to display them one by one, or create a button to clear the data.
Thanks for the help.
09-30-2017 01:03 AM - edited 09-30-2017 11:53 AM
Are you sure you attached the right program? There is only one button. There is no chart. (I don't even know what a "frequency chart" is.). I doubt your problem is with "creating" a button. Buttons are right there in the palette. Seem you have problems with programming.
There is only a stop button and while the program is running, it generates millions of values per second, spinning the loop as fast as the computer allows and storing all data in a auto-indexing output tunnel. Once the stop button is pressed, the gigantic array is displayed in an array indicator (unless your ran out of memory first). In any case, this seems to have little to do with your questions.
I recommend doing a few basic tutorials.
09-30-2017 06:06 AM
Learn to use an Event Structure. With it, you wait for specific things to happen such as button presses.
09-30-2017 09:29 AM
It sounds like what you want is a histogram, and as crossrulz said, you need an Event Structure.
This can register for button press events, and used inside a While loop will allow you to run specific code when different buttons are pressed.
So long as the timeout isn't set to 0, it also acts to limit the rate of your while loop.
09-30-2017 12:10 PM
Be sure o follow all other advise... If you really want to put a text in a button, use the Boolean text property. Make sure it's set to visible with right click>visible items.
09-30-2017 01:03 PM
Here are a few simple rules you might have missed in class.