Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control for spinner for time (not timer)
Message
From
08/04/2015 17:48:39
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
08/04/2015 15:45:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01617987
Message ID:
01618052
Views:
51
>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]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform