PxPlus User Forum

Main Board => Discussions => Language => Topic started by: Peter.Higgins on November 27, 2020, 12:13:56 PM

Title: Object Function Dynamic Parameter Question
Post by: Peter.Higgins on November 27, 2020, 12:13:56 PM
Hello List,

I am considering a generic Object Key function that returns the padded value for any index of a file set in object instantiation without the overhead of using dictionary objects.  Thanks for the Key() tip Mike.   

There are examples of fully variable parameters here, but I could swear I've seen mixed versions that have the variable portion at the end.  I have been unable to find this in the forum or by searching the documentation. 
I guess the easy answer is directions to dynamic parameters in the documentation.

Assuming by value will work in a compiled iolist variable and the STATIC ckeyIolist$ is
ckeyIolist$=CPL("IOLIST (param1$), (param2$),(param3$),(param4$)")
this is how I think it probably could work. 

 FUNCTION KeyFmt$(KeyNo,*)KEY_FMT ! Where * is the fields of the key.
 !
 KEY_FMT:
 Pt$=STK(PROPERTIES);  IF NOT(MSK(pt$,"[Nn][Ss]+")) then EXIT 36
 ENTER (KeyNo),iol=ckeyIolist$,err=*next
 argCnt=LEN(Pt$)
 ! Format into key

Title: Re: Object Function Dynamic Parameter Question
Post by: Peter.Higgins on November 27, 2020, 06:38:34 PM
Testing has shown that this doesn't work.  Only the (*) is accepted by 2017.
I am experimenting with flexible Enter statements using arrays instead.