Hello:
I am using VFP 9, but this may apply to many versions.
I am testing a new printing subsystem. This will require testing each report with a valid configuration and an invalid configuration. I wrote a short, standalone program that tweaks the configuration either way. It is run with <vfp> do tmpprint with <number> </vfp>
I also wanted to check the parameters. If I do not specify a parameter, that is an error and one easily caught with pcount().
However, if there are more parameters than expected, an error 94 (Must specify additional parameters.) is thrown on the lparameters statement. How do I catch this error considering that nothing gets executed before the lparameters statement is looked at?
It gets odder. Supposedly lparameters takes up to 26 parameters. I am now up to 40, and they all get assigned their specified values. Specifying a 41st parameter in the invocation throws an error 94. Where does it end?
Sincerely,
Gene Wirchenko
Gene, Am I missing something here or couldn't you pass a Parameter Object in which all your parameters become properties? This would allow you a limitless number of parameters and also be interface independent.
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gene Wirchenko Sent: 22 November 2016 18:34 To: ProFox Email List profox@leafe.com Subject: Dealing with Extraneous Parameters
Hello:
I am using VFP 9, but this may apply to many versions.
I am testing a new printing subsystem. This will require testing each report with a valid configuration and an invalid configuration. I wrote a short, standalone program that tweaks the configuration either way. It is run with <vfp> do tmpprint with <number> </vfp>
I also wanted to check the parameters. If I do not specify a parameter, that is an error and one easily caught with pcount().
However, if there are more parameters than expected, an error 94 (Must specify additional parameters.) is thrown on the lparameters statement. How do I catch this error considering that nothing gets executed before the lparameters statement is looked at?
It gets odder. Supposedly lparameters takes up to 26 parameters. I am now up to 40, and they all get assigned their specified values. Specifying a 41st parameter in the invocation throws an error 94. Where does it end?
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]
On 23/11/2016 08:34, Dave Crozier wrote:
Gene, Am I missing something here or couldn't you pass a Parameter Object in which all your parameters become properties? This would allow you a limitless number of parameters and also be interface independent.
Dave
I do the same with say a print/mailing object:
Private oPrint oPrint = CREATEOBJECT('custom') DO setoprint
oPrint.e_tolist = 'someemail@somewhere.com' etc..
* Call some program where oPrint will be visible and you don't have to pass any parameters. E.g. sendemail()
FUNCTION setoPrint oPrint.addproperty('cOption','') && P=Print E=Email V=View D=PDF G=Prog X=excel T=Text oPrint.addproperty('p_printer','') oPrint.addproperty('p_orient',0) oPrint.addproperty('p_location','') oPrint.addproperty('p_copies',1) oPrint.addproperty('e_tolist','') oPrint.addproperty('e_cclist','') oPrint.addproperty('e_bcclist','') oPrint.addproperty('e_subject','') oPrint.addproperty('e_body','') oPrint.addproperty('e_attach','') etc....
This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
www.whisperingsmith.com
Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715
London Office:17-19 Foley Street, London W1W 6DW Tel:0207 299 7960
+1
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Peter Cushing Sent: 23 November 2016 08:53 To: profoxtech@leafe.com Subject: Re: Dealing with Extraneous Parameters
On 23/11/2016 08:34, Dave Crozier wrote:
Gene, Am I missing something here or couldn't you pass a Parameter Object in
which all your parameters become properties? This would allow you a limitless number of parameters and also be interface independent.
Dave
I do the same with say a print/mailing object:
Private oPrint oPrint = CREATEOBJECT('custom') DO setoprint
oPrint.e_tolist = 'someemail@somewhere.com' etc..
- Call some program where oPrint will be visible and you don't have to
pass
any parameters. E.g. sendemail()
FUNCTION setoPrint oPrint.addproperty('cOption','') && P=Print E=Email V=View D=PDF G=Prog X=excel T=Text oPrint.addproperty('p_printer','') oPrint.addproperty('p_orient',0) oPrint.addproperty('p_location','') oPrint.addproperty('p_copies',1) oPrint.addproperty('e_tolist','') oPrint.addproperty('e_cclist','') oPrint.addproperty('e_bcclist','') oPrint.addproperty('e_subject','') oPrint.addproperty('e_body','') oPrint.addproperty('e_attach','') etc....
This communication is intended for the person or organisation to whom it
is
addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If
you
have received this message in error, please notify us immediately by telephone or email.
www.whisperingsmith.com
Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715
London Office:17-19 Foley Street, London W1W 6DW Tel:0207 299 7960
[excessive quoting removed by server]