In PowerBuilder OpenWithParm, ClosewithRet, OpenSheetwithParm, Windown, WINDOWNAME.OpenUserObjectWithParm, etc., all of which stores the parameter Parameter or ReturnValue that stores the Message message object when the window operation (open or off) is performed. Message object messages have three properties to store data that these functions passed to the window (depending on the type of parameter to the window operation). According to the parameter data type according to the Parameter / ReturnValue parameter data, the value of this parameter saves the different properties of the Message object. Parameter / return ValnValue Parameter Type The correspondence of the Message object property of the Message object property is as follows: Parameter Type Message Object Properties Numeric (Numerical) Message.doubleParm PowerObject (PB object, including user-defined structure data type) Message.PowerObjectParm String (Character Strings) Message.StringParm application extracts the function from the different properties of the Message message object according to the parameter type of the OpenWithParm () and other functions, and transmits the function from the Message message object and transmits the value to the opened window. If it is transmitted in the PB, it is easy to implement.
In the calling script, you can use the following code: OpenWithParm (W-WantParm, Parmtotrans) Type in the open window W-Wantparm, type: string ls-getparm ls-getparm = message.stringparm ... If you need to pass multiple parameters, The following two methods can be used: method a sense of structural variables: LSTR-DECLAREDSTR, which contains various parameters you want to pass: Variable Name Chat type ID unsignedlong name character email character homepage character ... In the call script, use the following code: lstr-declaredstr lstr-parmtotrans lstr-parmtotrans.id = 1 lstr-paramtotrans.name = "panya" lstr-paramtotrans.email = "panya@163.net" lstr-paramtotrans.homepage = "http: //panya.163. net "... openwithparm (w_wantparm, parmtotrans) followed by an open window w-wantparm open event in obtaining structural information: lstr-declaredstr lstr-getparm integer li-getid string ls-getname string ls-getemail string ls-gethomepage lstr- getparm = message.powerobjectparm li-getid = lstr-getparm.id ls-getname = lstr-getparm.name ls-geemail = lstr-getparm.email ls-gethomepage = lstr-getparm.homepage ... wherein ame String Email String Homepage. .. Open window W- WantParm and pass multiple parameters: U-N-PA rmtostore lnv_paramtotrans lnv-paramtotrans.id = 1 lnv-paramtotrans.name = "panya" lnv-paramtotrans.email = "panya@163.net" lnv-paramtotrans.homepage = "http://pbnet.126.com" ... OpenWithParm (W-WantParm, LNV-Paramtotrans) Accessing Parameters in W-Wantparm: U-N-PARMTOSTORE LNV-GETPARAM INTEGER Li-Getid String Ls-GetName String LS-GetEmail String Ls-gethomepage LNV-GetParam = Message.PowerObjectParm li-getId = lnv-getParam.id ls-getname = lnv-getparam.name ls-gethomepage = lnv-getParam.homePage LS-GETEMAIL =