>Anybody know how to create a submenu from items in an array....without rewriting the menu in code?
>
>I've tried macro substitution without success....
>
>Bill
I've made some little tests and i write this little program on the fly.
I think it could help you :-)
**********************************
testmenu.prg
**********************************
dimension myarray[3,3]
myarray[1,1] = "'i am pad1'"
myarray[1,2] = "1"
myarray[1,3] = "=saymyname('pad1')"
myarray[2,1] = "'i am pad2'"
myarray[2,2] = "2"
myarray[2,3] = "=saymyname('pad2')"
myarray[3,1] = "'i am pad3'"
myarray[3,2] = "3"
myarray[3,3] = "=saymyname('pad3')"
DEFINE PAD _rdm0tb6b8 OF _MSYSMENU PROMPT "TestMenu" COLOR SCHEME 3 ;
KEY ALT+T, ""
ON PAD _rdm0tb6b8 OF _MSYSMENU ACTIVATE POPUP _abc1234
DEFINE POPUP _abc1234 MARGIN RELATIVE SHADOW COLOR SCHEME 4
mycomm=""
for i = 1 to alen(myarray,1)
mycomm= "DEFINE BAR "+myarray[i,2]+" OF _abc1234 PROMPT "+myarray[i,1]
&mycomm
mycomm= "ON SELECTION BAR "+myarray[i,2]+" OF _abc1234 "+myarray[i,3]
&mycomm
endfor
***************
function saymyname
****
lparameters thename
=messagebox(thename,64,"testmenu")
return
********************************
Hope this help! ;-)
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca