View previous topic :: View next topic |
Author |
Message |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Sun Sep 08, 2019 11:53 pm Post subject: Is this extension standard conforming now? |
|
|
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 |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Mon Sep 09, 2019 1:38 am Post subject: |
|
|
Variable Format Expression, "VFE", please see:
<https://gnu.huihoo.org/gcc/gcc-4.8.5/gfortran/Variable-FORMAT-expressions.html> |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Sep 09, 2019 6:59 am Post subject: |
|
|
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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sat Sep 14, 2019 7:41 am Post subject: |
|
|
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 |
|
 |
|