Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More on Data Type Invalid?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00799084
Message ID:
00800059
Views:
23
>Okay, I've been upgrading everything to vfp8, and moving troublesome Captions to get rid of the pesky "Data Type Invalid" error received when opening forms. I also found other properties assigned with an "=(etc)" get the same error, so I've tried to fix all these, too.
>
>However, I still have some forms that are getting 15 or 20 of the messages before I can open the form. Is there some other situation that causes this error, maybe I need to modify?

Just to put a "closure" on this, as I've been working much of the day and have almost fixed everything. And in case it may help anyone else, I have solved this issue now.

Open any problem forms as tables, then:

1) First, run:
SCAN
  IF 'CAPTION' $ UPPER(Properties) && Properties is the memo column where all the problems are located
    MODI MEMO Properties  && check each memo
  ENDIF
ENDSCAN
Make a note of any Properties memos with a caption assigned with =(condition), =IIF(condition), etc. pretty much anything contained in parens needs to be moved to methods, as we know, and usually an Init will do fine. Then try reopening the form again, see if all is well.

2) If not, run the SCAN again, but without the IF 'Caption' condition. Either just use "MODI MEMO Properties" to browse every memo, or you can try a condition that just looks for *one* paren, that works too, but also picks up a lot of garbage that doesn't need fixing. But try that, it may be a little easier than scanning every Properties memo. This 2nd pass can be slightly time-consuming in a large form, but I think there is no magic bullet to be found.

(This 2nd pass may be required because the remainder of the problems can be in numerous object properties, like BackColor, Visible, MouseMove, UDPs - almost anyplace. But you are searching, again, for the same code situations as with the Captions above.)

These non-caption properties may need different relocations than Inits, depending on what they do, and what they rely on beforehand, of course. That was a tricky part for some of them, figuring out when the moved property conditions need to be available, and which methods to move them to.

All this is not difficult work, it's just a little tedious, for large forms that have 25 or 50 of these "Data Type Invalid" messages, when opening the forms in the vfp8 designer. And in a large app with 100+ forms, it does try one's patience a little. But it only needs the fix once, and hopefully never again...

Any easier ideas, and please jump in with them.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Reply
Map
View

Click here to load this message in the networking platform