clipboardadd

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.0, Creation date: 2017-07-07, Last change: 2025-08-18

adds comment characters from the clipboard



See Also: textHorizontalBlockAlign , str2codelines , paste2code , clipboardrem

Example Illustration

 missing image of clipboardadd(maxc)

Syntax

C=clipboardadd([maxc])

Input Parameter

maxc:

Output Parameter

C:




Copyright 2017-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

Algorithm (Workflow)

This function, clipboardadd, is designed to add comment characters to text from the clipboard. It is part of the SolidGeometry library and was introduced in version 4.0.

Input Parameters

Output Results

Algorithm Steps

  1. Set the default value of maxc to 70. If an argument is provided, update maxc with the given value.
  2. Define comm as the comment character string ("% ") and sep as the newline character.
  3. Retrieve the current text from the clipboard using clipboard('paste') and store it in A.
  4. Use strfindex to process A, replacing newline characters with a standard format.
  5. Call textHorizontalBlockAlign with maxc and A to align the text into blocks, storing the result in B.
  6. Iterate over each line in B:
  7. If no output argument is specified, copy the result C back to the clipboard using clipboard('copy',C).
Algorithm explaination created using ChatGPT on 2025-08-18 23:12. (Please note: No guarantee for the correctness of this explanation)

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