Author |
Topic |
|
Maxbrain0
USA
1 Posts |
Posted - 09/03/2009 : 10:57:35 AM
|
Origin Ver. and Service Release: Origin 8 SR 4 Operating System: Windows XP pro
I have created several LabTalk scripts to follow different import filters that determine from the data whether they pass or fail. I am able to determine the criteria and then display the pass/fail as a string or object on a template plot. I was looking for a way to make make the text or text box to be one color for pass and one color for fail, instead of just displaying the text.
Here's some of examples of what I'm doing at the end of the code and how I need to change the color.
For example if(gain_30>=gain_3dB && gain_330>=gain_3dB) page.info.user.variables.bandwidth$ = "PASSES 30 degree,3 dB bandwidth spec"; else page.info.user.variables.bandwidth$ = "FAILS 30 degree,3 dB bandwidth spec";
if(gain_60>=-15 && gain_300>=-15) page.info.user.variables.rolloff$ = "PASSES 60 degree,-15 dBi spec"; else page.info.user.variables.rolloff$ = "FAILS 60 degree,-15 dBi spec";
I then display the desired strings in the template.
I also can do something similar with objects, as follows.
if((stats.max<lim_max)) passfail.text$ = "Passed, data is < $(lim_max)"; else passfail.text$= "Failed, data is not < $(lim_max)";
Any help is greatly appreciated.
Jacob
|
|
greg
USA
1379 Posts |
Posted - 09/14/2009 : 10:30:44 AM
|
Just use escape sequences to add formatting to your strings. To add color (Blue = Pass, Red = Fail) use:
if(gain_30>=gain_3dB && gain_330>=gain_3dB) page.info.user.variables.bandwidth$ = "\c4(PASSES 30 degree,3 dB bandwidth spec)"; else page.info.user.variables.bandwidth$ = "\c2(FAILS 30 degree,3 dB bandwidth spec)"; |
|
|
|
Topic |
|
|
|