I'm not sure whether I fully understand what you are trying to achieve. From what I read, I would for a text file (file.txt) like
This
That
"Quoted"
"Quoted blank"
" "
This and that
"This and" "that"
write a command procedure (echo.com) like
$ cc:=$sys$disk:[]echo
$ OPEN a file.txt
$ loop:
$ READ/END_OF_FILE:end a b
$ show symb b
$ CC 'b'
$ goto loop
$ end:
$ CLOSE a
which when run gives:
$ @echo
B = "This"
arg1: 'this'
B = "That"
arg1: 'that'
B = ""Quoted""
arg1: 'Quoted'
B = ""Quoted blank""
arg1: 'Quoted blank'
B = "" ""
arg1: ' '
B = "This and that"
arg1: 'this'
arg2: 'and'
arg3: 'that'
B = ""This and" "that""
arg1: 'This and'
arg2: 'that'
$
where echo.exe is just an simple C program to print argv, starting with argument 1 and quoted with single quotes; and the $ show symb b
is just to show what was actually read from the file; the symbols content is quoted with double quotes.
This is more or less what you had, except the $ CC 'b'
where the single quotes tells dcl to expand the symbol b. And a close of the input file after reading it is not a bad idea.
No, there is no need to DEFINE
anything. For the foreign command you don't have to have the .exe
, it's the default.