Russ Whitaker wrote:
- How do I pass '-Praw' to PrinterArguments?
Like this: (Thanks, Frank!)
program Foo;
uses GPC, Printer;
var Printer : Text;
begin (* New (PrinterArguments, 1);*) getmem(printerarguments,8);{$w-}word(pointer(printerarguments)^):=1; PrinterArguments^[1] := NewString ('-Praw'); AssignPrinter (Printer, null); Rewrite (Printer); Writeln (Printer, 'foo') end.
Unfortunately, there is a problem with schema types transported through units, so we need the workaround with `getmem'. I am currently working on this problem, so you will be able use the correct `New' in future releases of GPC.
- Any particular reason why PrinterArguments isn't just a string?
When you are passing arguments to the program you already know their structure, so it's easy for you to decomposite them. If `PrinterArguments' were just a string, the `pipe' unit would have to do the decomposition before passing the parameters to the subprocess. Not a real problem, but it would be some unnecessary waste of resources.
Hope this helps,
Peter