Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Equals Method in CE 10

Status
Not open for further replies.

nareshreporter

Programmer
Mar 3, 2005
13
0
0
US
Hi,
Im trying to compare two strings using Equals but didnt work.

Ex:
var str;
and this str stores the report parameter and i want to see whether it is "All".
so i am using

if(Equals(str, "All"))
{}

can anyone tell me how exactly i can use equals to compare two strings.

Thanks in advance
 
Never heard of it in Crystal, I think that you want another forum.

In Crystal you'd use the Report->Edit Selection Formula->Record and place:

(
If {?MyParamater} <> "All then
{table.field} = {?MyParamater}
else
If {?MyParamater} = "All then
true
)

This will pass the appropriate SQL to the database.

-k
 
Thanks for the response.

But I am not writing it in crystal reports formula. I need to compare the strings in .CSP code.
 
Hi,,
Using JavaScript or VBscript?

Try the
str.IndexOf("All") method in JavaScript -
If != -1 then All is in the str.


[profile]
 
// This is JavaScript
if (str == "All") {
alert("str equals All");
}
else if (str != "Foo") {
alert("str does not equal Foo");
}
else {
alert("I guess str must equal Foo");
}

Kingfisher [CECP]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top