Windows [AUTOSOLVED]Need to clipboard copy and paste lots of formatted txt

V

VertexMover

Guest
I am looking for a way to clipboard copy and paste txt in and out of GM while preserving the basic line formatting as found in the txt file.
Something like...

Code:
str = clipboard_get_text_formatted(); //coverts Windows line brakes into the # character format used in Game Maker.

// add letters to string, and do other stuff here

clipboard_set_text_formatted(str); //converts Game Maker line brake # character to proper windows line brakes and set copy to clipboard.
Now I know GM can see the regular line breaks since if you print the plain string as it came from the clipboard it does the line brakes, however if you change the string, the regular windows the formatting is lost.
 
V

VertexMover

Guest
Found a work around that will do for now, but it really should be a built in function

This is what I am using to export strings back out with their formatting converted
Code:
clipboard_set_text( string_replace_all(str, '#', (chr($000D) + chr($000A))) );
 
Top