Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Foreach loop with a tbllookup.

Status
Not open for further replies.

kcrist84

Programmer
Jul 14, 2008
6
0
0
US
I am trying to loop through a certain field and get a dr. number out. This is an hl7 message and this field can repeat any number of times or none.

foreach Dr $OBRDrList {

set DrNumber [lindex [split $Dr $subSep] 0]
lappend DrCCList $DrNumber
echo DrCCList: $DrCCList
}


set value3 [tbllookup $table $Dr]
echo value3: $value3

if { $value3 eq "YES"} {
set dispList "CONTINUE"

break
}


echo dispList: $dispList
lappend dispList "$disp $mh"


What i am getting when echoing is:
DrCCList: 1234
DrCCList: 1234 1111
DrCCList: 1234 1111 2222
DrCCList: 1234 1111 2222 3333
DrCCList: 1234 1111 2222 3333 4444

i think when i do the tbllookup that it is looking at it as on big string, i want to pass the message on if any of the numbers is in a certain table. Hopefully this makes sense.

Thanks for any ideas.
 
It makes no sense to me. What is "tbllookup"?

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top