Quantcast
Channel: NI TestStand topics
Viewing all articles
Browse latest Browse all 6524

SearchAndReplace String Variable

$
0
0

In the TestStand 2013 Process Model (NI_ReportGenerator), I am trying to modify the report after testing but before generating it. I've done this before in TS3.1/4.2 with no trouble but it's a bit trickier now.

 

This works on this variable which always exists at runtime:

 

Parameters.MainSequenceResults.TS.SequenceCall.SequenceFile= SearchAndReplace( Parameters.MainSequenceResults.TS.SequenceCall.SequenceFile, Locals.SequenceVA, FileGlobals.Parker.UUT.ReplaceWith )

 

However, the other variables may or may not exist so I generate them programatically. I make sure they exits, then do the same as above only I 'create' the name of the variable:

 

("Parameters.MainSequenceResults.TS.SequenceCall.ResultList[" + Str(Locals.Index) + "].TS.SequenceCall.SequenceFile")= SearchAndReplace(("Parameters.MainSequenceResults.TS.SequenceCall.ResultList[" + Str(Locals.Index) + "].TS.SequenceCall.SequenceFile"), Locals.SequenceVA, FileGlobals.Parker.UUT.ReplaceWith )

 

Doesn't work even though I've stepped through the sequence and verified the variable exists at run and matches the built string name.

 

Thinking the SearchAndReplace function was getting confused witht he Quotations I attempted to use an object reference to clean it up:

 

Locals.StringPointer=&("Parameters.MainSequenceResults.TS.SequenceCall.ResultList[" + Str(Locals.Index) + "].TS.SequenceCall.SequenceFile")

*Locals.StringPointer= SearchAndReplace(*Locals.StringPointer, Locals.SequenceVA, FileGlobals.Parker.UUT.ReplaceWith )

 

I verifed *Locals.StringPointer = to the variable name I am interested in.

 

I don't see the problem here. Is it just a limitation of SearchAndReplace? 

 

Any help appreciated, thanks.

 


Viewing all articles
Browse latest Browse all 6524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>