clipboardrem

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-19

removes comment characters from the clipboard



See Also: textHorizontalBlockAlign , str2codelines , paste2code , clipboardadd

Example Illustration

 missing image of clipboardrem(maxc)

Syntax

C=clipboardrem([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, clipboardrem, is designed to remove comment characters from the clipboard content. It is part of the SolidGeometry library and was introduced in version 4.0. The function is authored by Tim C. Lueth.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize maxc to 74. If an argument is provided, update maxc with the given value.
  2. Define comm as the comment character sequence '% ' and sep as the newline character.
  3. Retrieve the current clipboard content using clipboard('paste') and store it in A.
  4. Find positions of carriage return and newline characters in A and store them in s. Also, find positions of spaces and tab characters and store them in a.
  5. If both s and a are not empty, proceed with the following steps:
  6. Set a and s to their first elements.
  7. If the first character of A is less than '0' and s is greater than a, perform the following:
  8. Extract the substring from the start of A to a and store it in remstr.
  9. Prepend sep to A.
  10. Find occurrences of sep followed by remstr in A and remove them using strfindex function calls.
  11. Remove the first character from A and store the result in C.
  12. If no output argument is specified, copy C back to the clipboard.
Algorithm explaination created using ChatGPT on 2025-08-19 01:10. (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