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 

Is this extension standard conforming now?

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



Joined: 10 Mar 2008
Posts: 2102
Location: South Pole, Antarctica

PostPosted: Sun Sep 08, 2019 11:53 pm    Post subject: Is this extension standard conforming now? Reply with quote

DEC had very convenient format specifier <n> where n defined number of spaces for example. Possibly also number of digits in mantissa etc like instead of fixed e10.4 you write e<i1>.<j1>, which is equivalent to it if i=10, j=4, but i do not remember this for sure already. ***Very*** convenient. For example with iii=3 this
Code:
Write(11, '(<iii>x, i4)') iii

was writing iii and 3 spaces before it which is equivalent to
Code:
Write(11, '(3x, i4)') iii

You can do similar thing today in FTN95 only in 4 lines of text
Code:
character chFormat*16
chformat = '(xxxx, i4)'
write(chformat(2:5), '(i4.4)') = iii
Write(11, chformat) iii

Hell.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1198

PostPosted: Mon Sep 09, 2019 1:38 am    Post subject: Reply with quote

Variable Format Expression, "VFE", please see:

<https://gnu.huihoo.org/gcc/gcc-4.8.5/gfortran/Variable-FORMAT-expressions.html>
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Sep 09, 2019 6:59 am    Post subject: Reply with quote

FTN95 does not have this extension but there is something like it in ClearWin+ winio@. The standard C function printf uses a '*' and picks up the field width from the argument list. This feature is mirrored in winio@.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1226
Location: Aerospace Valley

PostPosted: Fri Sep 13, 2019 7:31 pm    Post subject: Reply with quote

intteresting,

so does that mean that in q winio statement if somewher is specified:
'*'.'*'
it will look for and pick up 2 variables, say i and j, integers and read the format as i.j (with the values )

e.g. if i=3 and j= 9 it could be used to create a real value 3.9 ?

(just a nonsense hypothetical example)
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Sep 14, 2019 7:41 am    Post subject: Reply with quote

Here is a quote from the manual...

Each format code begins with the percent (%) character, followed by optional size information of the form n or n.m where n and m are integer constants (e.g. %6.4wd). n and/or m can be replaced by an asterisk "*" with the corresponding value(s) being supplied as one or two INTEGER arguments in the argument list. After the optional size information, a two-letter code is used to define the format. This two letter code is not case sensitive. Some format codes have mandatory size information. These sizes are represented by uppercase N and M in the text.
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
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