Syntax
C=clipboardrem([maxc])
Input Parameter
Output Parameter
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
- maxc: An optional parameter that specifies the maximum number of characters to process. If not provided, it defaults to 74.
Output Results
- C: The processed clipboard content with comment characters removed.
Algorithm Steps
- Initialize
maxc
to 74. If an argument is provided, update maxc
with the given value.
- Define
comm
as the comment character sequence '% ' and sep
as the newline character.
- Retrieve the current clipboard content using
clipboard('paste')
and store it in A
.
- 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
.
- If both
s
and a
are not empty, proceed with the following steps:
- Set
a
and s
to their first elements.
- If the first character of
A
is less than '0' and s
is greater than a
, perform the following:
- Extract the substring from the start of
A
to a
and store it in remstr
.
- Prepend
sep
to A
.
- Find occurrences of
sep
followed by remstr
in A
and remove them using strfindex
function calls.
- Remove the first character from
A
and store the result in C
.
- 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