>Hi Gregory,
>
>Thanks again for taking the time to help me out with this challenge. Your code is clever, but it fails to call the ShowIt() function dynamically, i.e. the ShowIt() function is called only when a popup bar is initially defined and the value returned is cached in the menu bar's 'message' property. The message clause does NOT appear to be evaluated while a user is navigating a popup. You can verify this yourself by placing the following statement in your ShowIt() function.
>
>@2,2 say "Menu bar =" + str( p ) + space( 10 )
>
>If you run (or trace) your code with the above statement added, you will note that the ShowIt() function is only called at popup bar definition time. ShowIt() doesn't get called when I activate the Management popup and highlight the two menu bars.
>
>BTW: Are you near Antwarp? I traveled to Belgium on a business trip a year ago and really enjoyed myself. The people and the food were great.
Have lived in Antwerp for 10 years. Have come back to the roots since
>Thanks again for your help. Any other ideas???
>
>Malcolm
>
Malcolm,
You are right in that the message part is only evaluated once.
In addition, the following below only works for popups that are not activated via the menu. Once they get there, the game is over.
There may, just may be a possibility, but I haven't found it.
Menus, bars, pads and the like are strange animals in vfp
Sorry, thought I had hit the jackpot
procedure do_it()
local i, p
private MenuItem
MenuItem = ''
p = sys(2015)
define popup (p) shortcut
for i = 1 to 10
define bar cntbar(p)+1 of (p) prompt str(i)
on bar cntbar(p) of (p) x=ShowIt(p, bar())
endfor
activate popup (p)
if( !empty(bar()) )
?'MenuItem=', MenuItem
endif
release popup (p)
endproc
function ShowIt(p, i)
MenuItem = 'Something ' + p + str(i)
?? chr(7)
wait window nowait 'Menubar = ' + p + ' ' + str(i)
return 'active message ' + prmbar(p, i)
endfunc
Gregory