Code: Select all
Debug FormatDate("%hh:%ii:%ss", Date()) ;Just here to proof timer
seconds = 10
timer = Date() + seconds
Repeat
Delay(50)
tik = Date()
Until tik >= timer
Debug FormatDate("%hh:%ii:%ss", Date()) ;Just here to proof timer

Code: Select all
Debug FormatDate("%hh:%ii:%ss", Date()) ;Just here to proof timer
seconds = 10
timer = Date() + seconds
Repeat
Delay(50)
tik = Date()
Until tik >= timer
Debug FormatDate("%hh:%ii:%ss", Date()) ;Just here to proof timer
Code: Select all
Procedure.s DateAsString()
aStr.s = Space(12)
GetDateFormat_(#LOCALE_USER_DEFAULT, 0, 0, 0, aStr, 12)
ProcedureReturn aStr
EndProcedure
Procedure.s TimeAsString()
aStr.s = Space(12)
GetTimeFormat_(#LOCALE_USER_DEFAULT, 0, 0, 0, aStr, 12)
ProcedureReturn aStr
EndProcedure
Debug "Localized Date/Time: " + DateAsString() + " "+ TimeAsString()
MessageRequester("Localized Date/Time: ", DateAsString() + " " + TimeAsString())
Debug "================"
Debug FormatDate("%hh:%mm:%ss", Date()) ;Just here to proof timer
seconds = 10
timer = Date() + seconds
Repeat
Delay(50)
tik = Date()
Until tik >= timer
Debug FormatDate("%hh:%mm:%ss", Date()) ;Just here to proof timer
Localized Date/Time: 12/18/2024 5:36:53 AM
================
05:12:10
05:12:20
I didn't notice it !
Uhhh, last time I put something in Tricks'n'Tips it got moved to Questions so I figured I'm just not qualified to touch the Tricks'n'Tips section.Mindphazer wrote: Wed Dec 18, 2024 10:11 am Hi Randy,
I think you can post your code into the Tricks'n'Tips section, as it is fully cross platform !![]()
Thanks for pointing that out BarryG. I made the correction in my OP.
I tested it on my Mac, it works as expected.Randy Walker wrote: Wed Dec 18, 2024 6:53 pm Uhhh, last time I put something in Tricks'n'Tips it got moved to Questions so I figured I'm just not qualified to touch the Tricks'n'Tips section.
Looking back I guess it should be cross platform. Did you test in linux or MAC?
Glad to hear its proven cross platform. Maybe an admin can move this to tips&tricks.Mindphazer wrote: Wed Dec 18, 2024 10:36 pmI tested it on my Mac, it works as expected.Randy Walker wrote: Wed Dec 18, 2024 6:53 pm Looking back I guess it should be cross platform. Did you test in linux or MAC?
I also tested it on an Ubuntu VM, and it works fine too
That is an alternative option. Really not more simple if you have to create a window to use it though, is it?infratec wrote: Tue Dec 24, 2024 1:54 pm And why not AddWindowTimer()? It is even more simple, it does not need Date()