|
-
January 26th, 2002, 12:55 PM
#6
whenever I run the program on one, the box it pops up in closes after a second.
Does this program run in DOS? If so, open up a DOS window first, then run the program from the DOS window, then it won't close after it is ran.
IDENTIFICATION DIVISION.
PROGRAM-ID. MOOSE.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MOOSE PIC 999.
PROCEDURE DIVISION.
000-MAIN-MODULE.
MOVE 846 TO MOOSE
DISPLAY MOOSE
STOP RUN.
When I ran your code exactly in my compiler (RMCOSTAR), it did not work. The things I changed are:
*removed COMPUTATIONAL after 01 MOOSE PIC 999 - I don't know why, but it just didn't like it for me, so I removed it - it's only use is to improve speed I think, so for a simple prog like this, it really isn't necessary.
*after the PROCEDURE DIVISION is started, you need to name it before you start doing stuff - so I just named mine 000-MAIN-MODULE.
*removed full-stops after MOVE 846 TO MOOSE and DISPLAY MOOSE
*added to the end STOP RUN.
(NOTE: in the PROCEDURE DIVISION, you only have full-stops at the end of the procedure name (000-MAIN-MODULE) and the end of the procedure (this case STOP RUN).
Also, if you would like my compiler, e-mail me at [email protected] - it's not even 1MB.
Hope this helps,
Greg
\"Do you know what people are most afraid of?
What they don\'t understand.
When we don\'t understand, we turn to our assumptions.\"
-- William Forrester
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|