Page 1 of 1

Newby I need some help VBScript

Posted: Sat Aug 10, 2013 6:51 pm
by Rednroll
I'm taking my 1st stab at scripting, jumping in by making some minor changes to someone else's script.

Anyways, I'm having some troubles where I'm trying to put an "If then" within an "If then".

The original script had a single "If_then" statement where it stopped the script if the arguments weren't equal. I would like to add an additional "If_then" to give the user a choice between continuing or exiting.


Modified section of code:

Code: Select all

 If Tracks.Count <> Int(TagListLines / MaskLines) Then
            if SDB.MessageBox "Tracks Selected don't match List Lines" & Chr(13)_
			 & "Tracks Selected=" & Tracks.Count & Chr(13)_
			 &"List Lines=" & TagListLines & Chr(13)_
			 & "Continue Anyways?", mtConfirmation, Array(mbYes, mbNo) = mrNo Then
           Exit Sub
		   Else
		   end if
         End If
Original section of code:

Code: Select all

If Tracks.Count <> Int(TagListLines / MaskLines) Then
             SDB.MessageBox "Number of Lines in Tag-List and Track-List doesn't fit!", mtError, Array(mbOK)
           Exit Sub
         End If

Re: Newby I need some help VBScript

Posted: Sat Aug 10, 2013 7:04 pm
by Rednroll
Figures, I've been struggling with this all day, trying different trial and error coding and as soon as I post my question on this forum. I come up with the answer myself. :oops:

Forgot to add a couple ( )

Fixed Modified Code:

Code: Select all

If Tracks.Count <> Int(TagListLines / MaskLines) Then
            if SDB.MessageBox("Tracks Selected don't match List Lines" & Chr(13)_
			 & "Tracks Selected=" & Tracks.Count & Chr(13)_
			 &"List Lines=" & TagListLines & Chr(13)_
			 & "Continue Anyways?", mtConfirmation, Array(mbYes, mbNo)) = mrNo Then
           Exit Sub
		   Else
		   end if
         End If