This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
3 Responses
What does “ %target(*self:2)” do in the code?
Hi Jessie, thank you for your comment.
snd-msg is an opcode that sends an *INFO or *ESCAPE message to any procedure on the call stack. Once the message is sent, it will appear in the job log. %TARGET is the third parameter of the opcode and allows us to write which procedure the message will be sent to. If you don’t type it the message will be set to the current procedure if the message type is *INFO or it will be sent to the caller procedure if the message type is *ESCAPE. This parameter can specify the offset in the program stack too. So %target(*self:2) means that the message will be sent to the current procedure (*self) but 2 positions up in the program stack so it will be shown in the screen in which you call the program on line 24. You will see a plus symbol (+) if more than one message was sent. Press page up or page down to navigate through them.