Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hacking a menu system
Message
From
04/05/2004 11:08:57
 
 
To
04/05/2004 09:54:37
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00899707
Message ID:
00900774
Views:
34
Thanks, Mark, but think this is not *my* case, since I do not create .mnx files, I create my menus using Define Menu, Define Pad, etc...

Fernando

>Maybe this is back to the original question. I believe you were having issues iterating through more than one level of the menu. Here is some code I wrote a while back that creates a cursor and uses a recursive routine that iterates through the menu, populating the cursor:
>
>close all
>clear all
>clear
>
>private nCurrentLevel
>nCurrentLevel = 0
>
>create cursor menuhits ( prompt c(50), nLevel i, cproc m, skipfor m, keyboard m)
>
>select 0
>* open up your menu here
>use menus\main.mnx
>go 2
>listitems()
>
>select menuhits
>browse
>
>proc listitems
>
>local nNum, cLevel, i, nRecno
>nNum = NumItems
>cLevel = LEVELNAME
>nRecno = RECNO()
>
>for i = 1 to nNum
> locate for LEVELNAME = cLevel AND NUMITEMS=0 and val(itemnum)=i
> insert into menuhits ( prompt, nLevel, cproc, skipfor ) ;
> values ( strtran(main.prompt, '\< ', ''), nCurrentLevel, main.procedure, main.skipfor)
> skip
> nCurrentLevel = nCurrentLevel + 1
> listitems()
> nCurrentLevel = nCurrentLevel - 1
> go nRecno
>endfor
>
>return
Previous
Reply
Map
View

Click here to load this message in the networking platform