I have a subroutine that I pass a string value from a skip list. That value is compared to objects in a Doors File. But the comparison does not work.
Skip split (string s, string delim)
{
Skip skp = create
int i = 0
Regexp split = regexp "^(.*?)" delim "(.*)$"
while (split s)
{
string temp_s = s[match 2]
put(skp, i++, s[match 1] "")
s = temp_s
}
put(skp, i++, s "")
return skp
}
string getInfo( string inStr)
{
for currObj in currMod do
{
if ( findPlainText( ( currOBJ.SW_VRC ""), inStr, offsetFromFind, lengthFromFind, false ) )
{
print currOBJ.SW_VRC " matches " inStr "\n";
}
}
}
Skip newLst = split(modname, ",") // this just splits a string input into parameters separated by commas
string inputInfo;
find(newLst, 0, inputInfo)
getInfo(inputInfo)
Now this is a simplified version of what I am doing. But the findPlainText does not match anything. inputInfo is getting the correct string, I checked. The part that really kills me is if I hardcode in the parameter
i.e. inStr = "21";
It works like it's supposed to. Now I was assuming a string is a string. Is there a difference between a string from a skip list and a string that's quoted? Is there a hidden character? What am I missing? Any insight you could provide would be welcome.
Thanks, DevM
your snippet works, but I had to add some variables to make it work, and I don't have a split function at hand:
Perhaps you removed too much information when preparing this post? Or you don't have an entry with the key "0" in newLst? What happens if you start your function with
?