Hello. I am trying to write an alarm clock program with vb express 2008, but I've run into a problem that I need help with. I retrieve a time from a text box from the user, how do I make sure they have the correct format so I can match it up with a time that is using this format: Format(Now, "hh:mm.ss tt"). It seems simple, but it has me stumped right now. How do I tell if a part of a string is numeric or not? Any help would be appreciated.
@brian - jmc said "If you really did need to convert a string to a time, you'd use TimeSpan.TryParse, DateTime.TryParse or DateTime.TryParseExact." They will all give valid / invalid indications of time.
Thanks for the responses, I think I have a solution to the input format problem, but I would still like to know a way to make sure part of a string is a numeric value. I would parse the string using the mid function, but what kind of check can I run on the parsed part to make sure it's a number value? Thanks for your help.
I would still suggest you to use the Jmc’s suggestion but if you want to check the string for numeric values than you need to write a method to do that. You could loop through the chars of the string and check if they are numeric or not.
Rating is a way of saying thank you. Don't forget to rate always!
That's what I was looking for. Thanks alot. I just wanted a simple interface to wake me up in the morning. I have an alarm clock I made with just basic that uses wav files and random numbers, but its a console app, I wanted an alarm gui. Keep an eye out in code-bank for this alarm clock.
That's what I was looking for. Thanks alot. I just wanted a simple interface to wake me up in the morning. I have an alarm clock I made with just basic that uses wav files and random numbers, but its a console app, I wanted an alarm gui. Keep an eye out in code-bank for this alarm clock.
Looks nice, I have also started a desktop alarm clock and didn’t finish yet.
Rating is a way of saying thank you. Don't forget to rate always!