Wednesday, November 19, 2008

Memory management in NXText NXC

I recently posted over at NXTasy's forums (link) on some issues I have been having with NXText NXC where, after adding the ability to read text files that contain line breaks, my program could only open small files (3 kb).  I therefore decided to take out this ability so that my program could open larger files.  I then started using the ReadLnString function to read text from a text file.  Well, trying to open a 6 kb file took 25-30 seconds using this function!  That is WAY too long.  I posted about my problems in the above-mentioned topic, and Mr. Hansen graciously helped me and came up with a solution.  Using his code, my program can now open a 12 kb file (the largest I have tested so far) in a fraction of a second!  If you render this baby, it ends up being 99 PAGES LONG!  This greatly improved the speed of my program and works like a charm.  I am now very happy...  NXTFreak

No comments: