heres what i'm trying to do

The app i'm building has to integrate with staffware (a workflow program),
it does this through a coded text file
e.g.
CHPART_DISC,50%
COLLAB, Y
CP_IADMN, N

Theres around 220 elements in total, all elements must be present in the
textfile even if the values are blank. As the user progresses through the
app, his selections are recorded in a structure (with the structure keys
representing the staffware code, as above).  Depending on the
process/selections of the user the content of the structure at the end will
change.  
e.g. he might only have
CHPART_DISC,50%
COLLAB, Y

I have a textfile listing all the required files which i have stored in a
structure with all the values blank, basically cause i wanted to use the
structure functions. At the end to make sure the structure has the required
content, I loop over the example structure adding the blank values where
necessary.
e.g. from the above example he would end up with
CHPART_DISC,50%
COLLAB,Y
CP_IADMN*,

*repeated per required field

The possible problem i'm looking at is that the example provided is not
aplhabetically sorted but the textfile i produced by looping over my
finished structure as writing to a textfile always is (unless i write it
individually per key, all 200+ !!).


I'm testing the textfile input later today, so i was just hoping there might
be a way to stop the structure alphabetically sorting, just in case
staffware needs the textfile to be in the same order

hope that explains it a bit better

Mark

-----Original Message-----
From: Stephen Moretti [mailto:[EMAIL PROTECTED]]
Sent: 04 April 2002 11:07
To: CF-Talk
Subject: Re: Structure Sorting


> Of course, coldfusion has to loop over the keys a certain way. It does it
alphabetically,
> but that is just the way it is done. If they do it some other way in MX,
you can't complain
> because structures are NOT oredered.
>

Pascal.  why does Coldfusion have to loop over the keys in a certain way?
The easiest way would be to display them in the order that they are entered
into the structure, not going out of its way to order them alphabetically,
which, incidentally, is exactly what its doing.

I just had a play with Mark's code and for whatever reason, whether you
return the key list, cfdump the struct variable or loop through the
collection, the list of keys always returns in alphabetic order.

Mark,
It shouldn't really matter what order the keys are returned in, because
that's only a reference to the contents the key is storing.  If the keys
("D, C, B, A") are actually the content then I suspect you may be getting
the wrong end of the stick with structures and, as Pascal says, you probably
should be using arrays.

Hope that helps

Regards

Stephen



______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to