----- Original Message -----
From: "Duke Normandin" <dukeofperl@[EMAIL PROTECTED]
>
Sent: Sunday, May 11, 2008 5:44 PM
Subject: % only as a variable
> Sorry! but here goes with another dumb noob question.
>
> From some Mumps literature that I've been able to garner from the
> Internet, I've seen a standalone % used as a variable, yet never
> being used thereafter, e.g.,
>
> zmain
> for i=0:1:10 do
> . for j=1:1:10 do
> .. set ^A(i,j)=5
> set %=$zzCentroid(^A,^B)
> for i=1:1:10 write ^B(i),!
>
> When % is used this way, what is it doing?
> --
> Duke Normandin
First of all, there's nothing special about % as a variable -- it's no
different than x or I. In this example, % is used as a dummy to receive
whatever value is returned by the $zzCentroid function, but that value is
of
no interest in this example. This function computes a centroid vector from
an array. The input array is named by the first parameter and the output
vector is named by the second parameter.
In standard Mumps, this might be done as: DO zzCentroid("^A","^B") and
thus, not have to worry about a returned value. The example you found is
from O'Kane's MUMPS Compiler, and that is not standard Mumps. For one
thing,
it does not sup****t DO with parameters.


|