User-defined variables

Hi, I'm trying to export a list (in txt format) of the tracks in an album of classical music that has multiple composers and multiple interpreters.

In order to get this result, I need to use some user-defined variables, e.g. %lastcomposer% and %lastartist% which should store the last values read from the fields %compser% and %artist% respectively.

However when I tested them with the following code

$puts(%lastcomposer%,aaa)
Last composer=$get(%lastcomposer%)
Last artist =$get(%lastartist%)$puts(%lastartist%,bbb)
Last composer=$get(%lastcomposer%)
Last artist =$get(%lastartist%)

this is what I obtained:

Last composer=aaa
Last artist =aaa
Last composer=bbb
Last artist =bbb

That is, it seems that only one user-defined variable is allowed, in the sense that the last one which is set overwrites also all the others. Is my interpretation correct or rather, I'm doing something wrong?

Thanks in advance for any help/suggestion.

Alberto

You should name your variables without % signs.

Thanks, it worked!

Alberto