It's confusing because there are enough different types of
indirection in MUMPS that it looks almost like textual substitution,
but it's not. The X[ECUTE] command does allow you to execute
arbitrary code.
Perhaps the form of indirection that looks the most like simple
textual substitution is command indirection, where the string
contains whatever follows a command. That may be a variable name
(e.g., for NEW) or a more complex expression (e.g., for SET). Here's
an example
~:$ csession cache
USER>S Y="X=$H"
USER>S @Y
USER>W X
60147,58559
USER>
Now, the syntax you were trying to use is subscript indirection. It
is used to access arrays when the array name and subscript (or
subscripts) are stored in variables. Though there is a surface
similarity between this syntax and that used to invoke an extrinsic
function, function calls and array references are very different
things in MUMPS.
===
Gregory Woodhouse
[EMAIL PROTECTED]
"And the end of all our exploring
will be to arrive where we started
And know the place for the first time"
-- T.S. Eliot
On Sep 4, 2005, at 3:54 PM, Jim Self wrote:
Kevin wrote:
I posted about this once before, and it seems that someone had an
answer. But I can't find that post now.
That was me. It was in response to Nancy's question about indirection.
I am trying to use indirection (@) to execute a callback function.
But it looks like the indirection is limited to 8 characters.
The form of indirection you are trying is not standard nor is it
supported by GT.M.
e.g.
GTM>w $$SIMPLE^TMGTEST("hello")
You said:hello
GTM>set x="SIMPLE^TMGTEST"
GTM>w [EMAIL PROTECTED]@("hello")
%GTM-E-LABELMISSING, Label referenced but not defined: SIMPLE^T
GTM>
How should I do this?
Try putting the "$$" inside the quotes.
I don't think this is standard either (or documented in GT.M for
that matter), but this
works for me.
s test="$$ucase^%zString" w @test@("hello kevin")
HELLO KEVIN
o
---------------------------------------
Jim Self
Systems Architect, Lead Developer
VMTH Computer Services, UC Davis
(http://www.vmth.ucdavis.edu/us/jaself)
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams *
Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/
bsce5sf
_______________________________________________
Hardhats-members mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hardhats-members
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hardhats-members mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hardhats-members