What should I do when I have two textboxes, for example, and want to put their content into a textfile? I know how to get the text and I know how to put it into the file, but the problem is between these two operations - should I use arrays or clipboard, or something else? Any help appreciated!




/siddhartha
Posted on 2004-07-06 04:07:55 by siddhartha
i dont think it really matters if you use arrays or clipboard, its a matter of personal choice i guess
Posted on 2004-07-06 05:24:43 by evlncrn8
So which way is easier and how to do it?




/siddhartha
Posted on 2004-07-06 06:19:32 by siddhartha
either, like i said its a personal choice, so experiment
Posted on 2004-07-06 17:29:25 by evlncrn8
Arrays are probably easier, specially if your text is limited in size.
Posted on 2004-07-06 17:37:13 by QvasiModo

Arrays are probably easier, specially if your text is limited in size.


Me too.
Posted on 2004-07-08 08:13:42 by purpleendurer
I've made it without arrays, just parsing the text and putting it into the file through WriteFile. But when talking about deletion of some string in the text, there the problem appears. So this is the case: I've got a file, take it's content into memory. Let's say that the file has 10 lines. I want to remove the 3th line. How? Is there a way I can find some text in the file, obtain the line number and delete it directly? If no - is there a way to do this through a buffer? Thanks again, fellas!


P.S.:Right now I don't have any way of uploading source here, but as soon as I get to my computer I'll post you the source of my program!



/siddhartha
Posted on 2004-07-16 10:39:55 by siddhartha
Put the whole text in a buffer, find the beginning and end of the line you want to delete (counting newline characters using scasb will do). Then use rep movsb to copy the remainder of the buffer (form the ending position to the end of the buffer) into the beginning position. Finally, save the new file contents.

The concept is similar to treating the text buffer as an array of bytes, and the line as a fragment of that array. :)
Posted on 2004-07-19 11:28:41 by QvasiModo
Thanks all! I've done it through InString and want to know what's the macros performance - is it better than doing it the way QvasiModo proposed or not?



/siddhartha
Posted on 2004-07-27 08:32:47 by siddhartha