Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control for spinner for time (not timer)
Message
De
08/04/2015 17:48:39
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
08/04/2015 15:45:46
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:
01618052
Vues:
50
>Thanks!
>Albert

Just to let you know

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
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform