## ﻿Clock

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

### ﻿Clock

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

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

### ﻿Clock

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

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

[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