Site icon Learn C++

Tutorial: Learn To Copy Matrix As A Excel Clipboard In Modern C++

Clipboard also called the paste buffer, is a buffer that operating systems provide to copy things (texts, bitmaps, tables, etc.) for the short term and transfer within and between application programs. The clipboard is usually temporary and unnamed, and its contents reside in the computer’s memory.

In C++ Builder there are good components to use Excel forms, excel supported Grid components, etc. In this post, we would like to post a small snippet to copy a matrix member as in excel clipboard form. So you can paste all members to excel. This method is good to copy data from a matrix that is formed with numeric or alphanumeric parameters. You can also add this method to popup menus of components or things which has parameters in a table form, like Grids.

Excel form of a table (only texts) is formed with a text string and each column is separated with a tab character ( ‘\t‘ ) and each string line is listed as in that row.

[crayon-6605afd650fe9083837126/]

This C++ Builder Console VCL Application example below copies a 2d matrix to a clipboard in excel form.

[crayon-6605afd650fef079104409/]

Exit mobile version