1 Reply Latest reply on Oct 11, 2013 9:09 PM by Sean_Wilson

    FileIO - Readfile stops at certain characters

    Sh3rv Level 1

      Hello,

       

      Windows 8 - Director 12

       

      I’m designing a GUI which opens an ini file into memory, and edits specific lines depending on the user’s preference before saving back to the file. When I open the ini file into memory it partially works until a 'special' character is encountered, in this case the " ¦ " symbol. I cannot remove these characters from the original ini file as they are required. How can I get Director to read all of the files contents despite the special characters?

       

      Here are the variations of the code I have used, all resulting in the same issue :

       

      1

          fileObj = new(xtra "FileIO")

          openFile(fileObj, "C:\Work\Projects\BusLane Application\NRS\BLOM.ini", 1)

          blomINI = readfile(fileObj)

       

      2

           objFileio = new xtra("fileio")

      objFileio.openFile("C:\Work\Projects\BusLane Application\NRS\BLOM.ini",0)

        blomINI =objFileio.readFile()

        put contents

       

      3

         set fileXtra = new(xtra "FileIO")

        openFile(fileXtra, "C:\Work\Projects\BusLane Application\NRS\BLOM.ini",1)

        set blomINI = readFile(fileXtra)

      closeFile(fileXtra)

       

       

      Here is an extract of the ini file :

       

      ; The following information has been split into two elements, as somewhere it is getting

      truncated Element 14=KeyValuePair¦DynamicObservationXML¦<zoneId>%LocationDescription

      %</zoneId><zoneAlias>%LocationIdentifier%</zoneAlias>

       

      The text in memory only shows :

       

      ; The following information has been split into two elements, as somewhere it is getting

      truncated Element 14=KeyValuePair

       

      It also stops at " // "

       

       

      Thanks.