Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hep on Parameters (Problem in Implementing Parallel Fox)
Message
From
11/01/2014 02:22:18
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Hep on Parameters (Problem in Implementing Parallel Fox)
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01591703
Message ID:
01591703
Views:
77
I am trying to implement Parallel Fox in my code and encountered with some problem.

I am getting error as
Message: No PARAMETER statement is found.
Method: PROCEDURE PS2PDF F:\WIP\LEVEL-III-COMPRESSION\DATA\CONVERT.FXP
Line: 2

Here is my code inside convert.prg. Convert.prg is my Program to convert File from one Format to another. Since the conversion process is quite slow I am trying to use the power of all cores using ParallelFox.vcx.

Here is the relevant extract of convert.prg
Local Parallel as Parallel
Parallel = NewObject("Parallel", "ParallelFox.vcx")
Parallel.StartWorkers()
SCAN
iFilename=ALLTRIM(oldpath)
oFilename=ALLTRIM(Newpath)
Parallel.do("PS2PDF",'Convert.prg',,iFilename,oFilename)
ENDSCAN

PROCEDURE ps2PDF
LPARAMETERS iFilename,oFilename
** Convert ps files to PDF Using ps2PDF.Dll
DECLARE INTEGER _apCreate@0   IN ps2pdf.dll AS apCreate
DECLARE         _apClose@4    IN ps2pdf.dll AS apClose   INTEGER id
DECLARE INTEGER _apConvert@4  IN ps2pdf.dll AS apConvert INTEGER id
DECLARE INTEGER _apSetFunc@24 IN ps2pdf.dll AS apSetFunc INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2
DECLARE INTEGER _apGetFunc@24 IN ps2pdf.dll AS apGetFunc INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2
#define AP_Set_Output     3000
#define AP_Set_Input      3001
id=apCreate()
IF (id # 0)
apSetFunc(id, AP_Set_Input , 0, 0,iFilename, 0)  &&input file.
apSetFunc(id, AP_Set_Output, 0, 0,oFilename, 0) &&output format and file.
apConvert(id)
apClose(id)
ENDIF
ENDPROC
RETURN
Please Provide an appropriate solution to implement Parallel fox.
I tried help file of parallel fox, but could not comprehend it completely. Here it is. https://www.dropbox.com/s/wlel4jjqibsrio7/parallelfox.chm

Regards
Harsh
Reply
Map
View

Click here to load this message in the networking platform