Originally posted by Rick Pritchett
ia m trying to use the following proc in my xlate
######################################################################
# Name: OBX_Parser
# Purpose: <description>
# UPoC type: xltp
# Args: none
# Notes: All data is presented through special variables. The initial
# upvar in this proc provides access to the required variables.
#
# This proc style only works when called from a code fragment
# within an XLT.
#
proc OBX_Parser {} {
upvar xlateId xlateId
xlateInList xlateInList
xlateInTypes xlateInTypes
xlateInVals xlateInVals
xlateOutList xlateOutList
xlateOutTypes xlateOutTypes
xlateOutVals xlateOutVals
}
set newOBX5 ""
set newOBX5_2 ""
set newOBX5_3 ""
lassign $xlateInVals OBX5
set Pos2 [string last " " $OBX5 79]
set count1 [expr {$Pos2 + 79}]
set Pos3 [string last " " $OBX5 $count1]
set count2 [expr {$Pos3 + 79}]
set Pos4 [string last " " $OBX5 $count2]
if { [string length $OBX5] > 80 && [string length $OBX5] < 160 } {
#set Pos2 [string last " " $OBX5 79]
set newOBX5 [string replace $OBX5 $Pos2 $Pos2 ~]
set xlateOutVals
} elseif {[string length $OBX5] > 160 && [string length $OBX5] < 240} { set newOBX5 [string replace $OBX5 $Pos2 $Pos2 ~] set newOBX5_2 [string replace $newOBX5 $Pos3 $Pos3 ~] set xlateOutVals
} elseif {[string length $OBX5] > 240 } { set newOBX5 [string replace $OBX5 $Pos2 $Pos2 ~] set newOBX5_2 [string replace $newOBX5 $Pos3 $Pos3 ~] set newOBX5_3 [string replace $newOBX5_2 $Pos4 $Pos4 ~] set xlateOutVals
} else { set xlateOutVals
i call it with the following code in my xlatelassign $xlateInVals OBX5if { [string length $OBX5] > 79} {OBX_Parser } else { }for some reason it is not executed correctly. i have it in an iteration and it appears that it is not called each iteration. any ideas?