Syntax
C=clipboardadd([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, 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
- maxc: An optional parameter that specifies the maximum number of characters per line. If not provided, it defaults to 70.
Output Results
- C: The processed text with comment characters added, returned as a string.
Algorithm Steps
- Set the default value of
maxc
to 70. If an argument is provided, update maxc
with the given value.
- Define
comm
as the comment character string ("% ") and sep
as the newline character.
- Retrieve the current text from the clipboard using
clipboard('paste')
and store it in A
.
- Use
strfindex
to process A
, replacing newline characters with a standard format.
- Call
textHorizontalBlockAlign
with maxc
and A
to align the text into blocks, storing the result in B
.
- Iterate over each line in
B
:
- Prepend the comment character string
comm
to each line.
- Concatenate the lines into a single string
C
, separated by sep
.
- 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