Dear Vixens and Reynards:
I have a new program that has had a bug reported on it that a
table was not getting closed. I have a routine that runs after most
menu choices that checks that no tables are still open and reports if any are.
OK, maybe I missed it. No, there is code in the exit method
that closes the table. Maybe, there is an error in the test. Insert
a set step on. The method never gets executed! I have used this way
for years for other forms, but in this form, the exit method just
does not get executed.
I have scanned the source code for odd characters. There are none.
What might I be overlooking?
Sincerely,
Gene Wirchenko
_______________________________________________
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/
** 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.
If the method has a subclass, *anything* in the subclassed method will
cause the superclasses code not to run. I often find I've left a
whitespace character -- tab, space or carriage return -- in the
subclass. Ctrl-A, Ctrl-X clears them out.
As an alternative, add:
SET STEP ON
DODEFAULT
to the subclass and see if *that* executes.
On Wed, Mar 2, 2016 at 3:55 PM, Gene Wirchenko <genew@telus.net> wrote:
> Dear Vixens and Reynards:
>
> I have a new program that has had a bug reported on it that a table was
> not getting closed. I have a routine that runs after most menu choices that
> checks that no tables are still open and reports if any are.
>
> OK, maybe I missed it. No, there is code in the exit method that
> closes the table. Maybe, there is an error in the test. Insert a set step
> on. The method never gets executed! I have used this way for years for
> other forms, but in this form, the exit method just does not get executed.
>
> I have scanned the source code for odd characters. There are none.
>
> What might I be overlooking?
>
> Sincerely,
>
> Gene Wirchenko
>
>
[excessive quoting removed by server]
_______________________________________________
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/CACW6n4vMvj2HB04yh2_pFWYfzivTZtnvf9cDb=2-6LenEmf3bA@mail.gmail.com
** 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.
> OK, maybe I missed it. No, there is code in the exit method
> that closes the table. Maybe, there is an error in the
> test. Insert a set step on. The method never gets executed! I
> have used this way for years for other forms, but in this form, the
> exit method just does not get executed.
>
> I have scanned the source code for odd characters. There are none.
1. Copy the code out of the method to a plain text file. Delete all
leading and trailing spaces. Save the file as plain text and close
the file. Then, in the Properties window, right-click the method and
choose "Reset to default". Then open the text file, copy the code
from it, and paste it back into the method. That usually works for
me, but if it doesn't:
2. A.
If it's a program class, delete the .fxp files related to it and its
superclasses and recompile them.
2. B.
If it's an .scx or a .vcx class, BACK UP the file and delete the
contents of the Objcode field in the subclass, and recompile the object.
Ken Dibble
www.stic-cil.org
_______________________________________________
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/35.AA.02097.A0757D65@cdptpa-oedge03
** 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.
At 13:10 2016-03-02, Ted Roche <tedroche@gmail.com> wrote:
>If the method has a subclass, *anything* in the subclassed method will
>cause the superclasses code not to run. I often find I've left a
>whitespace character -- tab, space or carriage return -- in the
>subclass. Ctrl-A, Ctrl-X clears them out.
Ah, no. I have subclassed. The subclass code is not
running. It does in other forms.
>As an alternative, add:
>
>SET STEP ON
>DODEFAULT
>
>to the subclass and see if *that* executes.
I have added set step on to the subclass code, and it does not
get executed.
[snip]
Sincerely,
Gene Wirchenko
_______________________________________________
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/
** 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.
At 13:10 2016-03-02, Ken Dibble <krdibble@stny.rr.com> wrote:
>> OK, maybe I missed it. No, there is code in the exit method
>> that closes the table. Maybe, there is an error in the
>> test. Insert a set step on. The method never gets executed! I
>> have used this way for years for other forms, but in this form,
>> the exit method just does not get executed.
>>
>> I have scanned the source code for odd characters. There are none.
>
>1. Copy the code out of the method to a plain text file. Delete all
>leading and trailing spaces. Save the file as plain text and close
>the file. Then, in the Properties window, right-click the method and
>choose "Reset to default". Then open the text file, copy the code
>from it, and paste it back into the method. That usually works for
>me, but if it doesn't:
All of my code is in .prg files. I have verified that the code
has no odd characters in it.
>2. A.
>
>If it's a program class, delete the .fxp files related to it and its
>superclasses and recompile them.
Having been bit when VFP was not so good at keeping track of
when to recompile, I do recompile. That is not it.
>2. B.
>
>If it's an .scx or a .vcx class, BACK UP the file and delete the
>contents of the Objcode field in the subclass, and recompile the object.
Nope. It is a .prg.
This approach has been working for years. It is very puzzling
that the subclass code is not running. And because it is not
running, I have nowhere to attach a set step on to. Except possibly
the parent class to see if those methods are executing, but that
still will not tell what is going on. Very puzzling.
Sincerely,
Gene Wirchenko
_______________________________________________
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/
** 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.
Check you are actually pointing to the code (.prg) location that you think you are in code!!
Many times I have found VFP picking up programs of the same name in different locations because my set path was screwed.
Dave
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gene Wirchenko
Sent: 03 March 2016 06:54
To: ProFox Email List <profox@leafe.com>
Subject: Re: Subclassed Methods Not Getting Executed
At 13:10 2016-03-02, Ken Dibble <krdibble@stny.rr.com> wrote:
>> OK, maybe I missed it. No, there is code in the exit method that
>> closes the table. Maybe, there is an error in the test. Insert a
>> set step on. The method never gets executed! I have used this way
>> for years for other forms, but in this form, the exit method just
>> does not get executed.
>>
>> I have scanned the source code for odd characters. There are none.
>
>1. Copy the code out of the method to a plain text file. Delete all
>leading and trailing spaces. Save the file as plain text and close the
>file. Then, in the Properties window, right-click the method and choose
>"Reset to default". Then open the text file, copy the code from it, and
>paste it back into the method. That usually works for me, but if it
>doesn't:
All of my code is in .prg files. I have verified that the code has no odd characters in it.
>2. A.
>
>If it's a program class, delete the .fxp files related to it and its
>superclasses and recompile them.
Having been bit when VFP was not so good at keeping track of when to recompile, I do recompile. That is not it.
>2. B.
>
>If it's an .scx or a .vcx class, BACK UP the file and delete the
>contents of the Objcode field in the subclass, and recompile the object.
Nope. It is a .prg.
This approach has been working for years. It is very puzzling that the subclass code is not running. And because it is not running, I have nowhere to attach a set step on to. Except possibly the parent class to see if those methods are executing, but that still will not tell what is going on. Very puzzling.
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]
_______________________________________________
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/18725B8CD2D5D247873A2BAF401D4AB28528C914@EX2010-A-FPL.FPL.LOCAL
** 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.
I'm sorry, this is Visual FoxPro and I *assumed* through lack of
evidence to the contrary, that you were using *Visual* classes. It was
a poor assumption, since I have followed your postings here for a
decade or two, and now I recall you're a PRG-class guy, but keeping
track of how everyone here chooses to code, which frameworks they use
(or insist they don't need) is a bit tiresome.
I could ask nineteen more questions, but...
The fact that you included "subclassed" in your title indicates you
feel that is important. I should be able to read between the lines and
interpret why you emphasize that.
Visual classes was my first guess.
My second would be that "the code that isn't running" is inside of a
container, and it was the entire *container* that was subclassed and
not just the object whose code isn't running. Drew Speedie wrote up an
excellent article nearly 20 years ago on the problems with subclassing
containers, which Steven Black references here:
http://stevenblack.com/articles/managing-vfp-class-libraries/
I'm not having luck finding the original article online. Drew also
included it in the notes in his Visual Maxframe framework, and may
have published it as speaker notes from a conference or two.
If this sounds like it might be applicable, and you can't find the
article, contact me off-list and I'll help you find one.
If not, I've got eighteen more guesses...
On Thu, Mar 3, 2016 at 1:49 AM, Gene Wirchenko <genew@telus.net> wrote:
>
> Ah, no. I have subclassed. The subclass code is not running. It does
> in other forms.
>
It does in other forms when it is subclassed, or the code runs in
other forms, but doesn't run when it is subclassed?
Oh, darn! Now I'm down to seventeen questions!
_______________________________________________
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/CACW6n4t0kZ1n-6EGE3FRSeTh--KsAgWWDZ=V=oAO9g3QiGR14g@mail.gmail.com
** 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.
At 04:26 2016-03-03, Dave Crozier <DaveC@Flexipol.co.uk> wrote:
>Check you are actually pointing to the code (.prg) location that you
>think you are in code!!
>
>Many times I have found VFP picking up programs of the same name in
>different locations because my set path was screwed.
I ended up finding the cause of the problem. It was not path
at all, but it was related.
In frustration and to try to find the extent of the problem, I
started instrumenting every method in the subclass. I got most of
the way through when I came across a second method called actexit().
The compiler does not throw an error if you have two methods of
the same name in a class. (It should.) Whenever I searched for the
method, I found the first one. When there are two methods of the
same name, VFP executes the second.
[snip]
Sincerely,
Gene Wirchenko
_______________________________________________
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/
** 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.
On Mon, Mar 7, 2016 at 1:14 PM, Gene Wirchenko <genew@telus.net> wrote:
>
> The compiler does not throw an error if you have two methods of the
> same name in a class. (It should.) Whenever I searched for the method, I
> found the first one. When there are two methods of the same name, VFP
> executes the second.
>
When there are two methods (functions) of the same name in a program
or procedure file, the last is executed, too. That may or may not be a
bug, or a neat feature you can exploit using conditional INCLUDES. I
lean towards the former.
--
Ted Roche
Ted Roche & Associates, LLC
_______________________________________________
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/CACW6n4t05RSRT3ykBW-_DVq63XF0HVHQBcJux+dRPjf_PjkChg@mail.gmail.com
** 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.