Problems with Instr

1. Member
Join Date
Dec 1969
Posts
34

## Problems with Instr

Note: I posted this before but that was right before 12 hit, so it didnt get displayed...<BR><BR>The below code I&#039;m having a problem, whenever its executed it gives me an error Type mismatch: &#039;[string: "&#060;%"]&#039; <BR><BR>Which is this line: <BR><BR>if Instr(1, te1(I), "&#060;" & Chr(37), 1) &#062; 1 or InstrRev(1, te1(I), "&#060;" & Chr(37), 1) &#062; 1 then <BR><BR>Below is the entire script block <BR><BR>te1 = Split(te, Chr(10)) <BR>te1size = Ubound(te1) <BR>te1size = te1size - 1 <BR>For I = 0 to te1size <BR>if Instr(1, te1(I), "&#060;" & Chr(37), 1) &#062; 1 or InstrRev(1, te1(I), "&#060;" & Chr(37), 1) &#062; 1 then <BR>te1(I) = replace(te1(I), "&#060;" & Chr(37), Chr(10) & "&#060;" & Chr(37) & Chr(10)) <BR>end if <BR><BR>if Instr(1, te1(I), Chr(37) & "&#062;", 1) &#062; 1 or InstrRev(1, te1(I), Chr(37) & "&#062;", 1) &#062; 1 then <BR>te1(I) = replace(te1(I), Chr(37) & "&#062;", Chr(10) & Chr(37) & "&#062;" & Chr(10)) <BR>end if <BR>Next <BR>te = Join(te1, Chr(10))

2. Junior Member
Join Date
Dec 1969
Posts
4

## RE: Problems with Instr

This code looks alot more complicated (and error prone) than it should be. What do you want to do? I&#039;ll write some new code.

3. Member
Join Date
Dec 1969
Posts
34

## RE: Problems with Instr

thats alright I already started re-writing it... this is one of those deals where I want to do this on my own, not have somebody do it for me. I just ran into a problem I didnt know how to fix :) and the code isnt complicated, it just looks that way becuase I use Chr(37) alot, becuase I ran into complications just using %.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•