#1
  1. No Profile Picture
    mdinsua
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    1
    Rep Power
    0

    a cfscript question



    new at this and could use a nudge in the correct direction as to what I did wrong. setup a cfscript tag as follows:

    <cfscript>
    divisionManagers = arrayNew(1);

    divisionManagers[1] = "Here lies the contect that describes the first of 9 division managers (and they all look like this).";

    function showDivision()
    {
    If (IsDefined("url.intDivNum") And (("url.intDivNum") lte 9) And (("url.intDivNum") gte 1))

    WriteOutput(divisionManagers[url.intDivNum]);

    Else

    WriteOutput('Click on the division name to see more information.');
    }
    </cfscript>

    with a cfoutput tag calling the function name, and all it'll display is the else part of the function.

    Any assistance would be appreciated.
  2. #2
  3. No Profile Picture
    Chris
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Location
    Florida
    Posts
    2
    Rep Power
    0

    script question answered...


    Your if is testing the actual string "url.intDivNum" instead of its value. Try the line below.

    If (IsDefined("url.intDivNum") And (url.intDivNum lte 9) And (url.intDivNum gte 1))

    You also might be better off to always use cfparam for all expected variables in a page. ie at the top of the code:
    <cfparam name="url.intDivNum" value=0>

IMN logo majestic logo threadwatch logo seochat tools logo