1 Reply Latest reply on Mar 4, 2007 6:39 PM by Newsgroup_User

    Write Multiple strings

    wgb14 Level 1
      Hi all,

      I wonder if there is any way to write multiple strings to a text file with FILEIO. In particular i am interested for the following:

      global customscript
      on saveAnINI2
      set Question = the text of member "Q"
      gFileIO =new (xtra "FileIO")
      gFileIO.createFile("dialogue.aiml")
      gFileIO.openFile ("dialogue.aiml",2)
      gFileIO.writeString("<category>" & RETURN & "<pattern>"&Question&"</pattern>" &RETURN & "<template>"&customscript&"</template>" & RETURN & "</category>")
      end

      Both question and customscript variables catch the input of the user to two text cast members. My problem is that although the whole thing works nicely for 1 input i am unable to write multiple strings to the dialogue.aiml file. Any idea why? To be more specific the above code will write the following to my dialogue.aiml file:

      <category>
      <pattern>What is Monemvasia?</pattern>
      <template>loc89.hap</template>
      </category>

      Once my user will update the values for question and customscript the above string is updated with the new values, although i wanted to be something like:



      <category>
      <pattern>What is Monemvasia?</pattern>
      <template>loc89.hap</template>
      </category>
      <category>
      <pattern>What is Greece?</pattern>
      <template>loc90.hap</template>
      </category>


      and so on

      many thanks for any help!