Dismiss Notice

Welcome To CK5!

Registering is free and easy! Hope to see you on the forums soon.

Score a FREE t-shirt and membership sticker when you sign up for a Premium Membership and choose the recurring plan.

ASP programming

Discussion in 'The Lounge' started by k20, Feb 17, 2003.

  1. k20

    k20 3/4 ton status

    Joined:
    Sep 9, 2001
    Posts:
    5,068
    Likes Received:
    0
    Location:
    Mineral Springs, NC
    Does anyone know ASP on here? If so do you know how to populate an array for say the days of the week without explicitly typing out the actual days of the week? Not like arrdays=("Monday, TUesday, Wednesday, etc") but another way where you dont have to type that out? I apparently missed that class and now its come back to bite me.....
     
  2. newyorkin

    newyorkin 1 ton status

    Joined:
    May 8, 2001
    Posts:
    16,555
    Likes Received:
    157
    Location:
    Los Estados Unitos
    I don't know if you can do this without being explicit. Are you looking for an autocomplete type feature, so a user types the three letters of the day and it fills the variable, then returns the full day name when called? Are you using VB script? I may not be getting the picture right here, but you could just define the abbreviations in the beginning of the script as string variables with the value as the autocomplete, i.e. thu=thursday. Then have the input return value come back as the variable instead of a string.
    If you're just trying to keep the script tight and just avoid typing all that, I can't think of a way off hand.
    I'm just beginning to learn VB Scripting, so I may not be much help anyway. I don't quite grasp a complete use for array's as more than input storage right now, though...

    I have a friend that does exclusive asp programming. Give me a better idea of what you're looking to do, and I'll ask ask him what he thinks.
     
  3. k20

    k20 3/4 ton status

    Joined:
    Sep 9, 2001
    Posts:
    5,068
    Likes Received:
    0
    Location:
    Mineral Springs, NC
    yeh using vbscript, all the assgnment is, is to populate an array with the days of the week but not type out the days of the week. Sort of an auto-display them, and i believe use a loop, but i cant figure it out. I have a very skewed idea but my syntax is way off
    <%@ language=vbscript
    dim i
    %>



    <html>
    <body>

    response.write(WeekdayName(
    for i = 1 to 7
    next)




    </body>
    </html>

    That is what ive got but i cant figure out the middle part on how to do that right, somehow make the loop inside of weekday name. I know that code looks like an idiots work but it is
     
  4. newyorkin

    newyorkin 1 ton status

    Joined:
    May 8, 2001
    Posts:
    16,555
    Likes Received:
    157
    Location:
    Los Estados Unitos
    Ahh, didn't realize it was for a class...

    I know extremely little about inserting vb code in html, so I can't help a lot on the syntx. But for the initial tags, try rearranging it like this:

    <html>
    <body>

    <%@ language=vbscript
    dim i
    %>

    response.write(WeekdayName(
    for i = 1 to 7
    next)

    </body>
    </html>

    I wish I had my laptop on, I have all my reference junk on it for this, I could probably give you a hand with syntax. Have you tried a google search for "vbscript: "for" loop days of week"?
     
  5. k20

    k20 3/4 ton status

    Joined:
    Sep 9, 2001
    Posts:
    5,068
    Likes Received:
    0
    Location:
    Mineral Springs, NC
    yeh its for a class but he basically said do it i dont care how u get it, but the one person in my class who gets it is a pr!ck, thanks ill try that search, i know this crap during the week but hwen im off im like wtf lol.
     

Share This Page