Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Use of "pause" statement

WSinc
新貢獻者 I
1,500 檢視
I frequently put a "pause" in the code when I want the program to stop and get my attention. Usually it's because of an error condition from a "sanity check" I put in there.

When it comes to that, it says "Enter CR or command."
I am wondering what other options are available for "command"

In the on-line documentation I cannot find a description of those. Entering Control-C is rather messy, since it generates run-time errors, when all I really want to do is stop debugging and restart.

I could accomplish the same thing by putting a "READ" statement in, but that's kind of sloppy also. BTW, this is a console application.

Anyway, are there any other options besides CR and control-C?
0 積分
5 回應
Steven_L_Intel1
1,500 檢視
The documentation says:

---
Effect on Windows Systems

The program waits for input on stdin. If you enter a blank line, execution resumes at the next executable statement.

Anything else is treated as a DOS command and is executed by a system( ) call. The program loops, letting you execute multiple DOS commands, until a blank line is entered. Execution then resumes at the next executable statement.
---

I would recommend use of MessageBox for such things. It may be a BIT harder to call (though not once you do it once), and is more obvious.

Steve

WSinc
新貢獻者 I
1,500 檢視
So my understanding is that one cannot use the response to control the execution of the user code, except for Ctrl-C to abort further execution.

I was wondering how you found the documentation you referred to. It is in on-line help, the index, or the programmers guide, or where? I spent over an hour looking for it. One thing I had trouble with is limiting the search to topics that only pertain to FORTRAN. No matter what I did, I got topics from everywhere, making it much more difficult.
Steven_L_Intel1
1,500 檢視
Online help - just typed "pause" in the index box.

Steve
Jugoslav_Dujic
傑出貢獻者 II
1,500 檢視
Bill, if you want only VF documentation, in online help, select View/Define Subsets, select only "Compaq Visual Fortran" from the tree, click "Add", give it a name & click "Save" and "Close". In the "Active subset" list (above topic list), select the new subset instead of "Entire collection". In this way, you'll get only VF topics in index and search.

Jugoslav
Steven_L_Intel1
1,500 檢視
I like MessageBox for user "control" because it is so flexible and easy to use from any application type. Also, users tend to be familiar with it.

Steve
回覆