Results 1 to 8 of 8

Thread: DATE$

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Gainesville, Ga
    Posts
    50
    I used the date$ to right a little qb prog.
    If I type date at the command prompt
    I shows something like this "SAT 09-09-2000"
    I formatted the out put to look like "September 9th, 2000"

    What I need to know is how to get the day e.g. "SAT"
    so I can format it to say "Saturday" in the middle of
    the screen.
    Scott Cato
    VB6s

  2. #2
    Lively Member Skateboarder's Avatar
    Join Date
    Nov 2000
    Location
    Delfzijl, the Netherlands
    Posts
    66

    Maybe this is what you mean....

    I don't know how you did it, but I can't get the date$ command in Qbasic output a date with SAT or MON before it. Anyways, if u want just to extract the thirst three letters and make out of SUN sunday, in the middle of the screen... that's not so hard; here's the code. You have to fill in the x and the y for the locate statement yourself, caus' it depends on the screen resolution your using.

    As I told you before, I don't know how you did the day-stuff. But you'll have to store this as a string, for example; mystring$. So you got this string, e.g. "SAT 09-09-2000" ok?. Than do this:

    locate x,y 'middle of the screen
    if right$(mystring$,3) = "SUN" then print "Sunday"
    if right$(mystring$,3) = "MON" then print "Monday"

    etcetera etcetera etcetera

    Or, if you wanna safe space:

    locate x,y
    day$ = right$(mystring$,3)
    if day$ = "SUN" then print "SUNDAY"
    if day$ = "MON" then print "MONDAY"

    etcetera etcetera etcetera

    I don't know if this is what you're looking for, but anyways... damn... did i really talked this much?!
    To VB or not to VB, that's the question...

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Gainesville, Ga
    Posts
    50

    Smile Re: Maybe this is what you mean....

    Originally posted by Skateboarder
    [B]I don't know how you did it, but I can't get the date$ command in Qbasic output a date with SAT or MON before it.
    that's what i was talking about.
    if you type date at the prompt the bios shows it, but i
    can't get qbasic to do it without some heavy coding.

    i already tried many variations of the code you posted,
    but can't make anything work that's short like that.

    thanks anyway.

    i gave up on anyone replying to this post so i gave up
    qbasic for a while and went back to VBing for a while

    Thanks so much for replying !!!
    Scott Cato
    VB6s

  4. #4
    Guest
    There is no built in way to get the day from QB.

    At my last job, before we went to vb, we had a little (actually, it was kinda big) function that would return the day of week by retrieving a numeric value.

    If you would like this, I can have a friend send the code and I can post it for you. But you are probably smarter going to vb anyway.

  5. #5
    Lively Member TB's Avatar
    Join Date
    Feb 2001
    Location
    Austria
    Posts
    106

    Lightbulb

    When you have the date the you can get the day with the so called "Week-Day formula" by Gauss.
    I will have to find my old maths book to get the formula, so write back if you're still interested.
    mojo

  6. #6

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Gainesville, Ga
    Posts
    50
    Yes, I am still interested, if you don't mind emailing me
    at [email protected]

    Thanks
    Scott Cato
    VB6s

  7. #7
    Guest
    i had once made a prog that displayed a calender for any year.. 1AD till 9999AD!!

    It could even display BC dates but i'm not sure of its accuracy there...

    I'm attatching the EXE file(30 kb)..

    The source is somewhere on my HD.. if you are interested then post a note..

  8. #8
    Guest

    THE ATTATCHMENT IS HERE..

    forgot to attatch

    (25 kb download)
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width