I don't think you can do that, but you can accomplish the same thing with menu IDs and an INI file. For example, say that you want to add three new menu commands to the Tools menu in Origin.
First create an INI file like this...
;MyMenus.ini
[Config]
numCmds=3
Cmd1=First Command
Cmd2=Second Command
Cmd3=Third Command
Next create a script file...
// MyMenus.ogs
[MakeMenu]
menu -w; menu ?To;
ini.get.filename$=%YMyMenus.ini;
loop(ii,1,ini.Config.numCmds) {
%A=ini.Config.Cmd$(ii)$;
menu (%A) {run.section(MyMenus,Execute)};
ini.Config.ID$(ii)=menu.lastID;
};
[Execute]
ini.get.filename$=%YMyMenus.ini;
loop (ii,1,ini.Config.numCmds) {
if(ini.Config.ID$(ii)==i) break;
};
run.section(,Cmd$(ii));
[Cmd1]
// First Command scripts...
[Cmd2]
// Second Command scripts...
[Cmd3]
// Third Command scripts...
The MakeMenu section adds the following items at the end of the Tools menu and records their menu IDs in MyMenus.ini.
First Command
Second Command
Third Command
When the user selects one of these commands its menu ID is passed via the variable 'i' to the Execute section, which then runs the appropriate command scripts. Normally its easier just to create the menu items explicitly...menu (First Command) {run.section(MyMenus,Cmd1)};
menu (Second Command) {run.section(MyMenus,Cmd2)};
etc.
But there have been a few situations where I've found this method quite useful.
Mike Buess
Origin WebRing Member
Edited by - Mike Buess on 12/19/2001 13:58:42
Edited by - Mike Buess on 12/19/2001 14:03:29
Edited by - Mike Buess on 12/19/2001 14:04:59