Luther Lee Posted July 31, 2023 Report Posted July 31, 2023 For example, a callee action `foo` has a random variable `foo_val`. Then, another action calls `foo` in the repeat-count statement, using the `index_identifier` to constrain `foo_val`. For some reason, the name of `index_identifier` may be as same as `foo_val`. action foo { rand int foo_val; ... } action main { activity { repeat (foo_val : 10) { do foo with { foo_val == this.foo_val; }; } } } The question is, the built-in variable `this` can be used in this scenario? Or I can only use different name for them? repeat (i : 10) { do foo with { foo_val == i; }; } Quote
Ashwini Kodlimath Posted August 4, 2023 Report Posted August 4, 2023 It seems to hinge on whether or not the index_identifier foo_val is considered as a field of the containing action main{} and therefore included in the scope of 'this.' This has not been clarified as such in the LRM. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.