Example:
Adding an item to a delimited string

Actions used:

Control Structure - ELSE

Control Structure - END IF

Control Structure - IF

Variable - Set Value

In this example, we'll use a "Variable - Set Value" action to add an item to the end of a double-semicolon (;;) delimited list. Our delimited string is currently stored in the variable %MP3List%, and the item we want to add is stored in a variable named %Song%.

Here's what the action list looks like:

First, we use a "Control Structure - IF" action to check to see if there are any items in our %MP3List% variable yet. The easiest way to test this is to simply check whether the %MP3List% variable is empty.

If the variable's empty, then our new item will be the first and only item in the list, so we want to add it with no delimiter using a "Variable - Set Value" action.

Next, we use a "Control Structure - ELSE" action to split our IF block into two parts: a true part that will be performed if there are no items in %MP3List% (which we just handled), and a false part that will be performed if there are already items in %MP3List%.

If the variable isn't empty, we want to add our item to the end of the string in %MP3List% following a delimiter. Again, we'll do this using a simple "Variable - Set Value" action.

Note that we are free to use our %MP3List% variable in the value that we assign back to %MP3List%.

Finally, we end our IF block with a "Control Structure - END IF" action.

Here's a link to the finished example, as an AutoPlay Media Studio 4.0 actions XML file that you can import into an action list:

(Note: save this file to your hard drive and use a tool like WinZip to extract the XML file)