Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Military Time
Message
De
03/08/2007 09:32:19
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
01/08/2007 18:13:00
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01245247
Message ID:
01245769
Vues:
36
Hi Jay

Not actually being in your project will make it hard to give an exact answer, but...

What the heck is "slot time"?

I want to conduct an experiment, can I email you so as not to affect the results?

>>>
>>>m.SlotTime = RIGHT( "0" + ALLTRIM( slot_time( xx + show_from - 1 ) ), 5 )
>>>m.DisplaySlotTime1 = Ttoc(Ctot(Transform(Dtos(Date()), '@R 9999-99-99') + 'T' + m.SlotTime), 2)
>>>m.DisplaySlotTime2 = LEFT(m.DisplaySlotTime1,5) + ' ' + RIGHT(m.DisplaySlotTime1,2)
>>>@ 2,2 SAY 'Date: ' + ALLTRIM( DTOC( disp_date ) ) + SPACE(10) + 'Time: ' + m.DisplaySlotTime2 COLOR ( nedit_color )
>>>
>>
>>YES! Use UDFs with readable names and make it understandable. If the results are incorrect, fix that UDF and you're done.
>
>Not sure I follow. So for all three algorithms call a function? Like...
>
>m.SlotTime =GetSlotTime(xx,show_from)
>
>Then have...
>
>FUNCTION GetSlotTime
>
>Etc...
>
>I did do this, which I thought was a little more readable:
>
>
>* Convert from 24-hour to 12-hour time format for display
>m.SlotTime = RIGHT( "0" + ALLTRIM( slot_time( xx + show_from - 1 ) ), 5 )
>m.DisplaySlotTime = Ttoc(Ctot(Transform(Dtos(Date()), '@R 9999-99-99') + 'T' + m.SlotTime), 2)
>
>* Display Next Open Slot Date and Time
>@ 2,2 SAY 'Date: ' + ALLTRIM( DTOC( disp_date ) ) + SPACE(10) + 'Time: ' + (LEFT(m.DisplaySlotTime,5) + ' ' + RIGHT(m.DisplaySlotTime,2)) COLOR ( nedit_color )
>
>
>I've seen code where there were so many functions to do little things that it made it almost unreadable. Where do you draw the line?

At keeping things readble. Use generic meaningful terms for UDFs.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform