Showing results for 
Search instead for 
Do you mean 
Reply

Accessing a list within a Method, from another method

Good Morning,

my problem is the following:

I have to access to some data that I have saved within a list, which has been created in a method (namely, Method A) through another method (namely, Method B).

A possible solution could be to physically create the list within the frame, in order to recall those data from the method...but I would avoid it.

I tried to look for any solution, but I could find one: is it there any specific SimTalk command, or any other way? ...Any idea??

Thank you for the attention!

 

A desperate thesist looking for help.

4 REPLIES

Re: Accessing a list within a Method, from another method

You could try byref, then you pass a reference to a parameter, instead of copying its value.

Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Accessing a list within a Method, from another method

By the way, you can also pass the local variable of type table as a parameter, or return it that way.

 

Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Accessing a list within a Method, from another method

I tried to fix it, but I did not get a solution by myself. I have uploaded a simple example of what I mean.

I have to access, for example, the table cell Operators[1,3] through the Method_B.

Do you have any clue??

Re: Accessing a list within a Method, from another method

[ Edited ]

Here have a look at the solution. It works now. What you need to understand it is that a table is valid as long as Method_A is being executed, if you want the value after that, you need to save it in a table. Otherwise, like I have done, you gotta call Method_B from WITHIN Method_A. Simply execute Method_A to see the result.

 

Cheers!