Re: reading variably sized floats



On Fri, 23 Jan 2009 08:55:50 +0000 (GMT), nmm1@xxxxxxxxx wrote:

In article <0606c19d-d48b-4d4b-9d95-7e03d9781a87@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Terence <tbwright@xxxxxxxxx> wrote:
Richard Maine wrote:

The tab character is just a character and is counted as 1 when using
the nX ( or the nA(m) or An) format field specifier.

While that is a likely behavior with most compilers, possibly even all
of the current ones, it is *NOT* behavior specified by the standard. The
standard does not require that tabs be accepted as formatted input data
at all. It would certainly be valid for a compiler to do something like
expand the tabs into equivalent blanks. I don't know that any current
compilers actually do this, but the standard does allow it.

Even more interestingly, that behaviour is precisely what is required
by the ASCII standard - but few people now realise that it is more
than a character set!

And, yes, I remember that happening, too.

I assume you mean the former (just data) not the latter (expand
spaces). It's been a long time since I had an actual X3.4, but my
strong recollection is that all the Format Effectors were defined only
for print/display (output) devices, and only in terms of moving the
active position. In particular, for many (I would say most) early CRT
terminals, sending space(s) would blank out any previous data in the
positions moved over, but HT would not. (Sometimes this was selectable
by a switch, jumper, etc.)

I don't recall any specific requirement that other equipment leave it
unchanged, although there's an argument that it's _intended_ for the
last device and thus everything that is -- or thinks it might be --
upstream has a responsibility to pass it on.

<snip>
In response to Richard's note, I do point out that any future action
on a Fortran-compiled executable, with respect to the postulated
automatic expansion of the tab character to some number of blanks,
(and I assume only in a "formatted input stream"), would require this
number of replacements blanks, or the definition of tab points, to be
User-declarable, to prevent gibberish.

Well, that's not what the ASCII standard says, not what used to happen,
and not what is conventional nowadays. For at least the past 20 years,
the de facto meaning of TAB has been to move to the lowest 8n+1 position
that is at least 2 positions beyond the previous one.

The separate but related X3.64 did define (among many other things) a
command sequence to set horizontal tab stops, which I saw used a fair
bit. But I agree that next-mod-8 was the single most common usage, and
still is where it is output at all (not processed internally).

But it almost always has been system dependent, and not standardised
between systems.

System(s) and/or device(s).

<snip rest>
.



Relevant Pages

  • Re: Many small programs vs. one large program?
    ... code format, etc... ... format, not the input or output data files... ... many compilers, I believe Intel's are among them, ... Many DEC-heritage compilers, including CVF and IVF, allowed "tab ...
    (comp.lang.fortran)
  • Re: reading variably sized floats
    ... the nX or An) format field specifier. ... While that is a likely behavior with most compilers, ... it is *NOT* behavior specified by the standard. ... number of replacements blanks, or the definition of tab points, to be ...
    (comp.lang.fortran)
  • Re: variable arguments in format statement
    ... But this does not work in gfortran as it is "non standard" ... You are right that VFEs (variable format expressions - I think the "e" ... was for "expression) are nonstandard and don't work with al compilers. ...
    (comp.lang.fortran)
  • Re: Way to automate changing Regional Settings, specifically date and time format?
    ... date and time format, got to thinking that there might be some command line ... Would like it to open the tab, ... me that though I'd thought I was using one standard format that I'd ... "customize" box in the regional settings. ...
    (microsoft.public.windowsxp.basics)
  • Re: ES format
    ... >> runtime format, even a runtime format that is trivially constant, not. ... You aren't allowed by Standard C to define any _external_ linkage ... In particular you certainly can define a 'static' function printf(), ... but otherwise it is part of the language and the compiler ...
    (comp.lang.fortran)