(It seems like it is my week on deck!)
I’ve having problems with ^nth() compared to ^first(). The documentation implies that the first parameter to ^nth() is the same as for ^first() - an (annotated) fact set. So that implies that @0, @0fact, @0subject etc are all valid, with the suffix indicating how the returned fact is to be used.
But if I do ^nth(@0fact, 1) then it appears that @0fact has already been decoded to the fact index prior to FLRSpecificCode() being called. You can see that in the tracing:
System Call ^nth(216986, 1, ) =
However the code in FLRSpecificCode appears to be expecting an unresolved version of the first argument and hence it throws a failure with a fact index.
But if I do ^nth(@0, 1) then then the first argument is not decoded and the generic FLR() routine will be called. But then I only get the subject back and I really want the fact index so that I can use ^field(). (Ultimately I want the verb and object).