Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
ContextMenu[CurrentContext][Queries][Add] - add query for use within context menu module
Calling Sequence
Queries[Add](nm, query)
Parameters
nm
-
string; name by which query is referenced
query
procedure; returns information about the right-clicked object
Description
The Queries[Add] command adds query to the set of recognized queries under the name nm.
The nm parameter is the name by which the query is used and referenced by the context menu module. The query parameter is a procedure applied to the selected object.
Note that if a query is boolean-valued, meaning it returns true, false, or FAIL, then nm may be used in the test parameter to the Entries[Add] command. This indicates that the appearance of the associated entry in the context menu is dependent on the return value of query.
In addition to their use in Entries[Add], queries may be called by entry generators (see EntryGenerators) or by other queries using the Run command.
Examples of Queries[Add]
with(ContextMenu[CurrentContext]):
Add a query that lists the exports of a specified module.
Queries[Add]("Exports", proc(e) [exports(e)] end proc);
Add a query that returns the number of exports a specified module has.
Queries[Add]("NumExports", proc(e) nops(RunQuery("Exports", e)) end proc);
Add a query that tests that the specified module has exactly five exports.
Queries[Add]("5 exports", proc(e) evalb(RunQuery("NumExports", e) = 5) end proc);
See Also
ContextMenu, ContextMenu[CurrentContext][Queries], Queries/Get, Queries/List, Queries/Run
Download Help Document