Prev: Combinations
Next: 7-bit and News Servers
From: Helmut Meukel on 2 Jun 2010 14:24 "Dennis Rose" <Dennis Rose(a)discussions.microsoft.com> schrieb im Newsbeitrag news:1EDE11CE-8D50-4A18-B59C-95C45B849EFC(a)microsoft.com... > The code I am using is" > SearchString = "<name part="first">" > StringPos = Instr(1, InputDataLine, StringSearch) > If StringPos > 0 then ...... > After reading your answer to Patrice post I reread your original post (above) and noticed you didn't copy-and-paste your code. How *exactly* looks your code? If the above is *really* your code, then it never will work: SearchString isn't StringSearch Helmut.
From: Larry Serflaten on 2 Jun 2010 15:12 "Dennis Rose" <Dennis Rose(a)discussions.microsoft.com> wrote > The code I am using is" > SearchString = "<name part="first">" > StringPos = Instr(1, InputDataLine, StringSearch) > If StringPos > 0 then ...... As Helmut points out, SearchString is not the same variable used in both cases. Once you fix that, then the double quote solution the others suggest will work... LFS
From: Dennis Rose on 2 Jun 2010 15:30 Input XML formatted Email: <customer> <contact> <name part="first">Lisa</name> My actual Code: FirstNameStartID = "<name part=" & Chr(34) & "first" & Chr(34) & ">" 'FirstNameStartID = "<" & frmLeadServiceToProspect.txtLeadsFirstName & ">" StringStart = InStr(1, txtShowPrintArea, FirstNameStartID) If StringStart > 0 Then ...... It still doesn't work!! "Helmut Meukel" wrote: > "Dennis Rose" <Dennis Rose(a)discussions.microsoft.com> schrieb im Newsbeitrag > news:1EDE11CE-8D50-4A18-B59C-95C45B849EFC(a)microsoft.com... > > > The code I am using is" > > SearchString = "<name part="first">" > > StringPos = Instr(1, InputDataLine, StringSearch) > > If StringPos > 0 then ...... > > > > After reading your answer to Patrice post I reread your > original post (above) and noticed you didn't copy-and-paste > your code. How *exactly* looks your code? > > If the above is *really* your code, then it never will work: > SearchString isn't StringSearch > > Helmut. > > > . >
From: Henning on 2 Jun 2010 15:42 "Dennis Rose" <DennisRose(a)discussions.microsoft.com> skrev i meddelandet news:B434CA20-E084-4435-9DC1-1CE8B80BE323(a)microsoft.com... > Thanks for the reply. > I can see <name part="first"> in the data string that I am searching so I > know it is there. I tried it again and it does not work with double > quotes > around the word "first". > > > "Patrice" wrote: > >> Hello, >> >> > <name part="first"> >> > >> > The quotes around the word "first" are causing the instruction to fail. >> >> You can include " in a literal string by using "" (double the double >> quote >> character). Here it will be : >> >> SearchString = "<name part=""first"">" >> >> > I have checked Google and tried single quotes and double quotes and >> > chr(34) >> > around around the word "first" all with no success. >> >> If you really tried >> >> SearchString = "<name part=""first"">" then it could be be that you >> really >> don't have this string in "InputDataLine". >> >> For example could it be that you are searching actually for : >> <name part="first"/> >> >> Note the trailing /> rather than just > >> >> What if you try with hardcoded values to make sure this is not just that >> InputDataLine doesn't contain what you think ? >> >> -- >> Patrice >> If you can see the <name part="first"/> in the InputDataLine string, isn't it possible that string itself is <name part=""first""/>. Then searching will not find the searchstring. /Henning
From: Henning on 2 Jun 2010 16:12
What if you divide the problem. First SearchFor = "name part =", when found you know you got the correct line. Then SearchFor = "first" last find ">" and the following "<", the inbetween string is "Lisa". That way you don't have to deal with "'s in the string. /Henning "Dennis Rose" <DennisRose(a)discussions.microsoft.com> skrev i meddelandet news:093C68FF-7789-409F-8E10-A86681CB872B(a)microsoft.com... > Input XML formatted Email: > > <customer> > <contact> > <name part="first">Lisa</name> > > > My actual Code: > FirstNameStartID = "<name part=" & Chr(34) & "first" & Chr(34) & ">" > 'FirstNameStartID = "<" & frmLeadServiceToProspect.txtLeadsFirstName & ">" > StringStart = InStr(1, txtShowPrintArea, FirstNameStartID) > If StringStart > 0 Then ...... > > It still doesn't work!! > > "Helmut Meukel" wrote: > >> "Dennis Rose" <Dennis Rose(a)discussions.microsoft.com> schrieb im >> Newsbeitrag >> news:1EDE11CE-8D50-4A18-B59C-95C45B849EFC(a)microsoft.com... >> >> > The code I am using is" >> > SearchString = "<name part="first">" >> > StringPos = Instr(1, InputDataLine, StringSearch) >> > If StringPos > 0 then ...... >> > >> >> After reading your answer to Patrice post I reread your >> original post (above) and noticed you didn't copy-and-paste >> your code. How *exactly* looks your code? >> >> If the above is *really* your code, then it never will work: >> SearchString isn't StringSearch >> >> Helmut. >> >> >> . >> |