I have been dragged out of retirement to write a simple accounts package for a local charity and am realising how much I have forgotten.
The main data entry screen has the usual clutch of controls - a grid, textboxes, combos, etc. All the controls are on the form and as I set each one up I run the app to check for bugs and typos. I am starting to get some odd behaviour, I have an option group with 2 options. The Interactive Change method has some code which sets the active page of a pageframe as shown below:
ThisForm.pgfIncExp.ActivePage = This.Value ThisForm.Refresh
It has been working fine for a couple of days but suddenly if I select Option 2 from Option 1 I get an error message which says that ThisForm.Refresh is not a recognised command but selecting the other way, which runs the same code, doesn't give an error. I have started saving a copy of the form after each successful run and find if I replace the SCX and SCT files with the earlier version the problem goes away for a while then reappears.
Has anyone come across anything similar?
John
John Weller 01380 723235 07976 393631
John, Just try and use RaiseEvent(Thisform, "Refresh")
I know it shouldn't cause any problem but it will allow you to trace into it.
Sure you haven't got any form subclassing code somewhere?
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of John Weller Sent: 13 October 2017 12:23 To: profox@leafe.com Subject: Odd Behaviour
I have been dragged out of retirement to write a simple accounts package for a local charity and am realising how much I have forgotten.
The main data entry screen has the usual clutch of controls - a grid, textboxes, combos, etc. All the controls are on the form and as I set each one up I run the app to check for bugs and typos. I am starting to get some odd behaviour, I have an option group with 2 options. The Interactive Change method has some code which sets the active page of a pageframe as shown below:
ThisForm.pgfIncExp.ActivePage = This.Value ThisForm.Refresh
It has been working fine for a couple of days but suddenly if I select Option 2 from Option 1 I get an error message which says that ThisForm.Refresh is not a recognised command but selecting the other way, which runs the same code, doesn't give an error. I have started saving a copy of the form after each successful run and find if I replace the SCX and SCT files with the earlier version the problem goes away for a while then reappears.
Has anyone come across anything similar?
John
John Weller 01380 723235 07976 393631
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. 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.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
_______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/001c01d34415$8fc2b2e0$af4818a0$@johnw... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Thanks Dave. I've replaced the line with RaiseEvent(Thisform, "Refresh") and it works fine. I just need to wait for it to fail again :-) I'd not heard of RaiseEvent before, what can I expect to happen when it fails again?
I'm certain I haven't any subclassing although all my controls are subclasses of the originals but there is very little further code needed. The form has 2 methods to enable and disable all the controls on the form but I have been using them for years without any problem.
John
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Dave Crozier Sent: 13 October 2017 13:33 To: profoxtech@leafe.com Subject: RE: Odd Behaviour
John, Just try and use RaiseEvent(Thisform, "Refresh")
I know it shouldn't cause any problem but it will allow you to trace into
it.
Sure you haven't got any form subclassing code somewhere?
Dave
John, That implies that you have some code in the refresh event of the form as the method code is working fine (As can be shown in the RaiseEvent()). Remember that even a single space in the Refresh method effectively invalidates the standard refresh code. It is very easy to have a single space in the Refresh() method and not notice that it is there. Another way to ensure it works is to put
DoDefault() Return
as the only code in the method.
Dave
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. 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.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of John Weller Sent: 13 October 2017 14:40 To: profox@leafe.com Subject: RE: Odd Behaviour
Thanks Dave. I've replaced the line with RaiseEvent(Thisform, "Refresh") and it works fine. I just need to wait for it to fail again :-) I'd not heard of RaiseEvent before, what can I expect to happen when it fails again?
I'm certain I haven't any subclassing although all my controls are subclasses of the originals but there is very little further code needed. The form has 2 methods to enable and disable all the controls on the form but I have been using them for years without any problem.
John
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Dave Crozier Sent: 13 October 2017 13:33 To: profoxtech@leafe.com Subject: RE: Odd Behaviour
John, Just try and use RaiseEvent(Thisform, "Refresh")
I know it shouldn't cause any problem but it will allow you to trace into
it.
Sure you haven't got any form subclassing code somewhere?
Dave
_______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/002301d34428$c901df00$5b059d00$@johnw... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Thanks Dave, I've done as you suggested. There was nothing there, not even a space.
John
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Dave Crozier Sent: 13 October 2017 15:01 To: profoxtech@leafe.com Subject: RE: Odd Behaviour
John, That implies that you have some code in the refresh event of the form as
the
method code is working fine (As can be shown in the RaiseEvent()). Remember that even a single space in the Refresh method effectively invalidates the standard refresh code. It is very easy to have a single
space in
the Refresh() method and not notice that it is there. Another way to
ensure
it works is to put
DoDefault() Return
as the only code in the method.
Dave
John,
Another way to handle this would be code in two places. First no code here. Set the ControlSource to the ActivePage property. Then in any control on the pages, add code to the UIENABLE event, when lEnable is true, THIS.Parent.Refresh()
We actually added to the PageFrame subclass, during the INIT, it adds a hidden control to each page. This control has that code in it.
Just another way to do it.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of John Weller Sent: Friday, October 13, 2017 9:40 AM To: profoxtech@leafe.com Subject: RE: Odd Behaviour
Thanks Dave. I've replaced the line with RaiseEvent(Thisform, "Refresh") and it works fine. I just need to wait for it to fail again :-) I'd not heard of RaiseEvent before, what can I expect to happen when it fails again?
I'm certain I haven't any subclassing although all my controls are subclasses of the originals but there is very little further code needed. The form has 2 methods to enable and disable all the controls on the form but I have been using them for years without any problem.
John
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Dave Crozier Sent: 13 October 2017 13:33 To: profoxtech@leafe.com Subject: RE: Odd Behaviour
John, Just try and use RaiseEvent(Thisform, "Refresh")
I know it shouldn't cause any problem but it will allow you to trace into
it.
Sure you haven't got any form subclassing code somewhere?
Dave
[excessive quoting removed by server]
Hi Tracy,
That is getting seriously technical :-) I'll see how it goes.
John
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Tracy Pearson Sent: 13 October 2017 15:04 To: profoxtech@leafe.com Subject: RE: Odd Behaviour
John,
Another way to handle this would be code in two places. First no code here. Set the ControlSource to the ActivePage property. Then in any control on the pages, add code to the UIENABLE event, when lEnable is true, THIS.Parent.Refresh()
We actually added to the PageFrame subclass, during the INIT, it adds a hidden control to each page. This control has that code in it.
Just another way to do it.
Tracy
ThisForm.pgfIncExp.ActivePage = This.Value ThisForm.Refresh
Probably already thought of but the proper syntax of the command is:
ThisForm.Refresh()
(ie, with parentheses)
Such code would run semi-reliably without the parens in VFP 6 but less so in later versions. I have had a few instances in which bad code generates errors under some circumstances but not others, in seemingly random fashion, owing most likely to the behavior of the compiler.
Ken Dibble www.stic-cil.org