Hi jim
The following 2 changes fix it.
Change this:
gsub(" ","\\ ",sid[i])
To this:
gsub(" ","\\ ",sid[i])
gsub("&","\\\\&",sid[i])
Change this:
gsub(" ","\\ ",sid[selection])
To this:
gsub(" ","\\ ",sid[selection])
gsub("&","\\\\&",sid[selection])
Makes me wonder what other legal characters can cause trouble.
[Edit]: Fixed typo. Changed sid[ i] to sid[selection] in last line. Rich