Skip to main content
October 9, 2008
Question

Array issue

  • October 9, 2008
  • 10 replies
  • 473 views
What's the problem with my array code attached, figure they have been around for so many years I should probably learn how to use them.
    This topic has been closed for replies.

    10 replies

    Inspiring
    October 9, 2008
    > ok so you couldn't just point out the mispelling?

    Um, hello? What do you think I was doing?

    All you had to do was to do what I asked. But you didn't bother.

    Sorry, but I have very little patience for people who expect others to help
    them, but aren't prepared to put a bit of effort in for themselves.

    I am however pleased you finally spotted it, and also seem to have cracked
    your subsequent issue also.

    Best of luck with the rest of it. I do recommend that you reconsider your
    2-D array approach here.

    --
    Adam
    October 9, 2008
    NM I got it.
    October 9, 2008
    ok so you couldn't just point out the mispelling?

    Now I am getting:

    The element at position 1, of dimension 2, of an array object used as part of an expression, cannot be found.
    Inspiring
    October 9, 2008
    > No I was asking you told me to look at my code closely and I was wondering what problem you saw with it as I am unfamilar with arrays and was asking for help.

    For goodness sake, mate.

    What's the name of the variable in this line of code:
    <cfset my2darray=arraynew(2)>

    And what's the name of the variable in THIS line of code:
    <cfset my2darrry[1][1] = "Catalog Title">

    Are they the same? No.
    Do you think perhaps that might be your problem?

    --
    Adam
    October 9, 2008
    No I was asking you told me to look at my code closely and I was wondering what problem you saw with it as I am unfamilar with arrays and was asking for help.
    Inspiring
    October 9, 2008
    >> <cfset my2darray=arraynew(2)>
    >> <cfset my2darrry[1][1] = "Catalog Title">

    > Please advise what is the problem with my code?

    I think the problem is that you're not actually looking at it, as much as
    anything else.

    *look at it*.

    --
    Adam
    Inspiring
    October 9, 2008
    PopcornCoder wrote:
    > Please advise what is the problem with my code?

    What is the error you are getting.
    Inspiring
    October 9, 2008
    Adam Cameron wrote:
    >> <cfset my2darray=arraynew(2)>
    >> <cfset my2darrry[1][1] = "Catalog Title">
    >
    > You might want to look closer at your code.
    >
    > Also, when you have a problem, it's helpful if you tell us what the problem
    > actually is, not simply say "I have a problem, what is it?".

    Really!!! because even with Adam point out the spot I could not see the
    problem the first four times I looked at it. Since I did not really
    know for what I was looking. Knowing the error would have guided me
    much faster to this issue.

    >
    > Thirdly: an array is really not the best data structure for you to be using
    > here. It looks more like it should be a struct, or perhaps an array of
    > structures to me.
    >

    A valid point, but that sure looks like a foobar|hello world example to
    practice a new skill and as such is fine. But I agree, if I where
    looking at a requirement like this I would probably be looking at using
    a structure, aka a hash array. I.E. using strings as index keys rather
    then integers.


    October 9, 2008
    Please advise what is the problem with my code?
    Inspiring
    October 9, 2008
    > <cfset my2darray=arraynew(2)>
    > <cfset my2darrry[1][1] = "Catalog Title">

    You might want to look closer at your code.

    Also, when you have a problem, it's helpful if you tell us what the problem
    actually is, not simply say "I have a problem, what is it?".

    Thirdly: an array is really not the best data structure for you to be using
    here. It looks more like it should be a struct, or perhaps an array of
    structures to me.

    --
    Adam