|
|
|
|
|
|
|
☜ | $QUERYDraft MDC Standard | ☞ |
$Q[UERY] ( glvn )
Follow these steps:
- Let glvn be a variable reference of the form
Name(s1, s2, ...,
sq ) where sq may be the
empty string. If glvn is unsubscripted, initialize
V to the form Name(""); otherwise, initialize V to
glvn.
- If the last subscript of V is empty, Goto step e.
- If $Data(V) \ 10 = 1, append the subscript ""
to V, i.e., V is Name(s1,
s2, ..., sq, "").
- If V has no subscripts, return "".
- Let s = $Order(V).
- If s = "", truncate the last subscript off V,
Goto step d.
- If s '= "", replace the last subscript in V with
s.
- If $Data(V) # 2 = 1, return V formatted
as a namevalue.
- Goto step c.
$Q[UERY] ( glvn , expr )
Let S be the value of expr. Then $Query(
glvn , expr ) returns:
- If S = 1, the function returns a result identical to that
returned by $Query( glvn ).
- If S = –1, the function returns a value which is either the
empty string ("") or a namevalue according to the
following steps:
- Let glvn be a variable reference of the form Name(
s1 , s2 , ... , sq
) where sq may be the empty
string. If glvn is unsubscripted, initialize V to
the form Name(""); otherwise, initialize V to
glvn.
- If the last subscript of V is empty, go to step e.
- If $Data(V)\10=1, append the subscript "" to
V, i.e. V is Name( s1 , s2
, ... , sq ,"" ).
- If V has no subscripts, return "".
- Let s = $Order( V , - 1 ).
- If s = "", truncate the last subscript off V,
and go to step j.
- If s '= "", replace the last subscript of V
with s.
- If $Data( V ) # 2 = 1, return V formatted as
namevalue.
- Go to step c.
- If $Data( V ) # 2 = 1, return V
formatted as a namevalue
- Go to step d.
- Values of S other than 1 or –1 are reserved for future
extensions to the $Query function.
If the value of $Query( glvn [ , expr ] )
is not the empty string, and glvn includes an
environment, then the namevalue shall include the
environment; otherwise the namevalue shall not
include an environment.
If the argument of $Query is a gvn, the
naked indicator will become undefined and the value of
$Reference will become equal to the empty string.
Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.
Some specifications are "approved
for inclusion in a future standard". Note
that the MUMPS Development Committee cannot
guarantee that such future standards will
indeed be published.
This page most recently updated on 15-Nov-2023, 13:11:39.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)