If Statements Help

Completely confused on If statements. I run actions scripts, but simple stuff. So, this is what I have and need...

Comment Field = 5A-125

Key Field = 6A

BPM Field = 125

I know some programing but not in MP3tag. So, I’ll write how I know and need.

$Combine = ($key “-“ $BPM) ‘Combine Key and BPM adding a – in the middle

If($Combine <> $Comment) then ‘Compare Key and BPM with Comment Field

$Comment = (“Check – “ $Comment) ‘If Not equal add Check to Comment Field

EndIf

How do I do this in mp3tag? Any help would do. Also, would this go into the Regular Expression Action? Again, I only know the simple actions. Thanks in advance for any help.

I'm not sure if I understand your programming pseudo code correctly.

If you want to combine the content of the tag KEY with the content of the tag BPM and write both divided with a – you can use an action of type "Format value":
Field: COMMENT
Formatstring: %KEY%–%BPM%

I'm not sure why you want to compare an already existing content in COMMENT with the combined content of KEY and BPM. Why not just overwrite it anyway?

The Mp3tag command to compare two tags would be something like
$if($eql(%KEY%-%BPM%,%COMMENT%),%KEY%-%BPM%,Check-%KEY%-%BPM%)
Explanation:
If the content of KEY-BPM compared to COMMENT is equal then fill KEY-BPM otherwise fill "Check-KEY-BPM". (You could ommit to fill KEY-BPM if equal).

You will find the available boolean functions here: Scripting Functions – Mp3tag Documentation

This works perfect and opens up my mind to alot more things I can do , now that I can see the if statement "way".

Had to change it to this...
$if($eql(%KEY% - %BPM%,%COMMENT%),%COMMENT%,Check - %COMMENT%)
Placed it in Format Value

You asked why? I tag my songs using Tunebat (have program to pull info and place in tags). Then I run my songs in VirtualDJ. For some reason even when I have settings to not change tags VDJ changes the BPM and KEY. So this allows me to compare the song with different BPM and Key. Easier to look for "Check" then to look at 50,000+ songs.

Thanks Again

I would use a filter for it. Much more accurate than a visual comparison - and it saves time as you don't have to write the field first.
"$if($eql(%KEY% - %BPM%,%COMMENT%),1.0)" IS 0

The problem with that is I check the sound quality using VDJ. So, with info from Tunebat it tags Key/BPM then I have it backup to comment tag. If VDJ changed the Key/BPM I have MP3tag check for it. Then back to VDJ to test both Key/BPM sound quality. Filter in VDJ for "Check". YES I'm really picky when it comes to music.

Tunebat only gives whole numbers and VDJ gives decimal. So if Tunebat is 102bpm and VDJ is 102.56 then I allow VDJ to change it without listening to it as long as the keys are the same, But any big changes I listen to both versions of Key/BPM.

So you can see I'll be trying that IF statement on alot of things.

Funny thing, alot of times Tunebat, Mix in Key, and VDJ all have different Key/BPM readings. I swear I have a bold spot on my head. I decided to take MiK out of the equation.