- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm writing floating point data to a text file with a (G) format and for a number like 0.12345 the presence of a leading zero depends on whether I'm running the program from a DOS command line or running it from inside the visual studio debugger. Is this supposed to happen?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, and I think you're not properly explaining what you are seeing. Small but complete code example, please, with sample output in both cases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Depending on the attributes used to OPEN the file and compiler options such as /vms, ASA carriage control may be in play. That would explain why a leading '0' character would cause the program to output a blank line followed by the rest of the record.
Is xi2 computable from xi?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please show a complete program and also show the compile options used. I would also discourage you from using "G" with no width as that is non-standard. You could use G0, maybe with a 1X after the G0. Are you running the same executable in both environments or recompiling? Show options in both cases.
Fortran carriage control is not on by default, but Intel Fortran generally doesn't add a leading zero when F format is in effect. Maybe you're running an executable built by some other compiler?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's possible the post got held for moderation - we're working to improve that. Use "Send Author A Message" to send it to me if you want,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm still looking for a test case I can build and run myself. There should not be a difference.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page