instr error

Hello,

When I try to use the instr function in vbscript...

dim txt,pos
txt="This is a beautiful day!"
pos=InStr(txt,"his")

as per W3Schools.com (www.w3schools.com/vbscript/func_instr.asp)

I get this error message...

An error occurred while processing the script: Save broker detail
The error message was: Scripting engine failure
Courtesy of Java: method name:Log: 18:0
Java Exception: class java.lang.IllegalArgumentException java.lang.ClassCastException@181913

(scode=0x80020009 wcode=0x0)

I do have the langauge set to VBscript. When I comment the Instr line out I get no error.

Any help would be great.

instr error

lincolnave,

Thanks for the heads up.

-Scott

wait 1 second...

Thanks Scott,

That makes sense, but what I should have posted was....

pos=Instr("this is text","h",1)

I have found out that the '1' was my problem for some reason. I found it on another board that the 1 (text compare) can cause a problem giving a type mismatch error.

It is working fine and hope this helps someone else...

Thanks Again

LincolnAve

instr error

lincolnave,

I tried your code in a test script and it didn't throw an error for me. The error message you're getting seems to be referring to your use of a method named "Log" on line 18.

Does that make sense?

-Scott