Re: DCL minute of the Day: integer to string, padded & right justified
From: Charlie Hammond (hammond_at_not@peek.ssr.hp.com)
Date: 04/02/04
- Next message: Peter Weaver: "Re: An interesting Search result"
- Previous message: Michael Unger: "Re: DCL minute of the Day: integer to string, padded & right justified"
- In reply to: Didier Morandi: "DCL minute of the Day: integer to string, padded & right justified"
- Next in thread: Charlie Hammond: "Re: DCL minute of the Day: integer to string, padded & right justified"
- Reply: Charlie Hammond: "Re: DCL minute of the Day: integer to string, padded & right justified"
- Reply: briggs_at_encompasserve.org: "Re: DCL minute of the Day: integer to string, padded & right justified"
- Reply: Didier Morandi: "Re: DCL minute of the Day: integer to string, padded & right justified"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 02 Apr 2004 20:05:59 GMT
In article <c4k8n2$125u$1@biggoron.nerim.net>,
Didier Morandi <no@spam.com> writes:
>I need to do this:
>
>source: an integer between 1 to 99999
>dest: a string 5 chars long with the number right justified and padded with spaces
>
>Of course, I can use Charlie H.'s processing (in DCL_DIET.COM):
>
>$ line_nr = "00000"
>$ line_nr[5-f$len(lines_in),f$len(lines_in)] := 'lines_in'
>
>to justify/pad with zeros in that case, but I wondered if it was possible to do
>it with F$FAO.
Hmmm... I don't think that is my code, Didier. At least I don't
remember it and can't locate it. I think I'd be more likely to
do something like the following:
$ source = 345 ! for example
$ line_nr = f$ao("!5AS",f$string(source))
$! Using ">" and "<" to show spaces better
$ write sys$output ">" + line_nr + "<"
>345 <
--
Charlie Hammond -- Hewlett-Packard Company -- Ft Lauderdale FL USA
(hammond@not@peek.ssr.hp.com -- remove "@not" when replying)
All opinions expressed are my own and not necessarily my employer's.
- Next message: Peter Weaver: "Re: An interesting Search result"
- Previous message: Michael Unger: "Re: DCL minute of the Day: integer to string, padded & right justified"
- In reply to: Didier Morandi: "DCL minute of the Day: integer to string, padded & right justified"
- Next in thread: Charlie Hammond: "Re: DCL minute of the Day: integer to string, padded & right justified"
- Reply: Charlie Hammond: "Re: DCL minute of the Day: integer to string, padded & right justified"
- Reply: briggs_at_encompasserve.org: "Re: DCL minute of the Day: integer to string, padded & right justified"
- Reply: Didier Morandi: "Re: DCL minute of the Day: integer to string, padded & right justified"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]