paste2code

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CODING/DEVELOP
Introduced first in SolidGeometry 5.1, Creation date: 2021-04-17, Last change: 2025-09-15

if called on the commandwindow, it returns the contant of the clipboard as matlab code

Description

It is possible to generate a keyboard macro like Command-Shift-V that opens the command window A (Command-Zero) and types paste2code. Then it is possible
1. to mark any Text in the editor (for example as comment)
2. Use Deep-L for translation
3. Use Command-Shift-V to create the source code in the command window (and to insert it into the past buffer
4. Copy it into the editor

See Also: textHorizontalBlockAlign , str2codelines , paste2code , clipboardrem , clipboardadd

Example Illustration

 missing image of paste2code(n)

Syntax

text=paste2code([n])

Input Parameter

n: number of chars per line; default is 112;

Output Parameter

text: text from the clipbord

Examples

Copy the follwowing help text into clip bey by command-C/control c and call paste2code in the commandwindow
% 1. you can actually translate this text into English.
% 2. once the translation has been copied to the clipboard, you can
% 3. get the lines for the source code in the commandwindow by using the command past2code.
% 4. copy the lines from the commandwindo into the source code




Copyright 2021-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21