Q: How can I print the output file from inside my SQR program on DOS, Windows, Unix, and VMS platforms?
A: Close the existing output file with the new-report command and then call the system command processor to print the file. The version 3 SQR variable $sqr-platform is tested to determine what platform the program is running on.
---------------------------- Example code starts here -------------------------
begin-program
do main
move $sqr-report to $orig_report
new-report 'junk.lis'
evaluate $sqr-platform
when = 'DOS'
let $cmd = 'print ' || $orig_report
when = 'UNIX'
let $cmd = 'lp ' || $orig_report
when = 'VMS'
let $cmd = 'print ' || $orig_report
when = 'WINDOWS'
let $cmd = getenv('COMSPEC') || ' /C print ' || $orig_report
when-other
show beep 'Printing not supported for platform ' $sqr-platform
end-evaluate
call system using $cmd #status
end-program
---------------------------- Example code ends here ---------------------------