mumps query related to %%
What is the meaning of I $E开发者_如何学C(R%%,I%%)>1
? and why using %%
?
Actually, if you are talking about Standard MUMPS (not any particular implementation) the R%% is illegal syntax. I have seen the non-standard use of % in extensions to MUMPS, such as EsiObjects or InterSystems Cache Object Script, but the use in the question above is actually nonsense in standard MUMPS.
There is no particular significance to %%. Its just part of the variable name and I still don't understand MUMPS community obsession with using % in variable names and making them more obscure.
so the statement means IF $EXTRACT(R%%,I%%)>1
i.e if the extracted value from the string R%%
at position I%%
is greater than 1, do some more obscure stuff.
$EXTRACT(string,from) extracts a single character in the position specified by from. The from value can be an integer count from the beginning of the string, an asterisk specifying the last character of the string, or an asterisk with a negative integer specifying a count backwards from the end of the string.
Link to documentation: http://docs.intersystems.com/cache20102/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_fextract
精彩评论