PxPlus User Forum
Main Board => Discussions => Programming => Topic started by: Thomas Bock on December 22, 2021, 09:47:34 AM
-
I'm looking for a way to pass one or more composite string(s) to an extended command.
Something like:
-}dim rec$:iol(1)
-}read record (1,key="abc")rec$
-}extCmd rec$
-
You should be able to use a ENTER directive without any parameters to change the internal CALL to your extended command into a PERFORM then use another ENTER to get to name of the variable:
Something like this:
-:list
0010 ENTER
0020 LOCAL _val$
0030 ENTER _val$
0040 LET _val$=STP(_val$,2) ! Remove any leading/trailing spaces
0050 PRINT _val$,"=",EVS("STR("+_val$+")")
-:save
C:\pvxsrc\_cmd\abc
->mike$="I am here"
->abc mike$
mike$=I am here
-
Mike,
Two ENTERs? Nice! I never thought of that.
Here is what I use finally:
ENTER
LOCAL param$,cmd$,var$
ENTER param$
LET param$=STP(param$,2)
LET cmd$="dim var$:iol("+param$+")"
EXECUTE cmd$
LET var$=VIS(param$)
PRINT LST(IOL(var$))
PRINT SUB(var$,SEP,"~")
END
-
Yes, an ENTER with no parameters included at the start of a called program effectively converts the CALL into a PERFORM.