Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Am I the only one who thinks this is useful?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00790732
Message ID:
00790838
Vues:
21
Hi Victor

I agree this is not for data validation but to display the data in more user friendly ways. The idea of OnDataChanged is to convert the data back to its standard format so that normal validation can be done on the Value property. That is why I would suggest this method be called just prior to the Valid method so everything is handled normally. All I am suggesting is that the process of loading the value to be displayed be opened up for programmer customization.

Simon

>I understand where yer coming from here, and I can see why such a thing would be handy...but...
>At the same time it seems like these types of data-validation things would find a better home in sometype of global biz-object or global data-validation. The rest of it seems like formating the input....still would be kinda useful though if it was built properly by the VFP team...heh...
>
>>I have long thought that VFP needed a way to morph the displayed data. I think every data bound control needs a DisplayValue and a Value property. There should be two new methods OnDataLoad and OnDataChanged. The value returned from the OnDataLoad would be used to set the DisplayValue property. The DisplayValue property would determine what was displayed instead of the value property.
>>
>>The user could put custom code in the OnDataLoad method so that the display value could be different from the Value. For example you could format Date values to look like "Mon Sep 15, 2000". You could use this to show friendly names for product code, lookup ID numbers, or to decrypt data etc.
>>
>>The OnDataChanged would be called just before the Valid event and it would convert the DisplayValue back to the form it should have when stored in the table. The value returned from the OnDataChanged would be used to set the Value property.
>>
>>Since the default of the above methods would be to use the Value property all existing code would work as expected but you would gain the ability to morph data in an infinite number of ways while maintaining VFP data binding.
>>
>>In case anybody is wondering I discovered that such a scheme is currently part of dB2k (formally known as Visual dBase).
>>
>>I put a similar suggestion in the Wish List a year ago but received no comments so I wanted to know if anyone but me thought this would be a good idea.
>>
>>Simon
Simon White
dCipher Computing
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform