lparameters lcmenuname, tnpad local lnpad, lcpopname, lcpadprompt, lcbarprompt if vartype(tnpad) $ "YNIB" then lnpad = tnpad + 1 else lnpad = 0 endif local lxx, lyy, lzz for lxx = 1 to cntbar(lcmenuname) lcpadprompt = prmbar(lcmenuname,getbar(lcmenuname,lxx)) * build a string with disallowed characters lcdisallowed = space(0) for lyy = 1 to 47 lcdisallowed = lcdisallowed + chr(lyy) endfor for lyy = 58 to 64 lcdisallowed = lcdisallowed + chr(lyy) endfor for lyy = 91 to 96 lcdisallowed = lcdisallowed + chr(lyy) endfor for lyy = 123 to 255 lcdisallowed = lcdisallowed + chr(lyy) endfor lcpopname = chrtran(lcpadprompt,lcdisallowed,"") ? space(3*lnpad)+lcpopname if getbar(lcmenuname,lxx) > 0 and popup(lcpopname) then for lzz = 1 to cntbar(lcpopname) lcbarprompt = prmbar(lcpopname,lzz) ? space(3*(lnpad+1))+lcbarprompt if popup(lcbarprompt) then * a popup exists with this name; recursively call this routine =testmenu(lcbarprompt,lnpad+1) endif endfor else * we are talking about a system menu item and cntbar() won't work endif endforThe task is not impossible (as the above shows), but the ultimate use for it escapes me. If you are going to use this as a one time setup after installation, then I can see some use for it. But in that case, you know the available menu options and (as someone pointed out earlier in this thread) you could put those in a table and update it when you update the menu.