forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Output Window Closes after running
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
erfejm



Joined: 25 Sep 2016
Posts: 7

PostPosted: Wed Sep 28, 2016 2:21 am    Post subject: Output Window Closes after running Reply with quote

Please help me. I cannot see the output of my codes anymore. Whenever I start run, it will display that linking and compiling is complete. Then the output window will open, but will close in less than a second. I have tried uninstalling and reinstalling Silverfrost but nothing happens. I really hope someone can help me. Thank you
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1725
Location: Sydney

PostPosted: Wed Sep 28, 2016 3:42 am    Post subject: Reply with quote

I am guessing you are running your program from within PLATO.
If this is the case, rather than letting the program exit, put a prompt to finish, such as:

write (*,*) 'Program has finished; prompt to exit'
read (*,'(i5)') n
stop
end

Alternatively, run your program outside of PLATO or put a few prompts in the program to report progress, using write (*,*) 'At this stage'

If you had a problem with the program, it should report something.

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4776
Location: Salford, UK

PostPosted: Wed Sep 28, 2016 7:31 am    Post subject: Reply with quote

You will get this behaviour when running a console application from Windows Explorer or perhaps Visual Studio.

When using a Command Prompt window (DOS box) or Plato, you will be able to see your output.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 495

PostPosted: Wed Sep 28, 2016 11:50 am    Post subject: Reply with quote

Quote:
Please help me. I cannot see the output of my codes anymore. Whenever I start run, it will display that linking and compiling is complete

... so, is this disappearing on compile as is implied above, or when running the executeable ?

These links, which seem to re-inforce the suggestions already made in earlier comments, may (or may not) help in understanding the 'problem'.

http://stackoverflow.com/questions/4164077/c-on-windows-the-console-window-just-flashes-and-disappears-whats-going-on

http://stackoverflow.com/questions/1775865/preventing-console-window-from-closing-on-visual-studio-c-c-console-applicatio

... surely there must be a parameter to set in Plato to avoid this phenomenon (see links where suggested settings for VS are given to solve it.
Back to top
View user's profile Send private message
IanLambley



Joined: 17 Dec 2006
Posts: 465
Location: Sunderland

PostPosted: Wed Sep 28, 2016 12:37 pm    Post subject: Reply with quote

If the output is in an old fashioned DOS box, then putting the "WINAPP" directive in the program will give a windows box which won't close on exist.
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4776
Location: Salford, UK

PostPosted: Wed Sep 28, 2016 1:00 pm    Post subject: Reply with quote

John

This is not an issue in Plato. The output is retained when you run a console application from Plato.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 495

PostPosted: Fri Sep 30, 2016 11:33 am    Post subject: Reply with quote

oops sorry Paulmy mistook, I picked up from JohnC's assumption in his 1st comment which hadn't been confirmed not denied by the poster (who seems not too interested i nthe replies)
Back to top
View user's profile Send private message
erfejm



Joined: 25 Sep 2016
Posts: 7

PostPosted: Sat Oct 01, 2016 8:01 am    Post subject: Reply with quote

I tried all replies, but sadly, nothing happened Sad.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4776
Location: Salford, UK

PostPosted: Sat Oct 01, 2016 9:22 am    Post subject: Reply with quote

Are you running your application from a Command Prompt window (DOS box)?

Is it a Windows application (using for example WINAPP) or a Console application?

Can you post a simple program that illustrates the problem?
Back to top
View user's profile Send private message
erfejm



Joined: 25 Sep 2016
Posts: 7

PostPosted: Sat Oct 01, 2016 10:34 am    Post subject: Reply with quote

All programs I run illustrates the problem, I run it using ctrl + f5 button.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1725
Location: Sydney

PostPosted: Sat Oct 01, 2016 10:43 am    Post subject: Reply with quote

try the following program and see if you get any output
Code:
      write (*,*) 'Hello there'
      end
Back to top
View user's profile Send private message
erfejm



Joined: 25 Sep 2016
Posts: 7

PostPosted: Sat Oct 01, 2016 11:39 am    Post subject: Reply with quote

Same thing, I start run, it will say "Compilation and linking complete", output window will open and closes almost immediately.
Back to top
View user's profile Send private message
erfejm



Joined: 25 Sep 2016
Posts: 7

PostPosted: Sat Oct 01, 2016 11:45 am    Post subject: Reply with quote

Is it possible that the error is related to the file "plato3.ini"? because it is located in my desktop.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1725
Location: Sydney

PostPosted: Sun Oct 02, 2016 12:05 am    Post subject: Reply with quote

You are not getting far with this.
It is surprising that the hello world program does not appear to run.
Do you generate a .exe file ? If do, try opening a "DOS box" or Command Prompt and go to where the .exe is stored and try to run it. If that fails, you could have problems with the .exe, but you should get some error message at least.
The information you are providing is not very clear as to what the problem is.
Back to top
View user's profile Send private message
erfejm



Joined: 25 Sep 2016
Posts: 7

PostPosted: Sun Oct 02, 2016 1:05 am    Post subject: Reply with quote

Yes, there are .exe files generated. I tried opening a DOS box and running hello.exe, same thing happened, but there were no error messages. But when I ran a pogram that gets the BMI of a person, it asks for information and when it will print the BMI, the output box closes.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group