Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add numeric string as property value?
Message
From
23/07/2009 03:54:15
 
 
To
19/07/2009 01:56:20
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Miscellaneous
Thread ID:
01412603
Message ID:
01413902
Views:
218
>I think that's where we disagree; you seem to think values should display the way they do as the result of a ? in the Command Window.

Well, that's how it is now (with exceptions). I think you can't make it work like excel. You could use _memberdata or some new property to store side infos like the type, but as others said, it's not that easy for a PEM editor of a weak typed language.

For example, what if you change from 1.0 (numeric) to 1.0 inch? And then back to 1.0? Will it then automatically change to string (yes, I assume so), but will it revert to numeric just because you remove inch? Should it revert?

What you could do is enforce =, but change the PEM editor so, that it does not display =, but adds it anyway. This way anything you type in the PEM editor would be set this way at runtime. But this introduces other problems:

Eg setup a property with =datetime(), then sublass the class having that property setting. Then instanciate the base class, wait a few secs and instanciate the subclass: The evaluation of Datetime() will be done only, when the base class is instanciated, the subclass will "inherit" that time, even if instanciated a few seconds later. Go back to the class designer and then change that property to not inherit =Datetime(), but set it to =Datetime() on this class level explicitly, eg by [RETURN] within that property, the value will then be shown bold.

That's in fact not a PEM editor problem, but the way VFP handles loading classes into memory and instantiating them. It's perfectly okay that way, as you can choose to inherit such a value or explictly set it at that class level.

But it shows what kind of things you need to be aware of and account for, when changing the PEM editor.

All in all I understand your idea of making it more in line with the debuggers Locals window. And I now think it's okay. I still find the Locals window less easy to use than the native or VFPX PEM editor. It lacks the =expression syntax and coloring, showing read only properties italic etc. Of course these features could be combined. Still have a feeling you'll only exchange some problems with other problems.

Bye, Olaf.
Previous
Reply
Map
View

Click here to load this message in the networking platform