From: Dennis Rose on
Input XML formatted Email:

<customer>
<contact>
<name part="first">Lisa</name>


My actual Code:
FirstNameStartID = "<name part=" & Chr(34) & "first" & Chr(34) & ">"

StringStart = InStr(1, txtShowPrintArea, FirstNameStartID)
If StringStart > 0 Then ......

It still doesn't work!!


"Larry Serflaten" wrote:

>
> "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: dpb on
Dennis Rose wrote:
> Input XML formatted Email:
>
> <customer>
> <contact>
> <name part="first">Lisa</name>
>
>
> My actual Code:
> FirstNameStartID = "<name part=" & Chr(34) & "first" & Chr(34) & ">"
>
> StringStart = InStr(1, txtShowPrintArea, FirstNameStartID)
> If StringStart > 0 Then ......
>
> It still doesn't work!!
....

PLEASE DON'T TOP POST...makes hard thread follow does...

From immediate window...

s$="<name part=""first"">Lisa</name>"
?S$
<name part="first">Lisa</name>

id$ = "<name part=" & Chr(34) & "first" & Chr(34) & ">"
?instr(1,s$,id$)
1


One or the other of the strings isn't what you think it is, then.

Start w/ debugger and test the results of the variable holding the
searched string to confirm it is, indeed, as you think.

And, just to show it isn't the formatting of the search string, the
doubled-up quote version follows...

id$ = "<name part=""first"">"
?instr(1,s$,id$)
1

--
From: Dennis Rose on
Thanks for the tip!

It works fine by breaking up the line. The problem with this approach is I
have my code set up to insert different values in "FirstNameStartID"
depending on the vendor sending me the XML email.

I really need to be able to handle the quotes without breaking up the line.



"Henning" wrote:

> 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.
> >>
> >>
> >> .
> >>
>
>
> .
>
From: Henning on
???
First: SearchFor = "name part =", when found you know you got the correct
line.
Then: SearchFor = "first", if there are others like "last" this will
indicate the correct line.
Or SerchFor = "frmLeadServiceToProspect.txtLeadsFirstName", or whatever.
Last: find ">"

Wouldn't that be the same as searching for the whole string, if the rows
look as in the example?

/Henning

"Dennis Rose" <DennisRose(a)discussions.microsoft.com> skrev i meddelandet
news:7F84F0E2-798D-4740-9AD9-E5BF8D96EB22(a)microsoft.com...
> Thanks for the tip!
>
> It works fine by breaking up the line. The problem with this approach is
> I
> have my code set up to insert different values in "FirstNameStartID"
> depending on the vendor sending me the XML email.
>
> I really need to be able to handle the quotes without breaking up the
> line.
>
>
>
> "Henning" wrote:
>
>> 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.
>> >>
>> >>
>> >> .
>> >>
>>
>>
>> .
>>


From: Jim Mack on
Dennis Rose wrote:
> Thanks for the tip!
>
> It works fine by breaking up the line. The problem with this
> approach is I have my code set up to insert different values in
> "FirstNameStartID" depending on the vendor sending me the XML email.
>
> I really need to be able to handle the quotes without breaking up
> the line.

Odds are you're dealing with 'smart quotes' and not plain ASCII
quotes.

This "is" a test

....like those surrounding 'is' above. Find and replace...

--
Jim Mack
Twisted tees at http://www.cafepress.com/2050inc
"We sew confusion"



>
>
>
> "Henning" wrote:
>
>> 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.
>>>>
>>>>
>>>> .
>>>>
>>
>>
>> .

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7
Prev: Combinations
Next: 7-bit and News Servers