Fivewin menus
Posted: Mon Apr 20, 2009 7:30 am
Hi All,
I'm new to FIvewin and I hope somebody could help me analyze what's going on with my code. I am trying to build menu from multidimensional array:
GLOBAL aAccessMenu := { { '&Login Ctrl L', 'Log out Ctrl X' },;
{ 'System Log in', 'System Log out' },;
{ FALSE, FALSE },; // checked?
{ TRUE, FALSE },; // status
{ {|| uCheckUserPass() } , nil },; // baction
{ nil, nil },; // resname
{ ACC_CONTROL, ACC_CONTROL },;
{ 'G', 'X' },;
{ 'Login', 'Logout' } }
and I use this code to build the menu:
MENU oMenu
oMenu:l2007 := TRUE
MENUITEM aItems[1] PROMPT '&Access ' MESSAGE 'System Access'
aItems[1]:Cargo := 'Access'
MENU oAccPopup
FOR i := 1 TO Len( aAccessMenu[1] )
MENUITEM aAccessItems PROMPT aAccessMenu[1] MESSAGE aAccessMenu[2] ;
ACTION aAccessMenu[5];
RESOURCE aAccessMenu[6];
ACCELERATOR aAccessMenu[7], Asc(aAccessMenu[8])
Msginfo( cvaltochar(aAccessItems:bAction) )
aAccessItems[1]:Cargo := aAccessMenu[9]
END
.....
.....
However, I noticed that the value of aAccessItems[1]:bAction is just simply "{||...} and not the value from the array which is {|| uCheckUserPass() }. How may i be able to call the function from multidimensional array and store it as valid function call in Tmenuitem?
Thanks.
I'm new to FIvewin and I hope somebody could help me analyze what's going on with my code. I am trying to build menu from multidimensional array:
GLOBAL aAccessMenu := { { '&Login Ctrl L', 'Log out Ctrl X' },;
{ 'System Log in', 'System Log out' },;
{ FALSE, FALSE },; // checked?
{ TRUE, FALSE },; // status
{ {|| uCheckUserPass() } , nil },; // baction
{ nil, nil },; // resname
{ ACC_CONTROL, ACC_CONTROL },;
{ 'G', 'X' },;
{ 'Login', 'Logout' } }
and I use this code to build the menu:
MENU oMenu
oMenu:l2007 := TRUE
MENUITEM aItems[1] PROMPT '&Access ' MESSAGE 'System Access'
aItems[1]:Cargo := 'Access'
MENU oAccPopup
FOR i := 1 TO Len( aAccessMenu[1] )
MENUITEM aAccessItems PROMPT aAccessMenu[1] MESSAGE aAccessMenu[2] ;
ACTION aAccessMenu[5];
RESOURCE aAccessMenu[6];
ACCELERATOR aAccessMenu[7], Asc(aAccessMenu[8])
Msginfo( cvaltochar(aAccessItems:bAction) )
aAccessItems[1]:Cargo := aAccessMenu[9]
END
.....
.....
However, I noticed that the value of aAccessItems[1]:bAction is just simply "{||...} and not the value from the array which is {|| uCheckUserPass() }. How may i be able to call the function from multidimensional array and store it as valid function call in Tmenuitem?
Thanks.