VBscript-help!!

Discussion in 'Software' started by Bard^, Sep 19, 2006.

  1. Bard^

    Bard^ Private E-2

    I've got this script really close to completion and I don't understand why my select case statement isn't working. I've extra wscript.echo lines in there for debugging purposes. Please help!
     

    Attached Files:

  2. matt.chugg

    matt.chugg MajorGeek

    Select case staments don't work quite like that!

    You were close though lol

    Code:
    Select Case x
    Case  0
    	strKeyPath = strKeyPath0
    	enmuKey = enmuKey0
    	wscript.Echo "Case0"
    Case  1
    	strKeyPath = strKeyPath1
    	enmuKey = enmuKey1 
    	wscript.Echo "Case1"
    Case 2
    	strKeyPath = strKeyPath2
    	enmuKey = enmuKey2
    	wscript.Echo "Case2"
    Case 3
    	strKeyPath = strKeyPath3
    	enmuKey = enmuKey3
    	wscript.Echo "Case3"
    Case 4
    	strKeyPath = strKeyPath4
    	enmuKey = enmuKey4
    	wscript.Echo "Case4"
    Case 5
    	strKeyPath = strKeyPath5
    	enmuKey = enmuKey5
    	wscript.Echo "Case5"
    case else
                ' never going to happen with that loop but anyway!
    End Select
    
    pathVariable = 0 would return boolean so you were essentially checking several times if x was true or false
     
  3. Bard^

    Bard^ Private E-2

    Thank you so much... you don't know how much time I spent starring at that.
     
  4. matt.chugg

    matt.chugg MajorGeek

    No problem, i've got a vaugue idea lol, i've spent many an hour hunting down an illusive missing semi colon
     
  5. Bard^

    Bard^ Private E-2

    Oh geez... sounds like a SQL problem.... I've been there as well.
     

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