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 

problems with screen output

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
eugenea



Joined: 14 May 2007
Posts: 2

PostPosted: Wed May 16, 2007 3:21 pm    Post subject: problems with screen output Reply with quote

I have a program that used to run OK with UNIX compilers, but I am having some problems moving it to Windows using Silverfrost F95.

I've ironed out most of the errors - they were my fault (my previous compilers were too permissive and allowed some bad practices; Silverfrost is more strict, and justly so).

But there is one last (hopefully!) problem I just cannot solve. The software does not want to print to screen from subroutines (it does from the core program), saying "error 94: unit neither has been OPENed nor preconnected".

I don't want to disable screen output; I need to monitor that things are OK. How can I open or preconnect screen output?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed May 16, 2007 4:34 pm    Post subject: Reply with quote

You do not need to open or preconnect.
Just use PRINT or WRITE(2, ...) or WRITE(6, ....)
Back to top
View user's profile Send private message AIM Address
eugenea



Joined: 14 May 2007
Posts: 2

PostPosted: Wed May 16, 2007 4:41 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
You do not need to open or preconnect.
Just use PRINT or WRITE(2, ...) or WRITE(6, ....)


It's PRINT that is causing the problem.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed May 16, 2007 6:47 pm    Post subject: Reply with quote

Can you post a small program here to illustrate the problem?
Back to top
View user's profile Send private message AIM Address
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Thu May 17, 2007 12:10 pm    Post subject: Printing problems Reply with quote

Try avoiding low unit numbers for your normal i/o, if you open a file with unit 1, 2 .. 6 etc, then this may overrule the standard preconnections. Closing them afterwards may not restore the preconnections. I always start my i/o unit numbers at 10.

Just a suggestion.

Ian
Back to top
View user's profile Send private message Send e-mail
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Fri May 18, 2007 12:17 am    Post subject: Reply with quote

To write to the screen, you can simply use the following format defined or free format, or any expansion of these.

write (*,1001) 'string and number ',i
1001 format (a,i0)

write (*,*) 'string and number ',i

I use these in both a cmd.exe DOS box or clearwin+, without any problems.

You may also use units 1 or 6, as these are the default output.
write (1,1001) 'string and number ',i

If these are not working, make sure you don't open a file on units 1-7, in case of any legacy unit issues. I start opening files from unit 11.

I hope this relates to your problem.
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 -> Support All times are GMT + 1 Hour
Page 1 of 1

 
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