From: dpb on
dpb wrote:
> And even more discouraging...
>
> >> strrep(s,' ','0')
> ans =
> 0030012.5
> >> [x,y,z]=strread(s,'%3d%3d%3.1f',1)
> x =
> 3
> y =
> 12
> z =
> 0.5000
> >>
>
> It pays no attention to the width specifier and parses to the '.' for
> the second value, apparently.
....

That's a mistake; I didn't save the substituted string and redid the
same thing w/ embedded blanks again w/o thinking.

The parsing of '0030012.5' _DOES_ work w/ a field width specification so
that would be another way, potentially.

I posted another query on the behavior; be interesting to see if it
generates any (useful) response(s)...

--
From: Peter Riddersholm on
Wow, I never thought something that simple would turn out so difficult!

Thanks a lot for your help - I think I've got it working now...

Peter

dpb <none(a)non.net> wrote in message <i12ng9$7t3$1(a)news.eternal-september.org>...
> dpb wrote:
> > And even more discouraging...
> >
> > >> strrep(s,' ','0')
> > ans =
> > 0030012.5
> > >> [x,y,z]=strread(s,'%3d%3d%3.1f',1)
> > x =
> > 3
> > y =
> > 12
> > z =
> > 0.5000
> > >>
> >
> > It pays no attention to the width specifier and parses to the '.' for
> > the second value, apparently.
> ...
>
> That's a mistake; I didn't save the substituted string and redid the
> same thing w/ embedded blanks again w/o thinking.
>
> The parsing of '0030012.5' _DOES_ work w/ a field width specification so
> that would be another way, potentially.
>
> I posted another query on the behavior; be interesting to see if it
> generates any (useful) response(s)...
>
> --
From: dpb on
Peter Riddersholm wrote:
> Wow, I never thought something that simple would turn out so difficult!
>
> Thanks a lot for your help - I think I've got it working now...
....
It surely _ought_NOT_ be but is, owing I suppose to the slavish (now,
unfortunately, irreversible) following of C-style i/o formatting syntax.
Too bad TMW didn't have the foresight to have dumped it in favor of
more Fortran-like behavior and add the useful extensions such as the
field skip asterisk, etc.

Anyway, glad you finally got something going...what did you finally end
up doing?

And, btw, so far the other thread has engendered no substantive response
other than one other unhappy camper... :(

--