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 00:01:05
 
 
À
16/07/2009 15:36:50
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:
01412894
Vues:
158
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.
>
>>What's inelegant about MyProp = "1.00"? It does exactly what it says. It's a string...
>>
>>+++ Rick ---
>>
>>>>>Can someone refresh my memory:
>>>>>
>>>>>I have a class property, I want to put in "1.00" (i.e. a string) as its value. If I type in 1.00, it's set to be a numeric. How would I enter the string "1.00" in this case?
>>>>
>>>>
>>>>="1.00"
>>>>
>>>Thanks - that works, I (re-)discovered that about the same time Naomi pointed it out. As I remarked to Naomi, I was hoping for something a little more elegant.
Jim Nelson
Newbury Park, CA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform