Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Fetching the time

Author
Message
Aramet
15
Years of Service
User Offline
Joined: 21st Feb 2011
Location:
Posted: 21st Feb 2011 19:24
I'm having a bit of trouble here trying to make an international clock program. (yes I'm a noob lol)

The issue I'm having is that I need to use: get time$() to fetch the time, and then convert that into several integer variables from the formatted string that's produced. The closest thing I've been able to find thus far is using VAL to convert the type, but it just grabs the hours place when I do that.

any help would be much appreciated, thanks! =3
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 21st Feb 2011 22:00 Edited at: 21st Feb 2011 22:01
Yeah you can use VAL() to change a string to an integer but it's easier to use IanMs Matrix 1 Utilities Plugin to split the string rather than using a FOR/NEXT loop with MID$().



If you don't have it already IanMs Matrix 1 Utilities Plugin is free and it has many commands that are vital to ease of use. Commands like MID$() mentioned above in Darkbasics native command only takes out 1 character at a time from a string. IanMs version brings back the normal Basic version of MID$() that allows multiple characters to be extracted. Plus it has many more commands like SPLIT STRING to make life so much easier.

http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18

Login to post a reply

Server time is: 2026-07-17 13:58:46
Your offset time is: 2026-07-17 13:58:46