Get - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


ContextMenu[CurrentContext][Queries]

  

Get

  

get procedure associated with query

 

Calling Sequence

Parameters

Description

Examples of Queries[Get]

Calling Sequence

Queries[Get](nm)

Parameters

nm

-

string; name of query in context menu module

Description

• 

The Queries[Get] command returns the procedure associated with the query named nm in the context menu module.  This command may be used to examine the procedure associated with nm, or to apply this procedure directly to some object, for example, to map over a list.

Examples of Queries[Get]

with(ContextMenu[CurrentContext]):

  

Get the procedure associated with the query named "Variables".

q := Queries[Get]("Variables");

q:=proclocal_x&comma;t&comma;i&comma;j&comma;rgs&comma;inds&comma;mask&comma;T&semi;globalCM_GenVars&semi;descriptionreturn variables present in the expression&semi;ifnargs&equals;1andtypeargs&lsqb;1&rsqb;&comma;&apos;rtable&apos;and`type/rtable/AcceleratedTable`&lsqb;args&lsqb;1&rsqb;&comma;has_name&rsqb;&equals;falsethenreturnelifnargs&equals;1andtypeargs&lsqb;1&rsqb;&comma;&apos;function&apos;andStandardContext:-Queries:-RunMapleNonMathFunction&comma;argsthenreturnend if&semi;mask:=1&semi;mask:=&apos;mask&apos;&semi;t:=&apos;Not&apos;&apos;name&apos;&comma;&apos;specindex&apos;&apos;anything&apos;&comma;mask&comma;&apos;specindex&apos;&apos;anything&apos;&comma;`?`&comma;_rtable&semi;rgs:=args&semi;inds:=indetsargs&comma;specfuncidentical&apos;`%id`&apos;&equals;&apos;integer&apos;&comma;&apos;Array&apos;&comma;&apos;Matrix&apos;&comma;&apos;Vector&apos;&comma;&apos;VectorCalculus:-Vector&apos;&comma;&apos;Student:-VectorCalculus:-Vector&apos;&comma;&apos;Vector&lsqb;column&rsqb;&apos;&comma;&apos;Vector&lsqb;row&rsqb;&apos;&comma;&apos;VectorCalculus:-Vector&lsqb;column&rsqb;&apos;&comma;&apos;VectorCalculus:-Vector&lsqb;row&rsqb;&apos;&comma;&apos;Student:-VectorCalculus:-Vector&lsqb;column&rsqb;&apos;&comma;&apos;Student:-VectorCalculus:-Vector&lsqb;row&rsqb;&apos;&semi;ifinds<>theninds:=seqi&equals;Matrix&apos;`%id`&apos;&equals;op1&comma;2&comma;i&comma;i&equals;inds&semi;ifhasinds&comma;&apos;_rtable&apos;thenerrorinvalid rtable referenceend if&semi;rgs:=subsinds&comma;rgsend if&semi;foritonopsrgsdoiftypergs&lsqb;i&rsqb;&comma;&apos;rtable&apos;andStandardContext:-Queries:-RunConstantRTable&comma;rgs&lsqb;i&rsqb;thenrgs:=subsopi&equals;mask&lsqb;0&rsqb;&comma;rgsend ifend do&semi;inds:=indetsrgs&comma;&apos;rtable&apos;&semi;inds:=selecta&rarr;StandardContext:-Queries:-RunConstantRTable&comma;a&comma;inds&semi;ifinds<>thenrgs:=subsseqinds&lsqb;i&rsqb;&equals;mask&lsqb;&minus;i&rsqb;&comma;i&equals;1..nopsinds&comma;rgsend if&semi;inds:=indetsrgs&comma;&apos;specfunc&apos;&apos;GRAPHLN&apos;&semi;ifinds<>thenrgs:=subsseqinds&lsqb;i&rsqb;&equals;mask&lsqb;i&rsqb;&comma;i&equals;1..nopsinds&comma;rgsend if&semi;t:=tunion&apos;And&apos;&apos;symbol&apos;&comma;&apos;suffixed&apos;&apos;`Graph `&apos;&semi;inds:=indetsrgs&comma;&apos;specfunc&apos;&apos;RootOf&apos;&semi;foritonopsindsdoj:=indetsopi&comma;1&comma;inds&comma;&apos;name&apos;&semi;if1<nopsopi&comma;indsandtypeopi&comma;2&comma;inds&comma;`=`andtypeopi&comma;2&comma;1&comma;inds&comma;&apos;name&apos;thenj:=jminusopi&comma;2&comma;1&comma;inds&semi;rgs:=subsinds&lsqb;i&rsqb;&equals;mask&lsqb;i&comma;j&rsqb;&comma;rgselifnopsj&equals;1thenrgs:=subsinds&lsqb;i&rsqb;&equals;mask&lsqb;i&comma;&rsqb;&comma;rgsend ifend do&semi;inds:=indetsrgs&comma;&apos;table&apos;&semi;foritonopsindsdorgs:=subsinds&lsqb;i&rsqb;&equals;Tseqj&equals;inds&lsqb;i&rsqb;&lsqb;opj&rsqb;&comma;j&equals;indicesinds&lsqb;i&rsqb;&comma;rgsend do&semi;try_x:=remove&apos;type&apos;&comma;indetsrgsminus&apos;`...`&apos;&comma;&apos;otherwise&apos;unioniftypeCM_GenVars&comma;&apos;set&apos;&comma;CM_GenVars&comma;&comma;t&semi;_x:=sortconvert_x&comma;&apos;list&apos;&semi;_x:=selectvar&comma;expr&rarr;dependsexpr&comma;varandtypevar&comma;&apos;last_name_eval&apos;ornotassignedvar&comma;_x&comma;rgs&semi;inds:=selecttype&comma;_x&comma;&apos;specfunc&apos;&apos;piecewise&apos;&semi;ifinds<>thent:=indetsseqseqop2&ast;j1&comma;i&comma;j&equals;1..iquonopsi&comma;2&comma;iininds&semi;_x:=removemember&comma;_x&comma;tend if&semi;t:=indetsargs&comma;&apos;specfunc&apos;:-Units:-Unit&comma;:-Unit&semi;t:=indetsmapop&comma;t&semi;_x:=removemember&comma;_x&comma;t&semi;_x:=removetype&comma;_x&comma;&apos;RandomVariable&apos;&semi;_x:=seqi&comma;sprintf%a&comma;i&comma;i&equals;_x&semi;_x:=sort_x&comma;proca&comma;blocalta&semi;ta:=typea&lsqb;1&rsqb;&comma;&apos;indexed&apos;&semi;ifta&equals;typeb&lsqb;1&rsqb;&comma;&apos;indexed&apos;thenlexordera&lsqb;2&rsqb;&comma;b&lsqb;2&rsqb;elsenottaend ifend proc&semi;_x:=map2op&comma;1&comma;_x&semi;_xcatch&colon;end tryend proc

(1)
  

Map this procedure over a list.

map(q, [1, x, x*y*z^2]);

&comma;x&comma;x&comma;y&comma;z

(2)

See Also

ContextMenu

ContextMenu[CurrentContext][Queries]

Queries/Add

Queries/List

Queries/Run