01-10-2023 05:47 PM - edited 01-10-2023 05:56 PM
I have a code that verifies if PropertyExists for PropertyExists("FileGlobals.Registers.DUT[\"PARTID\"].Address"). The problem I am facing is that "PARTID" is a parameter that is updated from the above subsequence which I call Parameters.regName_in. Parameters.regName_in is of type string. If I use the viewer to verify the boolean on PropertyExists("FileGlobals.Registers.DUT[\"PARTID\"].Address") it is true, but I use the viewer to verify the boolean on PropertyExists("FileGlobals.Registers.DUT[Parameters.regName_in].Address") then it is false. From what I can tell it is missing the \" from the naming. This is something that is hard to add since Parameters.regName_in is dynamically loaded from an excel sheet. I should also note that the DUT variable is a container and I use the Parameters.regName_in to reference the location for a specific variable of type number (Address) under that location.
Is there a way to reference the string variable in a PropertyExists execution?
01-11-2023 01:58 AM
PropertyExist(Evaluate(""))
01-11-2023 02:30 PM
Hey Bienieck,
This still does not work. I tried the expression: (Evaluate("FileGlobals.Registers.DUT[Parameters.regName_in].Address")) which does give out the correct number. Then I tried adding the Property Exists function which fails as a string is expected and not a number. So afterwards I tried adding /" to the " in the Evaluate portion as follows: PropertyExists("Evaluate(\"FileGlobals.Registers.DUT[Parameters.regName_in].Address\")") hoping it would fix the issue. Nevertheless, I still get False on what should be a True boolean. I also tried using the Evaluate on the Parameters.regName_in portion only to no avail as follows: PropertyExists("FileGlobals.Registers.DUT[Evaluate(\"Parameters.regName_in\")].Address")
Any other ideas or how to fix it?
01-11-2023 06:22 PM - edited 01-11-2023 06:26 PM
Try PropertyExist(Str(Parameters.regName_in, "FileGlobals.Registers.DUT[\"%s\"].Address"))
My previous reply was incorrect. Sorry.
I don't have TS to test this but you will figure it out 😉