Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Fox PRo PRG's

Status
Not open for further replies.
Apr 25, 2002
156
0
0
GB
Hi all

I have a Visual FoxPro Prg shown below .... called spoolfile.prg and i am trying to pass five varible from within a batch file.

see below:

Lparameters VariableOne, VariableTwo, VariableThree, VariableFour, VariableFive

initDir = VariableFour
set defa to (initDir)
FilesToProcess = adir(SpoolFileQty, 'SPL*.0??')

For x = 1 to FilesToProcess

cRunStr='LPR -P '+ALLTRIM(VariableOne)+' -S '+ALLTRIM(VariableTwo)+' '+VariableThree

!&RunStr

** LPR -P VariableOne -S VariableTwo VariableThree && = FileName

next


My Problem is i wish to run this PRG from within a batch file with a command line made up as follows .....


spoolfile.prg (192.9.200.16, ISC1032_:, SPL99999.001, C:\TEMPLATE, SPL99999.001 00000001 To 00000001)

where spoolfile.prg is the name of the PRG and the details within the brackets are the five variable i am trying to pass to it.

i have tried all verions and combinations of this command line from within the batch file and cannot get the variables in the PRG to show the above five details

Yet when i run this the variables are empty ... am i doing something wrong or can u not do what i am trying to do.

I am calling this from within a batch file as the this is and end processing of loads of files.


LPR is a file spooling progam used to send files across our network.

ANy help is greatly received

Yours
Roadrunner
 
Try this: Quote the variables you want to pass.

spoolfile("192.9.200.16", "ISC1032_:", "SPL99999.001", "C:\TEMPLATE", "SPL99999.001 00000001 To 00000001")
 
Hi there

Yes it is from within a dos Batch file with a .BAT
extension

Does this help at all ?

roadrunner
 
Compile spoolfile.prg as an exe.

Batch file text will be:

<<mypath>>\spoolfile &quot;192.9.200.16&quot; &quot;ISC1032_:&quot; &quot;SPL99999.001&quot; &quot;C:\TEMPLATE&quot; &quot; SPL99999.001 00000001 To 00000001&quot;
 
here i am agan

I have complied the prg to an exe with an fxp extension and it runs but the the variables in the lparameter line still show as flase or empty when i run it in set step on mode.... i have tried all ways what am i missing ??

if i run the fxp from within the foxpro command window it works fine but from within a batchfile or dos window nothing

replies please

Roadrunner
 
rdrunner40
I have complied the prg to an exe with an fxp extension

FXP extension is not an EXE file! FXP file will run under VFP IDE while EXE file run under VFP Runtime.

To build an EXE file:
Create a project, select &quot;Code&quot; tab, add your program into the project and set it as &quot;main program&quot;. Then build it as &quot;Win32 executable&quot;

If you still want to run FXP directly, you must prefix it with VFP executable itself. I assume you are using VFP7 and VFP directory is 'C:\VFP7'.
From dos-prompt (C:\>) type in:
C:\VFP7\VFP7.exe spoolfile.fxp &quot;192.9.200.16&quot; &quot;ISC1032_:&quot; &quot;SPL99999.001&quot; &quot;C:\TEMPLATE&quot; &quot;SPL99999.001 00000001 To 00000001&quot;


-- AirCon --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top