Because structs are pass-by-reference, so you only ever have one struct,
just with a lot of reference to it ('item' and each array element).  You
need to either move the 'item = structNew()' line inside the loop, or use
duplicate() in the arrayAppend() line.  The former should be faster, and
probably more readable as well.

barneyb
  -----Original Message-----
  From: Owens, Howard [mailto:[EMAIL PROTECTED]
  Sent: Friday, October 03, 2003 2:37 PM
  To: CF-Talk
  Subject: Array of Struts Question

  Why does this code:

  ad_ID = ArrayNew(1);
  item = StructNew();
  for (i=1; i LTE ArrayLen(image_ID); i=i+1) {
  item.ID = ListGetAt(image_ID[i], 1, "_");
  item.adRep = ListGetAt(image_ID[i], 2, "_");

  collection=ArrayAppend(ad_ID, item);

  }

  Create an Array with duplicate data in all elements instead of keeping
each
  the data from each pass through the data unique, as God intended?  The
last
  item is overwriting everything that proceeded it.  What can I do to get
what
  I want?

  H.

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Howard Owens
  Internet Operations Coordinator
  Ventura County Star / E.W. Scripps Co.
  www.venturacountystar.com
  [EMAIL PROTECTED]
  AIM: GoCatGo1956
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  > -----Original Message-----
  > From: Kevin Graeme [SMTP:[EMAIL PROTECTED]
  > Sent: Friday, October 03, 2003 1:16 PM
  > To: CF-Talk
  > Subject: Re: security flaw in web services
  >
  > > > It's been a
  > > > while since I've muddled with Kerberos so I don't know if there's a
  > clean
  > > > way to handle it for a web application. I know there are clients you
  > can
  > > > install that will handle the tickets, but I don't know what it would
  > take to
  > > > integrate them on the client side with the browser.
  > >
  > > It takes an experimental Mozilla netlib ;-)
  > >
  > > BTW, as of Win2K Windows authentication is largely based on
  > > Kerberos, with a few extensions. So if you use Integrated Windows
  > > Security, you are using Kerberos for browser authentication already.
  >
  > Interesting. Now that you mention it I do seem to recall now hearing
some
  > hubub about MS Security just being Kerberos. Do you have some quick
links
  > to
  > information about it? I'm assuming that MS just hard-coded their own
  > ticket
  > checker server since I haven't heard of having to designate one?
  >
  > -Kevin
  >
  >   _____
  >
  >

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

Reply via email to