Getting the line number from "on menupick"

DunbarX at aol.com DunbarX at aol.com
Thu Nov 12 18:54:57 EST 2009


Ah.

Didn't read your post far enough down. Typical.

I played around a bit with a cascade menu. The submenus are definitely odd 
in what they return as to menuHistory and the parameter of a menuPick 
handler. You can get the "pathname" of the text, separated by "|" (ascii 124), but 
I cannot get the line number at all. In fact:

With this in a cascade btn with contents:

a
b
(tab) c
d

and this in the button script:

on menuPick pItemName
    put pItemname && the menuhistory of me
end menuPick

A line number for a submenu is returned via the menuHistory, but it is 
whatever line number was last selected in a previous action. So if I select the 
"D", I will get "d 4" from the handler. Well and good.   If I then select 
the "C", I get "b|c 4". (That's "b" &"|" & "c" && "4").

The oddity notwithstanding, I think this is a major shortcoming in the 
language; a real hole in the toolbox.

Craig Newman



More information about the use-livecode mailing list