System Command

Brian K. White brian at aljex.com
Wed Apr 17 08:28:01 PDT 2013


This is a case of "It hurts when I smash my finger with this hammer"

The answer isn't tougher fingers or softer hammers. The answer is "don't 
do that"

So, instead of trying to hard code unsafe assumptions into your app, and 
then being burned when the meaning of "unsafe assumption" get's proven, 
instead try to use safer assumptions.

In other words, don't even try to know the path to the adobe executable.

You never will be able to predict that with certainty, and it's 
user-unfriendly to assume that the only way to view pdf's is with adobe.

Instead use the "start" command and the path to the pdf.

system "start /path/to/file.pdf"
ex:
system "start" < pf

Then the start command will consult the windows registry and launch 
whatever pdf viewer the user has installed or chosen as their default 
pdf viewer. You don't have to know or care what version of Adobe reader, 
is it in program files or program files (x86), etc, or even if they are 
using Adobe at all or some other pdf viewer.

google up help on the start command. There are a couple of command line 
arguments that change it's behavior which you may want. Like do you want 
the system command to run and return immediately, allowing processing to 
proceed immediately while the pdf launches (probably), or do you want 
the system command to halt until the pdf viewer app closes? (probably not)

-- 
bkw


On 4/17/2013 11:01 AM, Richard Tartaglia wrote:
> I am running FilePro 5.0.14 using windows XP.
>
> I have an @key process to save a PDF file or display that PDF saved in a blob field. Everything worked great until I updated Adobe to a newer version. Of course the system prompt can’t find Adobe until I update my code in FilePro to the new version of Adobe.
>
> Is there a way to get the version from windows, put it in a variable for FilePro and then use it for the prompt to display the PDF.
>
>
> Thanks
>
> Rich
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20130417/b1b18965/attachment.html
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>



More information about the Filepro-list mailing list