Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to add numeric string as property value?
Message
De
17/07/2009 02:38:51
 
 
À
17/07/2009 00:01:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Divers
Thread ID:
01412603
Message ID:
01412909
Vues:
73
This whole thread started basically because of an edge case, me trying to enter a numeric character string as a property value - something I do so seldom I temporarily forgot how.

My remarks that followed about elegance etc. were part of my broad belief that edge cases are useful for pointing out inconsistencies and other problems. Just like VFP is an edge case that can find bugs in video and printer drivers, and how a single "Except for..." when spec'ing a business app with a client can cause a major change to the underlying DB.

It's great that the CodePlex PEM Editor could potentially be modified to work the "Al" way ( g ) but I'm not going to do it - I can live with the behaviour of the stock VFP one.

>Al --
>
>PEM Editor, as referred to in other messages, attempts to show values the same way that they appear in the Property Window; thus, character strings appear without the quotes. Making them appear with quotes would be a quite simple modification.
>
>However -- when you enter values in PEM Editor (as in Property Window), note that you enter character strings without the quotes as well. (In fact, it takes some gymnastics to interpret values entered to get them to the correct data type.)
>
>So, if you were to prefer the consistency you express interest in, you would need to enter values as if they were to occur on the right side of the equal sign --meaning all your character string would need to be enclosed in quotes. This would actually simplify what PEM Editor needs to do internally. However, for me at least, changing the way I entered character strings would be a hard lesson to learn.
>
>Jim
>
>
>>As I said earlier to Naomi, I was hoping there was an Excel-like feature in VFP i.e. if you type a single quote character ' before entering a number, that instructs Excel to treat it as a string.
>>
>>But, that opens up another can of worms. The VFP property sheet shows strings without delimiters (e.g. quotes). For consistency, it would have to show all strings with delimiters:
>>
>>MyProp = "This is a string" -> appears as: This is a string
>>MyProp = 1.00 -> appears as: 1.00
>>MyProp = "1.00" -> appears as: ="1.00"
>>
>>The behaviour would need to change to:
>>
>>MyProp = "This is a string" -> appears as: "This is a string"
>>MyProp = 1.00 -> appears as: 1.00
>>MyProp = "1.00" -> appears as: "1.00"
>>
>>IMO the second set of behaviours is more consistent/elegant.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform