General information
Category:
Menus & Menu designer
Title:
Menu at runtime - Facing problem
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only