replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Output Window Closes after running
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: 2615
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: 8210
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 AIM Address
IanLambley



Joined: 17 Dec 2006
Posts: 506
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: 8210
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 AIM Address
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: 8210
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 AIM Address
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: 2615
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: 2615
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
erfejm



Joined: 25 Sep 2016
Posts: 7

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

There seems to be an exception though, whenever I run an .exe file that ask the user if they want to use the program again, the program runs normally.
Code:

Program Fibonacci
Integer :: n, m
11 Print*, "Please input a number"
Read*, n
m = 0
o = 1
print*, o
z = n-1
Do i=1, z
  t = m + o
 
  m = o
  o = t
  print*, t
End do 
write (*,*) 'Program has finished; prompt to exit'
12 Print*, "Do you want to use the program again? enter 1 for yes and 2 for no"
Read*, ans
!If user input values other than 1 and 2 then input error
If (ans > 2 .or. ans < 0 ) Then
    Print*, "Error"
     GoTO 12
!Else send then back to the start
Else If (ans == 1) then
  Go TO 11
Else
  Print*, "Thank you for using my program!! :)"
End if
End program Fibonacci
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