[gme-users] Naive GMEConsole::Console question

Toth, Csaba csaba.toth at Vanderbilt.Edu
Fri Mar 23 11:14:13 CDT 2012

My guess: use \r\n

"CString str;
str.Format( "Test 1 \r\n Test 2" );
GMEConsole::Console::Out::WriteLine( str );"

This case probably has to do with line endings. \n is just an LF, which is the line ending in Linux/UNIX. MacOS uses CR (now LF?), Windows uses CRLF.

The whole problem depends on:
- how GME's control stores the data (I guess it's CRLF)
- is it transformed when it is copied onto the clipboard? (probably not, but it can be!)
- is it ransformed when you paste the clipboard content into the destination program (MATLAB), that depends on the destination application
- how the destination program accepts/handles line endings


From: gme-users-bounces at list.isis.vanderbilt.edu [gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Jonathan Sprinkle [sprinkle at ece.arizona.edu]
Sent: Thursday, March 22, 2012 1:09 PM
To: gme-users at list.isis.vanderbilt.edu
Cc: Jonathan Sprinkle
Subject: [gme-users] Naive GMEConsole::Console question

Hi all,

My question certainly displays some naiveté, so I apologize in advance. :) I want to generate output in the console that a user can paste into another program without having to open a file. For example, the output should appear as

matrix = [ 1 1 1; …
2 2 2; …
3 3 3; …

However, if I generate this matrix as an std::string, it shows correctly when generated to a file, but the output in the console is

matrix = [ 1 1 1; … 2 2 2; … 3 3 3; … ];

Which will not work in the other program (MATLAB, of course). I also tried this:

CString str;
str.Format( "Test 1 \n Test 2" );
GMEConsole::Console::Out::WriteLine( str );

But this shows as

Test 1 Test 2

So, any advice? :) For now it is easy to work around, by not allowing copy out of the console, but if I'm just doing something really stupid (or is there is a checkbox I need to enter somewhere) I am much obliged.


gme-users mailing list
gme-users at list.isis.vanderbilt.edu

More information about the gme-users mailing list