INSTR?

1. Member
Join Date
Dec 1969
Posts
58

## INSTR?

I am trying to do an IF statement that says...<BR><BR><BR><BR>IF Instr(strTest,"59") = TRUE THEN<BR>......<BR>END IF<BR><BR><BR>Cause for ex: strTest = "mn,1414,59,37,LA" The variables change and go in different locations. How would I do this?<BR>

2. Senior Member
Join Date
Dec 1969
Posts
225

## RE: INSTR?

http://www.devguru.com/Technologies/vbscript/quickref/instr.html<BR><BR>Use this site religiously.

3. Member
Join Date
Dec 1969
Posts
58

## Thanks!

THANKS!!!!

4. Senior Member
Join Date
Dec 1969
Posts
225

.

5. Member
Join Date
Dec 1969
Posts
58

## Ahhh. Wait a sec.

It works for the first time and the others below it does not work.<BR><BR>This is what I have....<BR><BR>The string consists of.....<BR><BR>"59, 80,,,"<BR><BR>It works for the first number and that is it. Do you know what I have to do?<BR><BR>&#060;% If InStr(1, Request.Form("FormFilingNumber"), "59", 0) = 1 THEN %&#062;<BR>&#060;!--#include file="Inc59.asp"--&#062;<BR>&#060;% END IF%&#062;<BR><BR>&#060;% If InStr(1, Request.Form("FormFilingNumber"), "38", 0) = 1 THEN %&#062;<BR>&#060;!--#include file="Inc38.asp"--&#062;<BR>&#060;% END IF%&#062;<BR><BR>&#060;% If InStr(1, Request.Form("FormFilingNumber"), "80", 0) = 1 THEN %&#062;<BR>&#060;!--#include file="Inc80.asp"--&#062;<BR>&#060;% END IF%&#062;<BR><BR>&#060;% If InStr(1, Request.Form("FormFilingNumber"), "26", 0) = 1 THEN %&#062;<BR>&#060;!--#include file="Inc26.asp"--&#062;<BR>&#060;% END IF%&#062;

6. Senior Member
Join Date
Dec 1969
Posts
225

## RE: Ahhh. Wait a sec.

Might not be the best person to answer this, try Atrax or Reaperman, but I don&#039;t think you can dynamically include "include" files like that.<BR><BR>Anyway - besides that Instr returns the location that it was found at, not 1 or 0 for true or false.<BR><BR>Use If instr(blah) &#062; 0 then<BR><BR>James.

7. Senior Member
Join Date
Dec 1969
Posts
16,931

## RE: Ahhh. Wait a sec.

There&#039;s an FAQ on this.<BR><BR>Basically it&#039;s possible if the includes contain certain data, but it&#039;s not a good habit to get into unless you really understand what&#039;s going on there (otherwise you will end up with unexpected happenings in the future!).<BR><BR>The answer to his problem is as you posted though, James.<BR><BR>Craig.

8. Member
Join Date
Dec 1969
Posts
58

## RE: Ahhh. Wait a sec.

Actually you can dynamically include the "include" files.<BR><BR><BR>John-

9. Senior Member
Join Date
Dec 1969
Posts
16,931

## Actually

No you can&#039;t.<BR><BR>You may get that impression from what you&#039;re doing, but trust me, you can&#039;t. Check the FAQ on it.<BR><BR>Craig.

10. Senior Member
Join Date
Dec 1969
Posts
225

## RE: Actually

What are you trying to acheive John?

#### Posting Permissions

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