function test(string MSG2) { declare var1 string local declare var2 string local ;now you got var 1 with the 2nd part of your split so big-cheese var1 now is cheese var1:Set[${MSG2.Token[2,"-"]}] echo "${var1}" ;should say cheese...get it back to your source return ${var1} } ;now source call test ${MSG2} if ${Return.Equal[cheese]} echo "where the fuk are my fries?"