helptextofcaller
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 3.5, Creation date: 2017-03-01, Last change: 2025-08-18
returns the helptext of the calling fnct
Description
This function is usefull to create function such as FMhelp that just return their own helptext.
Does work only as part of a function.
See Also: titleofcaller
, snapplot
Example Illustration
Syntax
htext=helptextofcaller
Output Parameter
Examples
FMhelp
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, helptextofcaller, is designed to retrieve the help text of the calling function. It is part of the SG-Library and was created by Tim Lueth on March 1, 2017. The function is useful for creating functions like FMhelp that return their own help text. It only works when used as part of another function.
Input Parameters
- There are no input parameters for this function.
Output Results
htext: The help text of the calling function.
Algorithm Steps
- The function begins by calling
dbstack, which returns a structure array with information about the function call stack.
- It checks the size of the
caller array. If the size is greater than or equal to 2, it means there is a calling function.
- If a calling function exists, it retrieves the name of the calling function from
caller(2).name.
- If there is no calling function, it sets
fname to an empty string.
- The function then calls
help(fname) to retrieve the help text of the calling function.
- The retrieved help text is stored in the variable
htext, which is then returned as the output.
Algorithm explaination created using ChatGPT on 2025-08-18 22:05. (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