NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Example using CaptionSource_MacroExpression anywhere?

Solved!
Go to solution

I'm using C# to develop a custom user interface and I'm trying to figure out how to pass a format expression (ie. "%ProgressTextLongName% %ProgressPercentLongName%") to the CaptionSources.CaptionSource_MacroExpression using

AxExecutionViewMgr's ConnectCaption() method and CaptionConnection's FormatExpression property. I'm using the following code to do so:

 

CaptionConnection cc = axExecutionViewMgr.ConnectCaption(axLabel2, CaptionSources.CaptionSource_MacroExpression, true);
cc.FormatExpression = "%ProgressTextLongName% %ProgressPercentLongName%";

 

But all the label says is "The expression cannot be empty". It says this even though I perform an execution of a sequence. Are there any examples that show how to use this macro expression anywhere?

0 Kudos
Message 1 of 3
(3,267 Views)
Solution
Accepted by topic author MSumulong

Just a guess, but since it is an expression, it probably needs quotes to make it a valid string expression:

 

cc.FormatExpression = "\"%ProgressTextLongName% %ProgressPercentLongName%\'";

0 Kudos
Message 2 of 3
(3,265 Views)

That worked! Thanks!

0 Kudos
Message 3 of 3
(3,240 Views)