Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Local lo
? CreateParameterObject()
lo = CreateParameterObject("iX;iY")
? lo.iX, lo.iY
lo = CreateParameterObject("iX;iY","I;I")
? lo.iX, lo.iY
lo = CreateParameterObject("iX;iY","I;I","20;100")
? lo.iX, lo.iY
lo = CreateParameterObject("cFirstname;cLastname;dBirthdate","C;C;D","Olaf;Doschke;{^1968-12-28}")
? lo.cFirstname, lo.cLastname, lo.dBirthdate
lo = CreateParameterObject("iMembers;cType","I;E","AMembers(laDummy,loObject);Type('loObject.cType')")
? lo.iMembers, lo.cType
Function CreateParameterObject()
Lparameters tcProperties, tcTypes, tcValues
Local loObject
loObject = Createobject("empty")
Local lnCount, lnCounter
Local Array laProperties[1], laTypes[1], laValues[1]
Do Case
Case Pcount() = 0
loObject =.Null.
Case Pcount() = 1
* just add properties and leave them uninitialised
For lnCount = 1 To Alines(laProperties,tcProperties,2,";")
AddProperty(loObject,laProperties[lnCount])
Endfor
Case Pcount() = 2
* add properties with default values in their variable type
lnCounter = Alines(laProperties,tcProperties,2,";")
If Alines(laTypes,tcTypes,0,";") # lnCounter
loObject =.Null.
Else
For lnCount = 1 To lnCounter
lcType = laTypes[lnCount]
AddProperty(loObject;
,laProperties[lnCount];
,Icase(lcType="C","";
,lcType="I",0;
,lcType="N",0.0;
,lcType="D",{};
,lcType="Y",$0.0;
,lcType="L",.F.;
,lcType="T",{};
,.Null.;
);
)
Endfor
Endif
Case Pcount() = 3
* add properties with passed in values in their variable type
lnCounter = Alines(laProperties,tcProperties,2,";")
If Alines(laTypes ,tcTypes ,0,";") # lnCounter Or;
ALines(laValues,tcValues,0,";") # lnCounter
loObject =.Null.
Else
For lnCount = 1 To lnCounter
lcType = laTypes[lnCount]
lcValue = laValues[lnCount]
AddProperty(loObject;
,laProperties[lnCount];
,Iif(lcType="C",lcValue,Evaluate(lcValue));
)
Endfor
Endif
Endcase
Return loObject
Endfunc