replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Syntax error using FORMAT statement
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 

Syntax error using FORMAT statement

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



Joined: 02 Aug 2014
Posts: 40
Location: Lancashire, United Kingdom

PostPosted: Wed Sep 24, 2014 8:04 am    Post subject: Syntax error using FORMAT statement Reply with quote

Hi Group,

I am getting a compiler error when it encounters the following statement:

Code:
980   FORMAT('Input : ',a,' =',$,' ',F12.6,' =',$)


The error is reported as:

Quote:
error 276 - The '$' edit descriptor must be the last item in the list


Is this a general FTN syntax error or is it peculiar to the SilverFrost compiler and if so how should I format this statement please?

Thanks for any assistance.
_________________
Regards

Mike
Back to top
View user's profile Send private message Send e-mail
IanLambley



Joined: 17 Dec 2006
Posts: 506
Location: Sunderland

PostPosted: Wed Sep 24, 2014 1:17 pm    Post subject: Reply with quote

Only one $ per line and as the last item. You are obviously trying to hold the cursor at the end of a prompt line to request input.

This untested example builds a format line to include a text string and prompts for input of a real number. F12.0 on input helps with not having to enter a decimal place.
Code:

      Character*30 format1
      character*10 data_out
      real*8 avalue

      data_out='qwertyuiop'

      format1 = '(''Input : '//data_out//' = '',F12.0,$)'

      read(6,fmt=format1)avalue


Hope it helps
Ian
Back to top
View user's profile Send private message Send e-mail
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Wed Sep 24, 2014 1:33 pm    Post subject: Reply with quote

It's a WATCOM extension, i.e. nonstandard. It's another thing that you won't need in a Windows program!

Eddie
Back to top
View user's profile Send private message
mike.smartcam



Joined: 02 Aug 2014
Posts: 40
Location: Lancashire, United Kingdom

PostPosted: Wed Sep 24, 2014 3:30 pm    Post subject: Reply with quote

Thank you Gents
_________________
Regards

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



Joined: 16 Feb 2006
Posts: 2615
Location: Sydney

PostPosted: Thu Sep 25, 2014 1:15 am    Post subject: Reply with quote

I have found that FTN95 supports both \ and $ as end of line format controllers, but can't find them in FTN95 help.
The following example works for Ver 7.10.0
Code:
!  program to test \ and $
!
      character answer*20
      integer i
!
      do i = 1,2
!
         write (*,1001) 'This is a slash test :'
         read (*,1000) answer
!
         write (*,2001) 'This is a dollar test :'
         read (*,1000) answer
      end do
1000  format (a)
1001  format (a\)
2001  format (a$)
!
      end
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Sep 25, 2014 6:56 am    Post subject: Reply with quote

I have logged this omission.
Back to top
View user's profile Send private message AIM Address
simon



Joined: 05 Jul 2006
Posts: 299

PostPosted: Sat Sep 27, 2014 3:31 pm    Post subject: Reply with quote

I use:

Code:
WRITE (UNIT=*,FMT='(1X,A)',ADVANCE='no') TRIM(cprmpt)//' >  '


where cprompt is a character string.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Sat Sep 27, 2014 7:14 pm    Post subject: Reply with quote

They are almost certainly in the FTN77 documentation. As always, to understand FTN95, you need FT95.CHM, the .ENH file AND the FTN77 documentation!

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


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

PostPosted: Wed Jan 21, 2015 3:38 pm    Post subject: Reply with quote

This information has now been added to the documentation for the next release.
Back to top
View user's profile Send private message AIM Address
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