My guess youw workaroud ERROR 2 cause ERROR 1
ERROR 2:
Your import of the code is just WRONG. Wherever you may have it copied it from
jsn(jsn)
if $e(jsn)="{" write $$Do^ZPretty(jsn)
else write "<UNDEFINED>"
quit }jsn(jsn) is a Label with a parameter
But if your COPY/ TEXT manipulator doesn't understand ObjectScript and
inserts a BLANK before jsn(jsn) , it's no longer a label anymore but just nonsens
therefore :
ERROR: ONAPI.demo.cls(Menu+35) #1026: Invalid command : 'jsn(jsn)' :
Offset:7 [Menu+34^ONAPI.demo.1]
The compiler is right ! Your code is broken
ERROR 1:
now as the label jsn doesn'1 exist anymore, this MUST be an ERROR
if pop do jsn(..iris.ClassMethodValue("ONAPI.Person","JSON",pop))ERROR: ONAPI.demo.cls(Menu+9) #8: <NOLINE> [Menu+8^ONAPI.demo.1]
TEXT: if pop do jsn(..iris.ClassMethodValue("ONAPI.Person","JSON",pop))
The compiler is right again! Your code is broken. The label jsn() is destroyed
In Intersystems ObjectScript blanks and tabs are not just for illustration
or visualization but are an essential part of the language with some functionality.
Somehow like exact indenting in Python, just ~60 years longer
In my Studio such typing errors are flagged red immediately during typing.
So I wonder where the obviously broken source came from and how you worked on it
- Log in to post comments
