How to insert a pause between displaying of graphs

User ForumHow to insert a pause between displaying of graphs
jjones Staff asked 4 years ago

I have a program that displays a few graphics in sequence. I would like to have a short pause to give me time to view each one. How can I accomplish this?

1 Answers
Best Answer
jjones Staff answered 4 years ago

You have a couple of options for inserting pauses between the displaying of graphics or printing of output.

1. You can insert a pause for a specified number of seconds with the sleep command:

//Draw first graph
plotXY(x, y);
//Pause for 2 seconds
//Draw second graph
plotXY(x2, y2);

2. If you would like your graph or data to be displayed until you press a key, you can do that with the GAUSS keyw command:

k = 0;
print "press any key to display the next graphic";
do until k != 0;
   k = keyw();

When your code reaches the line "k = keyw()", a red cursor will be displayed in the program input/output window and the program will pause until you enter a key in the program input/output window.