Query related to set statement
what is the meaning of the S %%G=开发者_StackOverflow中文版A(%%I) statement?
The statement S %%G=A(%%I) is not a valid statement in Standard MUMPS. A related statement S %G=A(%I) is a valid statement in Standard MUMPS.
It is possible that an extension of Standard MUMPS might define a meaning for the first statement, but it isn't guaranteed to work on any system other than that implementation. It is possible that the statement makes sense in EsiObjects or Intersystems Cache Object Script.
The related statement S %G=A(%I) means:
Command -> SET (Asssign a value to a variable)
left-hand side of SET -> %G simple temporary variable named %G accessible only from the current MUMPS job. This variable does not have to be defined, and if it is defined, any value associated with the local variable %G will be erased by the incoming value of the right hand side of the SET. (unless an error occurs)
right-hand side of SET -> A(%I) The current value of the simple temporary variable named %I which accessible only from the current MUMPS job is used as an index (or subscript) into the simple temporary array variable named A which is also accessible only from the current MUMPS job. Both %I and A at that array position must be defined.
Result of Command. The value of the local variable %I is used as an index into the local variable A, retrieving the value at that array location. The value at that array location is then copied into the local variable %G.
精彩评论