Reply To: Regsub

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Regsub Reply To: Regsub

#59003
Charlie Bursell
Participant

    I would agree that the error may be coming from another part or the translation.  This normally happens when you use integer compares when you meant to do a string compare.  For example:

                 if {$str == “somevalue”} instead of

                 if {[string equal $str “somevalue”]}

    Use what I refer to as the binary search method.

    Copy your translate to a temporary file like XXX.xlt

    Cut the file in half.  Be careful to split on a statement border.  

    If the problem is still there then split it again.  If not load the 2nd half and make sure the error is there.

    Keep spliting the file.  In a very short time you can get it down to one or two statements.  After that it gets easier to figure out.

    FWIW, the statement “regsub — { } $xlateInVals {} xlateInVals” is fine if your intention is to convert xlateInVals from a list to a scalar variable.  

    Remember, all of the translate variables are *LISTS*.  And, list elements are delimited with whitespace.