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.

Newcomers DBPro Corner / How do you work out the current day in DBpro

Author
Message
Cretinous
19
Years of Service
User Offline
Joined: 10th Mar 2005
Location:
Posted: 11th Sep 2005 17:18
How do you work out the current day in DBpro?
And also how do you work out what day the month starts on?

unless you haven't already guessed I'm tring to make a simple calendar code for my game.

[url=http://www.cretinous.co.nr/]
[/url]
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 11th Sep 2005 19:58 Edited at: 11th Sep 2005 20:01
Here you go

Here you see the commands for showing you the date and the current time (The time is after what your computer is set to).



and just in case you need it here is a working clock




-The Nerd

PanzerGameshere
Free Particle Engine For dbpro :
here
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Sep 2005 20:15
Lol!

That isn't what Cretinous asked Nerd!

I'm just doing a function for you now...

TDK_Man

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Sep 2005 23:11
Nope - no need to call the API - I just did a quick function!



The only rule is that your date has to be a string formatted as 'mm/dd/yyyy'. Otherwise you will have to modify the function yourself.

So, if you were born on 15 December 1980 and you wanted to find out what day of the week you were born on, use

Date$ = "12/15/1980"
Print "You were born on a: ";CalendarDay(Date$)

Enjoy!

TDK_Man

Cretinous
19
Years of Service
User Offline
Joined: 10th Mar 2005
Location:
Posted: 11th Sep 2005 23:26
Thanks for the help but an error came up saying;
Quote: "ENDFUNCTION only accepts a single value or loacl variables at line 109"

this is my overall code


[url=http://www.cretinous.co.nr/]
[/url]
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 12th Sep 2005 00:03
this bit looks whacky

dim month(12) as monthstat
month(1).days=31 : month(0).name="January"
month(2).name="February"

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 12th Sep 2005 01:01
Which line is 109?

If it's my function return:

EndFunction Days$(Today)

Then DBP is different to DBC and you'll have to change the last two lines of my function to:

ReturnDay$ = Days$(Today)
EndFunction ReturnDay$

Also, you have the line:

Date$ = get date$

Which is wrong - should be date$() and that won't probably work anyway, (it doesn't for me because Get Date$() on my machine returns 09/11/02 for today's date which isn't in the correct format).

So, check that you are passing the date to the CalendarDay() function in the correct format.

TDK_Man

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 13th Sep 2005 21:51 Edited at: 13th Sep 2005 21:51
Quote: " Lol!

That isn't what Cretinous asked Nerd! "


Sorry that i tried to help.... But did you need to laught to?

PanzerGameshere
Free Particle Engine For dbpro :
here
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Sep 2005 18:36
Would you rather I had been all serious and said:

"Why on earth don't you read the question properly before posting an answer"?

I thought the first was a bit more friendly.

As it happens, it's irrelevant as Cretinous doesn't seem to be interested in the time we've all spent trying to help anyway...

TDK_Man

Cretinous
19
Years of Service
User Offline
Joined: 10th Mar 2005
Location:
Posted: 14th Sep 2005 23:52
I'm sorry I am exremely grateful. You have enlightened me. I wasn't posting because my internet broke. Thank you so much for the help.

[url=http://www.cretinous.co.nr/]
[/url]
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Sep 2005 00:33
You know, I knew the moment I posted that, there would be a legitimate reason you'd not posted back to let us know how you got on!

TDK_MAN

Login to post a reply

Server time is: 2024-09-24 03:16:03
Your offset time is: 2024-09-24 03:16:03