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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

~ seperator

Status
Not open for further replies.

snowingnow

Programmer
Jun 1, 2006
32
CA
I have following code:
...
set PIDf105 "AAA"
set PIDf106 "BBB"
set PIDf107 "CCC"
set PIDf106_out $PIDf105\x7e$PIDf106\x7e$PIDf107
set msg [replaceHL7Field $msg PID 3 PIDf106_out]


I Like to see ||AAA~BBB~CCC||
But i return as ||AAA||

If i not use \x7e such as use >, it return correct format
||AAA>BBB>CCC||, but not the "~"

Any ideal/
 
I'm not sure what you are doing in this stmt ...
set msg [replaceHL7Field $msg PID 3 PIDf106_out],
but this works for me:

set A "aaa"
set B "bbb"
set C "ccc"
set L "[list $A $B $C]"
--> aaa bbb ccc

Then, either of the following two join stmts. work for getting the "~" between each variable:
(I was thinking you may need to escape the tilde, but you don't)

set JL1 "||[join $L ~]||"
--> ||aaa~bbb~ccc||

set JL2 "||[join $L \~]||"
--> ||aaa~bbb~ccc||
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top