replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Q FOrMAT
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 

Q FOrMAT

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



Joined: 22 May 2008
Posts: 20

PostPosted: Mon Nov 03, 2008 12:08 pm    Post subject: Q FOrMAT Reply with quote

Hi,

I�m comparing a code writted in 77 FORTRAN Version with the PLato compiler. When I move this code from 77 to PLato, the code is not working.... . I found that my boss (which uses 77) defines Q in the format... I never heard about Q in the format....., maybe the error is here


Do you know what�s this Q? do you know if Plato supports it??

Any comment is really appreciated
Thanks in advance and best regards
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: Mon Nov 03, 2008 2:02 pm    Post subject: Reply with quote

The standard edit descriptors are listed in the help file under "FORMAT edit descriptors". Extensions are given under "Business Editing".

Q is not mentioned and I have not seen this before.
Back to top
View user's profile Send private message AIM Address
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Mon Nov 03, 2008 2:24 pm    Post subject: Reply with quote

Kingkastle,

Q format descriptor was never part of the Fortran 77 standard. Thus your source is non-standard and the chances are that there may well be more non-standard (compiler specific) extensions to the standard lurking within the code that ftn95 will object to.
Back to top
View user's profile Send private message Visit poster's website
JohnCampbell



Joined: 16 Feb 2006
Posts: 2615
Location: Sydney

PostPosted: Mon Nov 03, 2008 10:54 pm    Post subject: Reply with quote

I'm not sure, but I recall that Q format was hex format in Prime or Vax fortran. The clue may be in the rest of format descriptor, say Q10.
The solution is to replace it with a standard format that is consistent with the variable type being used.
If it is used to write to a file, there is little to wory about. If it is being read then it may need more research.

John
Back to top
View user's profile Send private message
IanLambley



Joined: 17 Dec 2006
Posts: 506
Location: Sunderland

PostPosted: Thu Nov 06, 2008 1:42 pm    Post subject: Reply with quote

In Vax fortran77, the Q format allowed you to determine the number of characters on the line, i.e. record length on a formatted file with arbitary lengths for each line.

I used to use it to determine how many trailing spaces were actually on the line. For example if the input contained:
hello there||||||[eol]

where i have used | to represent a space, & [eol] is end of line, then
Code:

character*100 text
open(unit=10,file='myfile.txt',status='old')
read(10,1000,end=999)ilen,text
1000 format(q,a)


would return ilen=17 in the above example.


In FTN95, the equivalent would be:
Code:

character*100 text
integer*2 attr,handle,error_code
attr=0
call OPENF@('myfile.txt',ATTR,HANDLE,ERROR_CODE)

call READFA@(text, HANDLE, ilen, ERROR_CODE)
if(ilen .eq. -1)goto 999
Back to top
View user's profile Send private message Send e-mail
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