Hi all,

I 'm stuck. The below code reads and displays the contents of my database.


<cfquery name="GetFontFamily" datasource="fontstyles">
        SELECT      sti, ID
        FROM        fontsti
        ORDER BY sti
</cfquery>

<cfoutput query="GetFontFamily">
        <input type="hidden" name="ID" value="#GetFontFamily.ID#">
        [#GetFontFamily.ID#] #GetFontFamily.sti#<br>
</cfoutput>

This displays something like...

  [1] aachen.sti
  [2] accolade.sti
  [3] adelon.sti
  [4] amelia.sti
  [5] american-unciale.sti
  [6] angelo.sti
  [7] avantgarde.sti
  [8] ballantines.sti
  [9] bamberg.sti
  [10] baskerville.sti
  [11] bauhaus.sti
  [12] belfast.sti
  [13] bernstein.sti
  [14] birch.sti
  [15] Blackoak.sti
  [16] boascript.sti
  [17] bodoni.sti
  [18] bookman.sti
  [19] borderpi-15159.sti
  [20] boutique.sti

I have an external file that I'm reading in that I want to compare against 
the above list and display the appropriate ID numbers. Below is the 
contents of my ASCII file and the code.

file.txt
--------
amelia
angelo
ballantines
baskerville
belfast


<cfoutput>
<!--- READ .STM FILE AND DISPLAY CONTENTS --->
<cffile action="READ"
          file="#DosPath#\#FileNameOnly#"
          variable="ReadMe">
                 <cfset listDelim = Chr(13) & Chr(10)>
                        <cfloop list="#ReadMe#" index="i" delimiters="#listDelim#">
                                <input type="checkbox" name="select" 
value="#Trim(i)#.sti">[#GetFontFamily.ID#] #Trim(i)#.sti<br>
                                <input type="hidden" name="select" 
value="#Trim(i)#.sti">
                        </cfloop>


This is what gets displayed:

[1] amelia
[1] angelo
[1] ballantines
[1] baskerville
[1] belfast

How can I display the following?

  [4] amelia
  [6] angelo
  [8] ballantines
  [10] baskerville
  [12] belfast

______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to