Peter,
Yes, that is a known problem with the jaws script language. In doing a
string compare, JFW only looks at the beginning of the string so:
ABC is equal to ABCD because it is fully contained in the second string
but ABCD is not equal to ABC because it is not fully contained in the second
string.
Paste the following function into your default script. This is my string
compare function. It is a 3 state tester that can be used instead of using
equal to and not equal to.
In this function the length of the string as well as the content need to be
the same for a true result.
The third state is a case test. For that to be true, the strings need to
have the same content the same length and the same upper and lower case
letters.
;Daines 3 state String compare
;returns 0 if no match
;returns 1 if content and length match
;returns 2 if content, length and case match
Int Function StringCompare (string String1, string String2)
var int isSameWord
let isSameWord = 0
if string1 != string2 then ; the 2 strings are completely different
return isSameWord
elif StringLength (string1) == StringLength (string2) then ; The 2
strings are the same but the case is different
let isSameWord = 1
if StringContains (string1, string2) then ;The 2 strings are an exact
match
let isSameWord = 2
endif
return isSameWord
endif
EndFunction
> -----Original Message-----
> From: "Peter A. Torpey 716-422-0470" <[EMAIL PROTECTED]>
> Date: Mon, 6 Dec 1999 23:11:48 -0500 (EST)
> Subject: String Delimiters
>
> In a script I am writing, I have strongs of the form:
>
> abc:def
>
> which I would like to test for equivalence. The condition,
>
> if( "abc:def" == "abc" )
>
> tests as TRUE (which is wrong). How can I correctly
> compare two strings of the form abc:def ijk:lml without breaking
> them apart?
-
Visit the jfw ml web page: http://jfw.cjb.net