ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old April 21st, 2004, 01:42 PM
dave gadd dave gadd is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: scarborough
Posts: 3 dave gadd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question cfif(left( , 2))

Hi
have a problem, wondered if anyone could help.

I think the best way of explaining is to just show the code I am trying to work, I think the problem is then self explanatary.

<cfif (LEFT(neg, 2) EQ "AV" AND access GTE 4) OR (LEFT(neg, 2) NEQ "AV" or "DG" AND status GTE 4)>

(left neg, 2 does not equal either "av" or "dg") AND status of the rest must be gte 4

Thanks

Reply With Quote
  #2  
Old April 21st, 2004, 02:15 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,491 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 21 m 26 sec
Reputation Power: 42
<cfif (LEFT(neg, 2) EQ "AV" AND access GTE 4) OR (LEFT(neg, 2) NEQ "AV" AND LEFT(neg, 2) NEQ "DG" AND status GTE 4)>

Reply With Quote
  #3  
Old April 21st, 2004, 02:17 PM
campbelc campbelc is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 12 campbelc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
So, just to make sure I'm hearing you correctly, you would like to evaluate the variables neg and access and check for the following:

if left(neg,2) equals AV and access greater then or equal to 4 then qualify for this statement

or if left(neg,2) is not AV or DG but the status is still greater then 4 it's ok to qualify also

Right?

Reply With Quote
  #4  
Old April 21st, 2004, 02:34 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,491 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 21 m 26 sec
Reputation Power: 42
Each statement evaluates to true or false. When combined as an expression, the entire expression evaluates to true or false. So,

<cfif (LEFT(neg, 2) EQ "AV" AND access GTE 4) OR (LEFT(neg, 2) NEQ "AV" AND LEFT(neg, 2) NEQ "DG" AND status GTE 4)>

means that if the left 2 characters of neg are "AV" and access is GTE 4, then that statement is TRUE. The remainder of the statement does not even execute. However, if it is FALSE, then the remainder is executed. In that case, if the left 2 characters of neg are NOT "AV", and the left 2 characters of neg are NOT "DG", and the statues is GTE 4, then that statement is TRUE.

If neither of these two sets evaluate to TRUE, the if block is not executed.

Personally, when you start getting into convoluted logic like this to make a decision, that is a red flag to me that something should be simplified or refactored. But that is another topic.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > cfif(left( , 2))


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway