Clock

Here you can attach your files or example so others can use it, discussions needs to be done at the general board
Post Reply
Angel
Posts: 87
Joined: Sat Nov 19, 2011 9:34 am

Clock

Post: # 823Post Angel
Sat Jan 21, 2012 8:31 pm

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
Attachments
Reloj.zip
(327.71 KiB) Downloaded 788 times

Bob Hays
Posts: 26
Joined: Sun Oct 03, 2010 4:49 pm

Clock

Post: # 824Post Bob Hays
Tue Jan 24, 2012 4:02 pm

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
---------------------------------------------------------------------------------

Angel
Posts: 87
Joined: Sat Nov 19, 2011 9:34 am

Clock

Post: # 825Post Angel
Tue Jan 24, 2012 5:06 pm

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.

saqmo
Posts: 9
Joined: Sat Sep 15, 2012 4:13 pm

Clock

Post: # 826Post saqmo
Sat Sep 15, 2012 4:33 pm

[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

Post Reply