Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Need some clarifications on SimTalkType for lists and tables

Pioneer
Pioneer

Hi Guys !

 

I have a question regarding the SimTalk types of two attributes (one is of attrType "table", the other "list"):

 

 

a.jpg

 

print getSimTalkTypename(self.t) -- prints "list"
print getSimTalkTypename(self.l) -- prints "list"
print "______________________"
print self.getAttrType(self.getAttrNo("t")) -- prints "table"
print self.getAttrType(self.getAttrNo("l")) -- prints "list"

 

Something doesn't seem clear to me, the distinction between lists and tables exists in the attrType but not in the SimTalk syntax (both are of SimTalkTypename "list").

I understand that probably in the core of SimTalk, a list is only a specific case of a table (1 column) but the fact that lists and tables are differenciated in attrTypes can lead to confusions.

 

Example: I have a method which has N params, an array containing some of these N param names is declared in the method and I want to browse this array and act according to the param type. One param is a list and the other one is a table but the SimTalkTypename is "list" for both of them...

We changed the way this method is written so it's not a problem anymore for us but I still want to know what you think about this. Maybe your clarifications will put my mind at peace Smiley Very Happy

 

Thanks !

4 REPLIES

Re: Need some clarifications on SimTalkType for lists and tables

Siemens Phenom Siemens Phenom
Siemens Phenom

You are right that this is a bit confusing. Nevertheless we do not want to change the behavior of getSimTalkTypeName for compatibility reasons. You can use the SimTalk function isTable to check if a variable or attribute is a table. The SimTalk functions isList, isStack, isQueue check for lists, queues, stacks.

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Need some clarifications on SimTalkType for lists and tables

Pioneer
Pioneer
Thanks for the reply. At least, I'm reassured that you find this possibily confusing too. I decided to create my own version of getSimTalkTypeName which uses isTable, isQueue, etc... and returns the same as getSimTalkTypeName but distinguishes between tables, lists, stacks, queues.

Re: Need some clarifications on SimTalkType for lists and tables

Siemens Phenom Siemens Phenom
Siemens Phenom

We talked about getSimTalkTypeName and we came to the conclusion that the current behavior is unreasonable. We decided to change the behavior in version 14.2.

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Need some clarifications on SimTalkType for lists and tables

Pioneer
Pioneer

Glad to see you guys are being flexible about the whole "backward compatibility" dilemma.