I was hoping someone here could see something that I’m not seeing in my code which is producing an infinite loop?
set NTE $xlateInVals
while {[string length $NTE] > 0} {
set xlineLastSpaceIndex [string last x20 [string range $NTE 0 79]]
set RLK [string range $NTE 0 $xlineLastSpaceIndex]
regsub -all — $RLK $NTE “” NTE
append RLK \.br\ $RLK
}
set xlateOutVals [list [string map {{ “” { “”} $RLK]]
What I am trying to accomplish is, iterating through a long string and inserting line break codes, at the last white space within each set of the proceeding 80 characters.
I plan to insert the code above as a Pre Proc within an xlate.
If anyone could help me in tweaking the code so it works it would be greatly appreciated, I’ve been debugging for the past two days and am unable to see what I am missing.
Thank you.