Page 1 of 1
Clock
Posted: Sat Jan 21, 2012 8:31 pm
by Angel
My simple clock.
An error corrected:
Minutes=Val(Mid$(Time$, 4,2)) if Hour is >=10, but Minutes=Val(Mid$(Time$,3,2) if Hour is<10
Clock
Posted: Tue Jan 24, 2012 4:02 pm
by Bob Hays
When I ran your program, I noticed that the seconds hand did not move.
The existing code does not check for 12 hour mode and tries to get seconds by getting the value of the AM/PM indicator. The code below corrects this.
---------------------------------------------------------------------------------
if ucase$(right$(time,2))="AM" or ucase$(right$(time,2))="PM" then
Segundos=val(right$(time,5))
else
segundos = val(right$(TIME,2))
end if
---------------------------------------------------------------------------------
Clock
Posted: Tue Jan 24, 2012 5:06 pm
by Angel
Hello Bob:
Thank you for your comment and for taking the time to improve the clock code. It`s much appreciated.
My system time is at 24 hour mode and the original code works correctly, but not check the 12 hour mode.
Best regards,
ngel.
Clock
Posted: Sat Sep 15, 2012 4:33 pm
by saqmo
[quote author=11070B021A105B51555357630 link=1327177907/1#1 date=1327420977]When I ran your program, I noticed that the seconds hand did not move.
The existing code does not check for 12 hour mode and tries to get seconds by getting the value of the AM/PM indicator. The code below corrects this.
---------------------------------------------------------------------------------
if ucase$(right$(time,2))="AM" or ucase$(right$(time,2))="PM" then
Segundos=val(right$(time,5))
else
segundos = val(right$(TIME,2))
end if
---------------------------------------------------------------------------------
[/quote]
Yeah i also worked it...this code is all right
if ucase$(right$(time,2))="AM" or ucase$(right$(time,2))="PM" then
Segundos=val(right$(time,5))
else
segundos = val(right$(TIME,2))
thanks for also solved me problem