need to brush up on vbscript.

Discussion in 'Software' started by mr_flea, Dec 22, 2003.

  1. mr_flea

    mr_flea First Sergeant

    (I broke the code by using spaces)
    how do you define variables, is it like this:

    variable = ("value")


    Do I switch the ASP mode to vbscript like this?

    < %@language = "vbscript" % >


    Will code like this work?

    if variable = "value" then
    some action here
    else
    (indent 3 spaces)if variable = "other value" then
    (indent 3 spaces)some action here
    (indent 3 spaces)else
    (indent 6 spaces)some action here
    (indent 3 spaces)end if
    end if


    If you haven't already figured it out, i'm trying to create an ASP page using vbscript. (this is right in your area, kodo)

    (it foiled my uses of spaces and &nbsp;'s so i edited it)
     
    Last edited: Dec 22, 2003
  2. Vlad902

    Vlad902 Guest

    I don't believe you can do what you want to do (I am probably wrong) because VBScript is client side not server side, but I may be wrong.
     
  3. mr_flea

    mr_flea First Sergeant

    vbscript can be processed using ASP when you use the right tags. See some of the posts in the ASP thread.
     
  4. Kodo

    Kodo SNATCHSQUATCH

    vlad is right.. when you use the <script language> tag it is run client side.. when you use<% it is not.

    what is it that you are trying to do exactly... something with a text area?
     
  5. mr_flea

    mr_flea First Sergeant

    I was trying to have it choose content to show based on a querystring. I was going to use the <% tags. I wanted it to default to a main selection of content if there was no querystring or if the querystring told it to. I think I need some vbscript ASP to do it, though, and I can't get the script to work.
     
  6. Kodo

    Kodo SNATCHSQUATCH

    try case statement
    PHP:
    myquerystring=request.querystring("variable")

    select case myquerystring

    case "" 'no value
    response.write "something"

    case "value1"
    response.write "something else"

    end select
     
  7. mr_flea

    mr_flea First Sergeant

    Is there another way that I could use that does not use the case method, such as something that would process the querystring, assign a variable (if there isn't a querystring), and then use that variable to insert a different variable?

    Since I have probably confused you with what I wrote, probably because I am soooo tired right now, here's pretty much what I mean

    Querystring sets variable1 here
    variables 2, 3, 4, 5 defined here

    HTML head tags and CSS here

    variable1 here, inserts line that tells ASP to use either variable 2, 3, 4, or 5.



    Since the last line is a variable that includes a ASP command, would the ASP command inside the variable still be processed?

    If you still don't understand what I mean, I will try to repost it in english after I get some sleep.
     
  8. Kodo

    Kodo SNATCHSQUATCH

    PHP:
    if variable1=foo then
    'do blah
    elseif variable1=bar then
    '
    do halb
    end 
    if
    ??
     
  9. mr_flea

    mr_flea First Sergeant

    I think I managed to confuse you. Here's what I meant. If you still don't understand, I'll probably have to find some other way to explain it.
     

    Attached Files:

  10. Kodo

    Kodo SNATCHSQUATCH

    dude.. get on msn. (kodotheshoe@hotmail.com) so we can hash this out via chat... I haven't a clue what you're trying to do. It looks like you want to print out the variable to the screen without parsing html..
     
  11. mr_flea

    mr_flea First Sergeant

    stupid me... I forgot that I could just put the code where I wanted the data to be...
     
  12. Kodo

    Kodo SNATCHSQUATCH

    so you got it working now?
     
  13. mr_flea

    mr_flea First Sergeant

    I'm still working on it.
     
  14. mr_flea

    mr_flea First Sergeant

    I haven't gotten it working yet. I'll be seeing him in a few days. I'll give you an update then.
     
  15. mr_flea

    mr_flea First Sergeant

    Sorry, I was half asleep when I posted that. I meant "him" as my uncle, and I just saw him today. Sorry if I confused you.

    I figured out why it wouldn't work. It turns out that my test file wasn't properly formatted. I got it working now. Thanks for the help.
     
  16. Kodo

    Kodo SNATCHSQUATCH

    good deal ;)
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds