Newby I need some help VBScript

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

Rednroll
Posts: 320
Joined: Mon Feb 02, 2009 9:11 pm

Newby I need some help VBScript

Post 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
Rednroll
Posts: 320
Joined: Mon Feb 02, 2009 9:11 pm

Re: Newby I need some help VBScript

Post 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
Post Reply