Found the solution.  I'd been working from one line code samples and just
realized I needed to encapsulate my code block with curly-brackets.
The first line after the if statement wasn't executing and I had thought it
was a debugger quirk.  (silly me)

Sorry for wasting bandwidth...

>  -----Original Message-----
> From:         Kevin Gilchrist  
> Sent: Monday, January 22, 2001 12:09 PM
> To:   CF-Talk (E-mail)
> Subject:      Why doe my cfscript if statement fail?
> 
> Hi There,
> 
> I'm trying to find why this if condition keeps getting evaluated as true
> when it shouldn't.  I've traced through the debugger to track the value of
> the if condition and even though the record count condition comes up as 0
> when I put a watch on it, it still executes.  
> I added a CFOUTPUT between the query and the <CFSCRIPT> and it always
> returns a 0 on the page too.
> 
> <!--- Check if we're monitoring NT --->
> <cfquery name="Check_NT" datasource="#dsn#" dbtype="#driver_type#">
>       select distinct system_type from uv_system_all
>       where system_type='NT'
> </cfquery>
> 
> <cfoutput>#Check_NT.RecordCount#</cfoutput>
> 
> <!--- If we count one or more we add it to an array of structures --->
> <CFSCRIPT>
>       if (Check_NT.RecordCount gt 0 is "TRUE")
>               session.device_view_list[#device_no#]=StructNew();
>               StructInsert(session.device_view_list[#device_no#],
> "monitored", "TRUE");
>               StructInsert(session.device_view_list[#device_no#],
> "description", "NT Servers");
>               StructInsert(session.device_view_list[#device_no#],
> "icon_filename", "../images/med_icons/icon_fileserver");
>               device_no=device_no + 1;
>               // Note, the icon filename is incomplete because the status
> color and the .gif will be appended later
> </CFSCRIPT>
> 
> Would appreciate any help as this is my first time putting my hand to
> cfscript...
> 
> Thanks,
> Kevin
> 
> Kevin Gilchrist,
> Senior Consultant
> RedSiren Technologies,
> www.redsiren.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to