Originally posted by Jason Bond
I have a proc I'm calling within a copy command in a XLT. The proc searches the field specified in the copy command for the word "Procedure:", and returns a "1" if it finds it. I'm using this in a repeating OBX segment. It works fine the way it is, what I need though is to be able to specify more than one value or string to search for. In other words, I want it to search for, in this example, the word "Procedure:" or the word "Left", and so on. I'm copying the proc below, it's a very simple string match proc.
thank you all,
Jason
######################################################################
# Name: cpacs_string_reports
# 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 cpacs_string_reports {} {
upvar xlateId xlateId
xlateInList xlateInList
xlateInTypes xlateInTypes
xlateInVals xlateInVals
xlateOutList xlateOutList
xlateOutTypes xlateOutTypes
xlateOutVals xlateOutVals
set xlateOutVals [string match "*Procedure*" $xlateInVals]
echo in $xlateInVals
echo out $xlateOutVals
}