Well, Prelude (among others which I thx) helped me with some code, and he pointed out for me that using String, AnsiString or others predefined clases was better then using an pointer to an array of chars on the heap, which you make larger as text side develops.
His explenation was that it wasn't that error prone, and that's were i got a ask, isn't it sometimes a good idea to make your own clases insted of using the predefined?
A few weeks ago i maid a program designed to go through an unkown amount of files with and unkown amount of txt in a submenu or disk, searching for 1 to an unkown number of strings.
I maid it work though there was all these unkowns, and then you got a work because the arrays have to expand as they are needed larger. First i maid it work with AnsiString, but since it should go through literaly thousands of files, all with atleast 2000 lines, it took a LONG time. Then i redesigned the code so that it worked with char, and suddenly it was MUCH faster (actually it was done in a matter of seconds). So my argument is that if it have to be really fast you should use char. Ofcouse only if the program have to compute through allot (else you wont notice the difference though it's still there).
Now tel me, am I just totally wrong on this one?![]()



LinkBack URL
About LinkBacks






)
).