- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am writing a REAL to a string. The REAL can either be
0.00 < REAL < 99.99 [or] 100.01 < REAL < 999.99
However I don't know the value in advance. So when I use F5.2 and the number is above 99.99, the string shows: ****** and when I use F6.2 and the number is less than 100.01, the string shows a space before the number.
How do I correct this so that F5.2 or F6.2 is selected automatically and the string has no spaces nor ****. I can imagin there would be a simple solution for this, but I could not find it even after some effort.
Many thanks in advance.
-Kulachi
I am writing a REAL to a string. The REAL can either be
0.00 < REAL < 99.99 [or] 100.01 < REAL < 999.99
However I don't know the value in advance. So when I use F5.2 and the number is above 99.99, the string shows: ****** and when I use F6.2 and the number is less than 100.01, the string shows a space before the number.
How do I correct this so that F5.2 or F6.2 is selected automatically and the string has no spaces nor ****. I can imagin there would be a simple solution for this, but I could not find it even after some effort.
Many thanks in advance.
-Kulachi
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
write(string,'(f0.2)') 99.99
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!
Kulachi
Kulachi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
This solution to the posted question is clearly included in the documentation in the statement
"When the value of the field width is zero, the compiler selects the smallest possible positive actual field width that does not result in the field being filled with asterisks."
It would be helpful if this is added to the section of the documentation under "F Editing" because here the only statement is that "The w must be greater than or equal to d+3". There is no reference that w may be zero.
Regards,
David
This solution to the posted question is clearly included in the documentation in the statement
"When the value of the field width is zero, the compiler selects the smallest possible positive actual field width that does not result in the field being filled with asterisks."
It would be helpful if this is added to the section of the documentation under "F Editing" because here the only statement is that "The w must be greater than or equal to d+3". There is no reference that w may be zero.
Regards,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
David,
Thanks for noticing that - I will be sure to pass that along to our writers.
Thanks for noticing that - I will be sure to pass that along to our writers.

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