Operating System - OpenVMS
1752374 Members
6638 Online
108787 Solutions
New Discussion юеВ

Lexical F$FAO '!%S' Not Working?

 
SOLVED
Go to solution
Robert Atkinson
Respected Contributor

Lexical F$FAO '!%S' Not Working?

I'm sure it's because I'm doing something wrong, but does anyone know why I'm getting an 's' with both of these statements.

If CHECK is '1' then surely it should drop the 's'?

Rob.


GAMMA_ROB$$ $ CHECK = 1
GAMMA_ROB$$ $ IF CHECK THEN WS F$FAO(" file!%S with differences found",CHECK)
files with differences found
GAMMA_ROB$$ $ IF .NOT. CHECK THEN WS F$FAO(" file!%S with differences found",CHECK)
GAMMA_ROB$$ CHECK = 2
GAMMA_ROB$$ $ IF CHECK THEN WS F$FAO(" file!%S with differences found",CHECK)
GAMMA_ROB$$ $ IF .NOT. CHECK THEN WS F$FAO(" file!%S with differences found",CHECK)
files with differences found
GAMMA_ROB$$
5 REPLIES 5
Richard Brodie_1
Honored Contributor

Re: Lexical F$FAO '!%S' Not Working?

!%S refers to the previous conversion, so you can easily write: "n file(s) with differences found". You can use a zero-width conversion with something like F$FAO("!0ZL file!%S found", COUNT)to get the effect you want.
Kris Clippeleyr
Honored Contributor
Solution

Re: Lexical F$FAO '!%S' Not Working?

Rob,

Correct syntax would be
F$FAO("!SL file!%S with differences found",CHECK)

Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Jan van den Ende
Honored Contributor

Re: Lexical F$FAO '!%S' Not Working?

Rob,

I am not sure why the doc specifies %S.
Probably because in $FAO you have can use various numeric formats, and you have to specify which one as the second char of the "%S" argument.
But in DCL nemeric values ARE longwords, so your only choice IS %SL
The documentation could be clearer, but looking at the example helps a lot.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Robert Atkinson
Respected Contributor

Re: Lexical F$FAO '!%S' Not Working?

Cheers all.

I read the bit about 'the most recently converted number' in help, but it wasn't very clear about what this meant.

I now see how this is applied.

Rob.
David Jones_21
Trusted Contributor

Re: Lexical F$FAO '!%S' Not Working?

>Correct syntax would be
>F$FAO("!SL file!%S with differences >found",CHECK)

If you dont want to display the number:
F$FAO("!0SLfile!%S with differences found",CHECK)

It's converting the number and trimming to zero width.
I'm looking for marbles all day long.