Umm... You said your having a problem passing a string to a function, but you aren't passing a string to anything in your example?!? Perhaps you can post some more of your code...
Thanks for the reply Have now made it a global variable and it works although I find this a little odd since I have used local variables in other areas of the procedure and they work fine
Wow, that code is really hard to read. Anytime I have a complex command like that to assign to a button, I try to roll that stuff into the proc I am calling.
So from what I can gather the called proc is menuCreate. Since this is assigned to a button, I am sure you know this needs to be a global proc. The same thing is going on with the variable $geoMatMenu.
When this button is pressed, $geoMatMenu isn't available outside of the procedure that built the button. That procedure has been executed and is gone. By making $geoMatMenu global, you are making sure it stays around.
To avoid the global, the value of $geoMatMenu should be computed inside of the proc menuCreate.