thanks Jim, but i am getting an error now, i will post the whole proc. From what i am understanding is that if i do a break then it will jump completely out of the loop, is that true? If so that is not what i want. Since this checks all possible dr fields in hl7.
Thanks
0:TEST] Tcl error:
msgId = message0
proc = ‘tpsSoft_DrNum_In’
args = ”
result = ‘wrong # args: should be “string equal ?-nocase? ?-length int? string1 string2″‘
errorInfo: ‘
wrong # args: should be “string equal ?-nocase? ?-length int? string1 string2”
while executing
“string equal [lindex $subfldList 0]”””
(procedure “FormatDrNum” line 5)
invoked from within
“FormatDrNum $repList $subSep”
(“PV1” arm line 16)
invoked from within
“switch -exact [lindex $fldList 0] {
PD1 {
if { [llength $fldList] >= [expr $PrimaryPos + 1] } {
;# 1) Get …”
(“foreach” body line 16)
invoked from within
“foreach segPos $PosList { ;# For Each Seg in List
if { $segPos > 0 } { ;# If the Segment was found
;# Spli…”
(“run” arm line 25)
invoked from within
“switch -exact — $mode {
start { }
run {
set mh [keylget args MSGID] ;# Get message handle from args
set dispList [list “CON…”
(procedure “tpsSoft_DrNum_In” line 52)
invoked from within
“tpsSoft_DrNum_In {MSGID message0} {CONTEXT sms_ib_data} {ARGS {}} {MODE run} {VERSION 3.0}”‘