Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control for spinner for time (not timer)
Message
De
09/04/2015 12:00:54
 
 
À
08/04/2015 17:48:39
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01617987
Message ID:
01618084
Vues:
60
Not sure how this would work when not using a 24 hour clock. I think you still have to have some sort of IF/ENDIF when rolling from 12:00 to 1:00.

Albert


>There is a lot of IF in the code to form a ring. Typical codemonkey approach. :)
>
>This could be done quicker with the following formula using modulo:
>
>
>lnHours = 24
>lnNewHour = (lnOldHour+lnChange)%lnHours
>
>try
>
>clear
>lnOldHour = 24
>lnHours = 24
>lnd = 1
>FOR lnchange = 1 TO 25
>lnOldHour = (lnOldHour-lnd)%lnHours
>?lnOldHour
>ENDFOR &&lnx 
>
>or
>
clear
>lnOldHour = 24
>lnHours = 24
>lnd = 1
>FOR lnchange = 1 TO 25
>lnOldHour = (lnOldHour+lnd)%lnHours
>?lnOldHour
>ENDFOR &&lnx 
>
>
>new you loop between 1 and 00
>
>lots of if less :)
>
>and even if somebody enters 55 -> the modulo will fit it.
>
>Lutz
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform