Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to handle numerics in a combobox?
Message
De
08/11/2002 13:26:16
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/11/2002 09:31:33
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00720148
Message ID:
00720417
Vues:
13
>>Henry,
>>If you're using a select statement then IMHO it's better to use RowSourcetype = 3.
>
>Hi Cetin:
>
>I am using RowSourceType 3. with the following code in the RowSource. There are two combos which have the same code.
>
>
SELECT app_time FROM timeslots INTO CURSOR AllTimeSlots NOFILTER ORDER BY app_time
>
>App_Time is a numberice field which contains for example 800 (which we interpret as 8:00 AM0, or 1500 (which we interpret as 3:00 PM).
>
>The objective is to allow the user to select the start time from Combo1 and the end time from Combo2 and store these values in varaiables mStartTime and mEndTime respectively. Later in a select statement i pupolate a cursor to find the find available timeslot for a date between the hours, as in this example 900 and 1500 (i.e., 9:00AM and 3:00PM).
>
>Problem: If I select 900 as mStartTime and 1500 as mEndTime from each of the two combos and then query the values of the variable, I get the following:
>
>
mStartTime = 36.00
>mEndTime = 60.00
>
>Note that App_Time is numberic without any decimal places. I don't understand why this is happenning. Cna you send some light on this. Thanks.

Henry,
You don't say how you query values. I said do query like this :
mSometime = AllTimeSlots.app_time

Probably instead you're doing :
mSomeTime = val(thisform.mycombo.Value)

Val() adds the decimal places (based on set decimal)
If combo is not Bound (bound=.f. default) and column has numeric values then what you get back is Listindex not the value in that column. Set bound=.t.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform