Exporting information to a file with iFILE
Using iHTML, exporting database or user inputted information to a file is easy.

For this example, we will export a column called "name" from a table called db_table into a text file. First we will set "OP=write" to create the file, and then we will append to the file in a loop using OP="append". The loop will terminate when i_sqlempty is TRUE. In otherwords, it will stop writing to the file when there isn't any more data to read.

<iFILE OP="write" NAME="filename" DATA=" ">

<iSQL SQL="SELECT name FROM db_table">
  <iLOOP INITIAL="1" FINAL="1000">
    <iIF COND=":i_sqlempty">
      <iEQ NAME=i_loop VALUE=1001>
      <iFILE OP="append" NAME="filename" DATA=:newtext>