Run?

TGTech

New Member
Is there a RUN (shell) command for Progress to run or call another program?

If so, can I RUN variablename, where variablename is the shell command or .p program to run?

EXAMPLE: RUN "c:\testprog.p"

Code examples would be nice.

Thanx in advance!
 
Got manuals? Check out RUN and OS-COMMAND.

If it is another .p, use RUN.
If it is an operating system command or batch file, use OS-COMMAND

And, yes, you can

RUN VALUE(VariableName)

among many other things.
 
Got manuals? Check out RUN and OS-COMMAND.

If it is another .p, use RUN.
If it is an operating system command or batch file, use OS-COMMAND

And, yes, you can

RUN VALUE(VariableName)

among many other things.

RUN VALUE() Did not work... Any other ideas?

Here is more information:

DEF VAR lookup1 AS CHAR No-Undo.
Lookup1 = ClientPath + "\Lookups\PROG\filelookup.p(" + CHR(34) + ClientPath + "\Lookups\Plant1PictureLookup600.csv" + CHR(34) + "," + CHR(34) + "Picture" + CHR(34) + ",Cmb-CrossSection,output Brwsr-Diagram)".
RUN VALUE(Lookup1).

We tested using RUN and it worked:

RUN \\Erpserv1\Epicor\Mfgsys80\Server\ud\Production\filelookup.p("\\erpserv1\epicor\lookups\Plant1PictureLookup600.csv","Picture",Cmb-CrossSection,output Brwsr-Diagram).

It doesn't like using the variable.
 
Your first problem is mushing together the name of the procedure to run and the arguments.

I.e., the syntax is
RUN VALUE(ProgName) (parameters).
not
RUN VALUE(ProgNameAndParameterCombination).


Secondly, except in very unusual circumstances, you should be running a program relative to the PROPATH, not providing it with the full path name. In fact, it is good programming practice to use SEARCH to locate the .r or .p in order to make sure that you have a valid target before doing the RUN.

Third, I don't think I would be using the CHR(34) stuff either ... stick it in a variable name.

I am also unclear as to what pieces you are putting together. You start out with:

DEF VAR lookup1 AS CHAR No-Undo.
Lookup1 = ClientPath + "\Lookups\PROG\filelookup.p(" + CHR(34) + ClientPath + "\Lookups\Plant1PictureLookup600.csv" + CHR(34) + "," + CHR(34) + "Picture" + CHR(34) + ",Cmb-CrossSection,output Brwsr-Diagram)".

parsing this out into pieces might give:
define variable chProgName as character no-undo.
define variable chCSVSource as character no-undo.
define variable chOpType as character no-undo. /*or whatever that is */
/* Presumably Cmb-CrossSection and Brwsr-Diagram are variable that have already been defined and given values.

assign
chProgName = "\Lookups\PROG\filelookup.p"
chCSVSource = "\Lookups\Plant1PictureLookup600.csv"
chOptType = "Picture"
.
/* Add in ClientPath if you *have* to */

if search(ch_ProgName) ne ? or search(replace(ch_ProgName,".p",".r") ne ?
then do:
run value(chProgName) (
input chCSVSource,
input ch_OptType,
input Cmb-CrossSection,
output Brwsr-Diagram
).
end.
else do:
/* Handle missing program */
end.
 
Your first problem is mushing together the name of the procedure to run and the arguments.

define variable chProgName as character no-undo.
define variable chCSVSource as character no-undo.
define variable chOpType as character no-undo. /*or whatever that is */
/* Presumably Cmb-CrossSection and Brwsr-Diagram are variable that have already been defined and given values.

assign
chProgName = "\Lookups\PROG\filelookup.p"
chCSVSource = "\Lookups\Plant1PictureLookup600.csv"
chOptType = "Picture"
.
/* Add in ClientPath if you *have* to */

if search(ch_ProgName) ne ? or search(replace(ch_ProgName,".p",".r") ne ?
then do:
run value(chProgName) (
input chCSVSource,
input ch_OptType,
input Cmb-CrossSection,
output Brwsr-Diagram
).
end.
else do:
/* Handle missing program */
end.


Thank you very much. This worked perfectly!

No, we (perhaps all too obviously) do not have a command reference manual but are looking for one. Any ideas? We are working with 'freeform expressions' in a built-in (proprietary) 4gl programming environment and context-sensitive help is unavailable.

This forum has proven invaluable in providing assistance until we can get proper reference material.

Your criticisms are as welcomed as your code examples. We have programming experience, just not in Progress. This helps...

Thanx again!!
 
Back
Top