Help with MenuChecked function please

I am having trouble with the "MenuChecked" function. It always appears to return "false".
My code is something like:
As expected ...
CheckMenu(idMenu$,1501,1); //this sets the check box
ShowMessage(MenuChecked(idMenu$,1501))
CheckMenu(idMenu$,1501,0); //this clears the check box
ShowMessage(MenuChecked(idMenu$,1501))
However
ShowMessage(MenuChecked(idMenu$,1501))
always reports "0" (eg false)
and the following code then does not toggle as expected;
CheckMenu(idmenu$,1501,NOT(MenuChecked(idMenu$,1501)))
I have got around the problem in the meantime by using a "global variable" to track the "checked" state and using it as the parameter to CheckMenu after performing the NOT on the global variable - rather a waste of a variable.
What am I doing wrong?
thanks
My code is something like:
As expected ...
CheckMenu(idMenu$,1501,1); //this sets the check box
ShowMessage(MenuChecked(idMenu$,1501))
CheckMenu(idMenu$,1501,0); //this clears the check box
ShowMessage(MenuChecked(idMenu$,1501))
However
ShowMessage(MenuChecked(idMenu$,1501))
always reports "0" (eg false)
and the following code then does not toggle as expected;
CheckMenu(idmenu$,1501,NOT(MenuChecked(idMenu$,1501)))
I have got around the problem in the meantime by using a "global variable" to track the "checked" state and using it as the parameter to CheckMenu after performing the NOT on the global variable - rather a waste of a variable.
What am I doing wrong?
thanks