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.
Fivewin menus
- ryugarai27
- Posts: 65
- Joined: Fri Feb 13, 2009 12:03 pm
- Location: Manila, Philippines
- Contact:
- ryugarai27
- Posts: 65
- Joined: Fri Feb 13, 2009 12:03 pm
- Location: Manila, Philippines
- Contact:
Re: Fivewin menus
Hi all,
I noticed that the system is trying to access the function uCheckUserPass() but loads nothing on the screen.. but the program is still running as i check on task manager.
I changed the code to:
MENUITEM aAccessItems PROMPT aAccessMenu[1] MESSAGE aAccessMenu[2] ;
ACTION uCheckUserPass();
RESOURCE aAccessMenu[6];
ACCELERATOR aAccessMenu[7], Asc(aAccessMenu[8])
and the code works fine...displaying the user interface dialog.
I also tried to put the codeblock in a varaible as:
GLOBAL b := {|| uCheckUserPass() }
and call as:
MENUITEM aAccessItems PROMPT aAccessMenu[1] MESSAGE aAccessMenu[2] ;
ACTION Eval(b);
RESOURCE aAccessMenu[6];
ACCELERATOR aAccessMenu[7][i], Asc(aAccessMenu[8][i])
and it works fine
but when I try it from multidimensional array:
MENUITEM aAccessItems[i] PROMPT aAccessMenu[1][i] MESSAGE aAccessMenu[2][i] ;
ACTION Eval(aAccessMenu[5][i]);
RESOURCE aAccessMenu[6][i];
ACCELERATOR aAccessMenu[7][i], Asc(aAccessMenu[8][i])
...it just doesn't work:
I'm wondering where did i went wrong...
Thanks...
ryugarai
I noticed that the system is trying to access the function uCheckUserPass() but loads nothing on the screen.. but the program is still running as i check on task manager.
I changed the code to:
MENUITEM aAccessItems PROMPT aAccessMenu[1] MESSAGE aAccessMenu[2] ;
ACTION uCheckUserPass();
RESOURCE aAccessMenu[6];
ACCELERATOR aAccessMenu[7], Asc(aAccessMenu[8])
and the code works fine...displaying the user interface dialog.
I also tried to put the codeblock in a varaible as:
GLOBAL b := {|| uCheckUserPass() }
and call as:
MENUITEM aAccessItems PROMPT aAccessMenu[1] MESSAGE aAccessMenu[2] ;
ACTION Eval(b);
RESOURCE aAccessMenu[6];
ACCELERATOR aAccessMenu[7][i], Asc(aAccessMenu[8][i])
and it works fine
but when I try it from multidimensional array:
MENUITEM aAccessItems[i] PROMPT aAccessMenu[1][i] MESSAGE aAccessMenu[2][i] ;
ACTION Eval(aAccessMenu[5][i]);
RESOURCE aAccessMenu[6][i];
ACCELERATOR aAccessMenu[7][i], Asc(aAccessMenu[8][i])
...it just doesn't work:
I'm wondering where did i went wrong...
Thanks...
ryugarai
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Fivewin menus
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India