Link to home
Start Free TrialLog in
Avatar of MichaelKatz
MichaelKatz

asked on

How to specify OS variables from VFP

On a prior EE suggestion, I an using Bullzip to create PDF files.

Bullzip allows a user specified filename by using an environment variable.

I am trying to set up an environment variable with the run command. . .

RUN set pdfname=c:\pdfs\clientname

This works fine from the OS command window but NOT from the VFP command window.

I don't get any errors, but           ? GETENV('pdfname')             displays nothing
SOLUTION
Avatar of tusharkanvinde
tusharkanvinde
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SetEnvironmentVariable returns positive number if successful.
P Celba.

I did not know about SetEnvironmentVariable. Thanks.
Me neither but the perfect http://www.news2news.com/vfp/?group=58&function=227 and Google exists :-)

Welcome on the sandbox, sudhir1979. Just FYI, you may test mesaages in Longue (https://www.experts-exchange.com/Other/Lounge/) or in Experts longue (https://www.experts-exchange.com/Other/Expert_Lounge/).
Avatar of MichaelKatz
MichaelKatz

ASKER

Thanks,

I'm making progress but it still doesn't work. The variable shows up in both the OS command window and when I create one from VFP  (! cmd).

I put   <env:c:\pdfs\clientname>   in the "File Name" text box of the "General" tab of the Bullzip "Options" dialog.

I set the "Save as" dialog to show only when "No file name is specified", but it still appears.

Should I be talking to Bullzip people.

Michael
I am not using Bullzip but looking at its documentation (http://www.biopdf.com/guide/), you should set it following way (suppose the environment variable pdfname was created from VFP already):

Output=<env:pdfname>.pdf

<env:c:\pdfs\clientname> is most probably wrong because it is trying to read "c:\pdfs\clientname" variable which does not exist.
The
Output=<env:pdfname>.pdf
is in a format how it appears in .ini file

If you are creating settings from the dialog then <env:pdfname>.pdf  should be enough.

You wrote "The variable shows up in both the OS command window and when I create one from VFP  (! cmd)." which I don't partly understand.

Do you mean the pdfname variable apperas even when you did not create it in VFP? In such case it was probably created at OS level prior to VFP launch.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

oops,

This is what I have in the above mentioned textbox. . .

<env:usspdfname>

The variable does exist, and the value is a valid path including the filename.

Tje OutPut=. .  method should go in an ini file, which I am trying to avoid. According to the documentation the file is in an "application data" folder under the user who was logged on during the installation.
I've been trying to install Bullzip on Vista with no success...

I think jrbbldr suggested good work around.
pcelba,

I did also create it at the OS level, just in case.  I realize now that it is only in that one instance of command.com


jrbbldr,
My app will be distributed with the suggestion to use Bullzip. We have had many comments on the adobe dialog box.

Your idea is good, but I am still left with needing a way to configure Bullzip programatically.

" I am still left with needing a way to configure Bullzip programatically."

You might want to look for the Bullzip configuration file and either replace it with your own or modify it programatically.

I found my Bullzip config file
    C:\Documents and Settings\MyDir\Application Data\Bullzip\PDF Printer\settings@Bullzip PDF Printer.ini
NOTE - if there are multiple users on a given workstation, each may have their own Bullzip config file in their own   Documents and Settings   directory.

Good Luck

BTW, do you somebody use Bullzip in Vista?

The installation on my machine is not able to create one folder under Program files\Bullzip\... saying "Access denied".
I have no Bullzip installations using Vista (thank goodness!!!)

There is a Support Forum where there may be more info
    http://www.bullzip.com/phpBB/viewforum.php?f=21&sid=8bc4303fee6833f3aa9f9b7eb9df5409

And they have an support question email submittal form
   http://www.bullzip.com/contact.php