I have an app (and a few more in the pipeline) where I need to write a parameter file in a fixed format. I’m not in control of the format: it’s an international standard.
It has been designed with fixed positions for the various parameters, such as is easy to do with C (or, for those old enough to remember, FORTRAN).
My previous versions of the app were able to get by with the use of Format(x, “…”). But now, this is broken: the number representation now takes on the local locale, so, often as not, a numeric field which needs a point (.) as a decimal point, gets a comma (,). In the fixed format I must use, that is forbidden.
To try to overcome this I have defined a locale (en-GB) and use [double].toText(locale, “…”) where “…” is the format string.
But the old format strings no longer give usable results. and try as I might, I cannot get a consistent field length nor sign placement, even if I resort to using if … else … end if structures to try to format them.
Please can somebody explain how to get predictable and reliable field width definitions, tolerant of positive and negative quantities (with decimal places).
I never thought I would long for the old days of C and FORTRAN ;-(
thanks,
Richard