Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Menu at runtime - Facing problem
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Title:
Menu at runtime - Facing problem
Miscellaneous
Thread ID:
00794840
Message ID:
00794840
Views:
36
Hi all,
i'm trying to build the menu at runtime according to the structure i define in a recursive structured table, but when i execute this program this dont work only the top most level comes, wut could be the possible cause of this and wuts wrong with this code.

here is the tables structure

Field
------- ---------------------
Process ID of the Process or Menu Item
Descr Description of Menu Item
ty Type stores: 'M' for Menu (Sub menu) 'F' for Forms or Commands
parent Recursive foriegn key to Process field to hold the 'Parent ID', '0' to the Higher Most with no parent
level this is the Sequence number to display the Menu


SET SYSMENU SAVE
SET SYSMENU TO

SELECT cMenu
GO TOP
DO WHILE !EOF()
IF ALLTRIM(parent)=0 AND ALLTRIM(ty)="M" AND ALLTRIM(process)<>"0"
STORE "p"+ALLTRIM(PROCESS) TO vP
STORE ALLTRIM(process) TO Vprocess

DEFINE PAD '&vP' OF _MSYSMENU PROMPT ALLTRIM(Descr)
ON PAD '&vP' OF _MSYSMENU ACTIVATE POPUP vProcess
DEFINE POPUP vProcess MARGIN RELATIVE COLOR SCHEME 4

vRec = RECNO()
i = 1
SCAN FOR ALLTRIM(Parent) = vProcess
DEFINE BAR i OF vProcess PROMPT ALLTRIM(Descr)
i = i+1
ENDSCAN
GO vRec

ENDIF
SKIP
ENDDO
Next
Reply
Map
View

Click here to load this message in the networking platform