NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

String formatting functions for ASCII Reports in TestSatnd 4.0

Hi,

I am trying to create ASCII text reports that shall contain a list of instruments and their parameters in a tabular form (as shown below). Is there any function available for string formatting that is readily available to format the strings in a way that they are alinged in a way to give a tabular look. Using "\t" between the details listed gives a very uneven look.

-----------------------------------------------------------------------------------------------
Name         Param1        Param2       Param3      Param4       Param5
-----------------------------------------------------------------------------------------------

Instru1        Xxxx            XXXXXX       X                 XXXXXX        XXX
Instru 2       YYYYYY      YYYY             YYYYYY    YYY               YYYYYY 


Thanks
Saranya


Message Edited by SaranCh on 04-23-2008 12:32 AM
0 Kudos
Message 1 of 3
(3,271 Views)

You could use Str() to put strings within fixed width columns. Examples for left and right justification:

"|" + str("MyValue","%-40s")+"|"         

-->

|MyValue                                 |

 

"|" + str("MyValue","%40s")+"|"         

-->

|                                 MyValue|

 

0 Kudos
Message 2 of 3
(3,257 Views)
Thanks!! This one works.
0 Kudos
Message 3 of 3
(3,237 Views)