Loading Strings from a Text File

With PC-DMIS, you can load custom strings from a comma separated value (CSV) text file and display them inside of a customized label. This is very handy if you need custom strings displayed in a different language. To do this, just localize the csv file and provide it to the operator.

The Syntax

The USERSTRING function takes two parameters:

=USERSTRING(<expression1>,<expression2>)

The CSV File

The csv file must contain on an individual line: the unique index number, then the comma, and then the string.

To define multi-line strings, use the new line character (\n).

For example, consider this sample CSV file:

10,The universe is your playground.

1,Place the part on the table.

3,This is a \nMulti-line string.

...

230,"Bleeding Edge. Cutting Edge."

200,Circle 6001

201,5+5

 

Notice that the numbers preceding each string don't need to be sequential; they only need to be unique. Quotation marks and other characters will come through as typed in the CSV file. Numbers are not mathematically evaluated.

An Example

Suppose the above CSV file was stored in your d:\temp\ directory with a file name of MyStrings.csv. If you wanted to display four different custom strings in a label, your expressions in the cells of the GridControlObject on that label might look like this:

=USERSTRING("d:\temp\MyStrings.csv",1)

=USERSTRING("d:\temp\MyStrings.csv",3)

=USERSTRING("d:\temp\MyStrings.csv",230)

=USERSTRING("d:\temp\MyStrings.csv",201)


Your label, once evaluated would look like this: