"Warning, Will Robinson, WARNING"

The presence of double-quotes (") _inside_ the string to be passed to
DOS can provide 'surprise' results.  This was fixed in 10.1.1 by patch #
5616 which includes a new function "UVRunCommand" (I think the same
patch found its way into 10.0.x, but I haven't checked the Release Notes
for 10.0)

>From the 10.1.1 Release Notes:
5616    At this release, a new GCI function, UVRunCommand, has been
        added. This command executes a Windows executable and has one
        argument. You can specify the executable name and its argument
        as a string. To execute the command, use 
        C:\windows\system32\cmd.exe /c. You must use single or double
        quotation marks around the string argument, as shown in the 
        following example:

        Result = UVRunCommand("c:\WINDOWS\system32\cmd.exe /c dir")

For example, suppose that the "123.pdf" file has to go in a directory
"The Users Data".
The proper DOS convention is to enclose an argument with spaces in
double quotes as I show it above.
So, you would replace the above example with 
Cmd =  'AcroRd32 /p /t "The Users Data\123.pdf"'
Result = UVRunCommand(Cmd)

If you tried 
Cmd =  \DOS /C 'AcroRd32 /p /t "The Users Data\123.pdf"'\
PERFORM Cmd
The data received by DOS would NOT be what you expected.

And, no I don't know what gets put into "Result", I haven't started
testing 10.1 yet.


HTH

Mike

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Ray Wurlod
> Sent: Tuesday, 26 April 2005 19:18
> To: u2-users@listserver.u2ug.org
> Subject: RE: Re[2]: [U2] Printing PDF from uv {Unclassified}
> 
> Don't forget that UniVerse BASIC has three quote characters, 
> the backslash being the third.  And PERFORM is more efficient 
> than EXECUTE (depending on flavor and/or $OPTIONS) since it 
> doesn't set up an extra execution level.  F'r instance:
> 
> Cmd =  \DOS /C "AcroRd32 /p /t 123.pdf"\
> PERFORM Cmd
> -------
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/
> 
The information contained in this Internet Email message is intended
for the addressee only and may contain privileged information, but not
necessarily the official views or opinions of the New Zealand Defence Force.
If you are not the intended recipient you must not use, disclose, copy or 
distribute this message or the information in it.

If you have received this message in error, please Email or telephone
the sender immediately.
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to