Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to run programs from sub directory
Message
From
11/08/2003 11:41:02
 
 
To
11/08/2003 11:19:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00818920
Message ID:
00818935
Views:
16
>I am creating a new application and I'd like to organize my programs, forms and reports into folders in the main application directory, example f:\foxapp\programs, f:\foxapp\reports, f:\foxapp\forms, etc. All of these files are included in the project. The problem I'm experiencing is that unless I use the entire path when I call the program, it can't be found. I've included a function in my mainmenu program that I can pass parameters to which creates a variable with the program and path...
>
>* FUNCTION: doprg
>* g_programs is a global variable that holds the drive/path
>Function DoPrg
>Parameters uprg1,uprg2
>Private lcStr
>DO case
> Case Type('uprg1')='C' and Type('uprg2')='C'
> lcStr = g_programs + Alltrim(uPrg2)
> DO &uPrg1 in &lcStr
> Case Type('uprg1')='C' and Type('uprg2')#'C'
> lcStr = g_programs + Alltrim(uPrg1)
> DO &lcStr
>EndCase
>Return
>
>This works, but now I'm concerned about processing speed. Is this approach going to really slow down the application once its compiled? I really don't want to hard code the directory name into the code.
>
>Any help will be greatly appreciated,
>Larry Morelli
>Royal Oak, Michigan
>(248) 640-7114

Larry,

Why not just set procedure to in the beginning of the main ? (you do not need set Path if all of them are declared as below)
set procedure to (addbs(g_programs) + 'ProcedureFile1') additive
set procedure to (addbs(g_programs) + 'ProcedureFile2') additive
set procedure to (addbs(g_programs) + 'ProcedureFile3') additive...
...
set procedure to (addbs(g_programs) + 'ProcedureFilen') additive
Also possible is to take an adir of g_programs (*.fxp) and do the above in a loop
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform