Silverfrost Forums

Welcome to our forums

Output Window Closes after running

28 Sep 2016 1:21 #18041

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

28 Sep 2016 2:42 #18042

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

28 Sep 2016 6:31 #18043

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.

28 Sep 2016 11:37 #18048

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.

28 Sep 2016 12:00 #18049

John

This is not an issue in Plato. The output is retained when you run a console application from Plato.

1 Oct 2016 7:01 #18068

I tried all replies, but sadly, nothing happened 😦.

1 Oct 2016 8:22 #18069

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?

1 Oct 2016 9:34 #18070

All programs I run illustrates the problem, I run it using ctrl + f5 button.

1 Oct 2016 9:43 #18071

try the following program and see if you get any output write (,) 'Hello there' end

1 Oct 2016 10:39 #18072

Same thing, I start run, it will say 'Compilation and linking complete', output window will open and closes almost immediately.

1 Oct 2016 10:45 #18073

Is it possible that the error is related to the file 'plato3.ini'? because it is located in my desktop.

1 Oct 2016 11:05 #18074

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.

2 Oct 2016 12:05 #18075

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.

2 Oct 2016 12:39 #18076

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.

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 
Please login to reply.