Liste des Groupes | Revenir à co vms |
On 7/9/2025 12:51 PM, hb0815 wrote:I cannot think of any examples at the moment, but ISTR a few times this happens in DCLOn 7/9/25 16:13, Arne Vajhøj wrote:Ah. There is a way. Not using path but via return status.
...$ duo 1.txt/q,2.txt,3.txt/q>
Q=notpresent
1.txt Q=present
2.txt Q=notpresent
3.txt Q=present
$ duo/q 1.txt/q,2.txt,3.txt/q
Q=present
1.txt Q=present
2.txt Q=present
3.txt Q=present
>
Where:
2.txt Q=present
is not what was intended.
If you look at the return code and not only check for success, you get the information that a qualifier is global or local With a small C program, I get
>
$ duo/q 1.txt/q,2.txt,3.txt/q
Q=global
1.txt:Q=local
2.txt:Q=global
3.txt:Q=local
$ type duo.cld
define verb duo
image "sys$disk:[]duo"
parameter p1, value(type=$file, list, required)
qualifier q, placement=positional
$ type duo.pas
[inherit('sys$library:pascal$cli_routines','sys$library:starlet')]
program duo(input,output);
type
pstr = varying [255] of char;
var
fnm, a, b : pstr;
begin
if cli$present('Q') = CLI$_PRESENT then begin
writeln('Q=present')
end else begin
writeln('Q=notpresent')
end;
while odd(cli$get_value('P1', fnm.body, fnm.length)) do begin
write(fnm);
if cli$present('Q') = CLI$_LOCPRES then begin
write(' Q=present')
end else begin
write(' Q=notpresent')
end;
writeln;
end;
end.
$ set command duo
$ pas duo
$ link duo
$ duo 1.txt/q,2.txt,3.txt/q
Q=notpresent
1.txt Q=present
2.txt Q=notpresent
3.txt Q=present
$ duo/q 1.txt/q,2.txt,3.txt/q
Q=present
1.txt Q=present
2.txt Q=notpresent
3.txt Q=present
I am still not keen on the approach of the same
qualifier having different meaning for verb and
parameters though.
Arne
Les messages affichés proviennent d'usenet.