Combining Style & Genre Fields

I use Format Value %genre%\%style% to combine my genre and style fields and it gives me two genres (assuming one per field). If I run the script a second time it wipes out the 2nd genre.

Any suggestions on how to combine genre and style without losing genres with multiple runs?

Thx

Do not use the (double) backslash as separator. This may create a multi-value field (several of the same kind).
The semicolon would be nice or the pipe |.

Yes I know. I started with the pipe. But genres need to be in ''multi-value'' fields in order for the music library software to properly classify the songs.
So what is needed is a ''field'' called %genre*%" or something similar that lets the database know I intend to do action on the first genre field, but not to delete the other genre fields.
If I have a simple command GENRE FORMAT %genre% the software should not delete anything.

There is the scripting function that lets you address single fields of a multi-value field - see $meta() and $meta_sep().

Then, if you want to add another field to a multi-value field, first merge the fields to a single one with an action of the type "Merge duplicte fields", manipulate that single field, then use an action of the type "Split field by separator" to get the multi-value field back again.

Thanks, that was the answer. Here's the .mta with comments for future reference:
[#1]
T=8 (merge duplicate genre fields, separated by pipes)
F=GENRE
1=|

[#2]
T=5 (join genre and style with | separator)
1=$if(%style%,%genre%|%style%,%genre%)
F=GENRE

[#3]
T=9 (remove style field)
F=STYLE

[#4]
T=2 (change any commas to pipes ... genre had many entries separated by commas)
F=GENRE
1=,
2=|
3=0|0

[#5] (split fields at pipes)
T=16
F=GENRE
1=|