Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox and negative values
Message
 
À
24/07/2002 15:42:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00681860
Message ID:
00684412
Vues:
35
Steve,

>However, if you use a character field of width 2, it only uses 2 bytes, not 10.

2 bytes character - max number is "00"-"99", not counting negatives. That's only 100 entries. Using an interger, almost unlimited (ok, 2 billion and change). When I design a system, I try to keep away from limits like those. Keeps me out of trouble and the system can run for 10 years or more (which I have out there, believe it or not).

If the control (IMHO) were properly designed, the value would NOT make a difference. If it can return a numeric value, then it should not be limited to only positive numbers (again, MHO).

Anyway - its no longer an important item. In looking back through ALL the tables, there was only one that would be affected - so, the -1 will not be used. Case closed.

Thanks all,
James

======================================================================
>James,
>
>I think the suggestion was to use a character field in the combobox, containing "1","2","-1", etc., and then use the VAL() function to convert to an integer before saving back to the tables. So you could keep the tables as integers.
>
>However, if you use a character field of width 2, it only uses 2 bytes, not 10.
>
>Personally, I would not be terribly inclined to use negative numbers for status codes. *grin*
>
>Have fun frying those fish!
>
>>Yes - when I have all of my lookup tables (for classification codes) using an integer for the Unique ID and the combo box showing the name, and converting old system data to have the unique id of -1 ...
>>
>>it messes up what I had planned for my application ...
>> -1 = old system classification
>> 0 = user not selected classification
>> 1 to = new system classification
>>
>>I will have to forgo the use of -1 instead or redesigning ALL of my tables, especially since integers take up only 4 bytes versus a character field of 10 bytes.
>>
>>But that's my kettle of fish to fry <g>.
>>
>>James
>>
=======================
J Robert Jernigan
Calabasas, CA USA
jrjernigan@hotmail.com

"To err is human ... I should know, I get to show my humanity everyday!" jrj

"I just love the internet - it takes this great big planet and makes it smaller. Now, why can't we all just get along?" jrj
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform