Home > Archive > Getting Started with dBASE > March 2006 > Unwanted custom form linkages









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Unwanted custom form linkages
Pieter van Heerden

2006-03-07, 9:23 am

I work on different dBase applications - all my own - in different directories. Everything I do is based on the dBase Tutorial, plus of course further development. I use the custom dmd and custom forms as developed a la Tutorial for all my applications,
and copies of these custom forms are to be found in all the directories that I work on. Minor changes are made to the custom forms for each application, such as its own form text or icon file or whatever.

A very annoying problem which surfaces from time to time, is that if I move from one application to the other and try to get it running, usually from within dBase itself, I get error messages to the effect that some file or other is not found. Opening th
e code from the error message via the "Fix" pushbutton, I find that the custom form underlying the form I want to run is not the correct custom form in the application's own directory, but a custom form located in another directory, usually the previous d
irectory I have worked in. Nowhere in the viisible code is there a path description that directs the application to the wrong directory from which the wrong custom form is picked up. Giving the custom forms unique names does not solve this problemn eith
er, the wrong custom form picked up might not even have its name (reference) written in the code of the form being opened!

It seems as if the problem can be solved by opening the "correct" custom forms and making some insignificant change that forces a recompile.

What could be the cause of this problem?


Ronnie MacGregor

2006-03-07, 9:23 am


On Tue, 07 Mar 2006 09:42:49 -0500
Pieter van Heerden said :

> A very annoying problem which surfaces from time to time, is that if I move
> from one application to the other and try to get it running, usually from
> within dBase itself, I get error messages to the effect that some file or
> other is not found. Opening the code from the error message via the "Fix"
> pushbutton, I find that the custom form underlying the form I want to run
> is not the correct custom form in the application's own directory, but a
> custom form located in another directory, usually the previous directory
> I have worked in. Nowhere in the viisible code is there a path description
> that directs the application to the wrong directory from which the wrong
> custom form is picked up. Giving the custom forms unique names does not
> solve this problemn either, the wrong custom form picked up might not even
> have its name (reference) written in the code of the form being opened!
>
> It seems as if the problem can be solved by opening the "correct" custom
> forms and making some insignificant change that forces a recompile.
>
> What could be the cause of this problem?


You have said that you rename the form (file name) but have you renamed the
classname in that file ? From what you have said I suspect perhaps not.

What you are seeing is that a class of a given name has been opened, and is
still in memory. Your code calls for that classname again, and dBASE looks in
memory for it first, and only if it is not there will it go looking for a disk
file.

In addition it is better to avoid long classnames where the first x characters
are the same. It seems that dBASE only pays attention to the first so many
characters of a classname so that there is a risk in this scenario that
although the classname looks different to you, it looks the same to dbase. This
can produce some "interesting" results <g>.

Hope this helps.

--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk



Ken Mayer [dBVIPS]

2006-03-07, 8:23 pm

Pieter van Heerden wrote:
> I work on different dBase applications - all my own - in different directories. Everything I do is based on the dBase Tutorial, plus of course further development. I use the custom dmd and custom forms as developed a la Tutorial for all my application

s, and copies of these custom forms are to be found in all the directories that I work on. Minor changes are made to the custom forms for each application, such as its own form text or icon file or whatever.
>
> A very annoying problem which surfaces from time to time, is that if I move from one application to the other and try to get it running, usually from within dBase itself, I get error messages to the effect that some file or other is not found. Opening

the code from the error message via the "Fix" pushbutton, I find that the custom form underlying the form I want to run is not the correct custom form in the application's own directory, but a custom form located in another directory, usually the previous
directory I have worked in. Nowhere in the viisible code is there a path description that directs the application to the wrong directory from which the wrong custom form is picked up. Giving the custom forms unique names does not solve this problemn ei
ther, the wrong custom form picked up might not even have its name (reference) written in the code of the form being opened!
>
> It seems as if the problem can be solved by opening the "correct" custom forms and making some insignificant change that forces a recompile.
>
> What could be the cause of this problem?


If I understand this, what is happening is that you have different
copies of custom forms and classes -- but you're using the same names.

If you work with one of these, it remains in memory until you exit dBASE
or do a CLEAR MEMORY and all that. And even then sometimes pointers to
objects stay in memory when developing.

The simplest solution if you are not renaming the objects from
application to application, is to quit dBASE and restart it. That clears
everything out ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com