Hello,
Currently, table checkpoints cannot automatically compare values in the locale-concerned manner. However, to perform such a comparison, there is no need to keep several locale-dependent variants of the baseline table. Using the
Table.Values property, you can modify values read from the baseline table and then use the modified table during the comparison. For instance, the script substituting decimal separators in one of the columns would be as follows:
function CompareWithReplacing()
{
var Table, FloatColumnIdx, SDec;
...
// Obtain the Table object
Table = Tables.Table1;
// Obtain the current value of the decimal separator
SDec = aqEnvironment.GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL)
// Once the separator differs from "."
if (SDec!=".")
{
// Substitute the values in the column with floating-point data
Table.Values(i, FloatColumnIdx)=ReplaceChr(Table.Values(i, FloatColumnIdx), ".", SDec);
}
// Perform the comparison
Table.Compare();
...
}
// Helper routine that replaces all occurrences
// of one character with another character.
function ReplaceChr(Str, InChr, OutChr)
{
var Result, I, C;
Result = "";
for (I = 0; I < Str.length; I++)
{
C = Str.substring(I, I + 1);
if (C == InChr) C = OutChr;
Result = Result + C;
}
return Result;
}
Regards, Artem.