I think that the second _expression_ is what you want to use:

Invalid Boolean _expression_:
   <cfif (string1 OR string2 OR string3 OR string4) NEQ 1>CheckErgebnis =
''</cfif>

Valid Boolean _expression_:
   <cfif string1 NEQ 1 OR string2 NEQ 1 OR string3 NEQ 1 OR string4 NEQ
1>CheckErgebnis = ''</cfif>

Paul Kenney
WebMaster, CorporateWarriors.com
916-663-1963

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 4:36 AM
To: CF-Talk
Subject: OR NEQ cfif statement

Hi list, I am checking some
links in a link-database
with the following:

<cfquery name="GetData" datasource="#databasename#" dbtype="ODBC">
select *
from Links
</cfquery>
<cfloop query="GetData" startrow="1" endrow="#GetData.recordcount#">
<cfset URL_HTTPS = find("https", getdata.link)>
<cfif URL_HTTPS EQ 1><cfset port ="443"><cfelse><cfset port ="80"></cfif>
<cfhttp url="">         method="GET"
        port="#port#"
        resolveurl="true"
                timeout="10"
                throwonerror="No">
</cfhttp>

<cfparam name="String1" default="0">
<cfparam name="String2" default="0">
<cfparam name="String3" default="0">
<cfparam name="String4" default="0">
<cfset String1 = find("200", cfhttp.StatusCode)>
<cfset String2 = find("404", cfhttp.StatusCode)>
<cfset String3 = find("Connection Failure", cfhttp.StatusCode)>
<cfset String4 = find("Forbidden", cfhttp.StatusCode)>

        <cfquery name="Update" datasource="#databasename#" dbtype="ODBC">
                update Links SET
                <cfif String1 EQ 1>CheckResult = '200'</cfif>
                <cfif String2 EQ 1>CheckResult = '404'</cfif>
                <cfif String3 EQ 1>CheckResult = 'Failure'</cfif>
                <cfif String4 EQ 1>CheckResult = 'Forbidden'</cfif>
                <cfif (string1 OR string2 OR string3 OR string4) NEQ
1>CheckResult = ' '</cfif>
                where ID = #GetData.ID#
        </cfquery>

The statement <cfif (string1 OR string2 OR string3 OR string4) NEQ
1>CheckErgebnis = ''</cfif>
is causing some problems (sometimes) because from time to time
I get a syntax error in the update-statement.

Any ideas how to change it ?

Uwe
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to