- Log in to post comments
User bio
404 bio not found
Member since Nov 9, 2022
Posts:
Replies:
Whether I use Quit or Return depends on what I'm trying to do. If the aim is to just terminate a method and/or return a value then I go for Return. But if I'm within a code block that I'm trying to escape out of, then I use Quit (as long as that block isn't an if/else statement then I need to resort to trickery to get out of it without ending the routine)
Quit also has a neat feature when used to debug from the terminal in that it allows you to go back up the call stack by giving it a numeric argument.
- Log in to post comments
If you annotate your Rust function with the #[rzf::rzf] attribute, how can you call it from your ObjectScript code? The presentation slides were a little cut off in the video so I can't see that part.
- Log in to post comments
Certifications & Credly badges:
Ali has no Certifications & Credly badges yet.
Followers:
Following:
Ali has not followed anybody yet.
Sure, let's create a class like this:
Class Sample.DC { ClassMethod RunMe() As%Status { Setx = 1do..NestedOne() } ClassMethod NestedOne() As%Status { Set y = 2do..NestedTwo() } ClassMethod NestedTwo() As%Status { set z = 3set err = z / 0 } }If you go to your terminal and do ##class(Sample.DC).RunMe() then you will get this error:
<DIVIDE>NestedTwo+2^Sample.DC.1Your terminal will also show this prompt:
USER 4d1>You can examine the variables in the NestedTwo classmethod to determine what went wrong by printing variables in that stack frame, for example: write z. However, you can't print out the values of y and x because they are in a parent stack frame. Instead, you use quit <number> to go back up to the NestedOne and RunMe frames where you can print out the values of y and x. For example, quit 1 will go to NestedOne where the var y is defined.