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

 missing image of helptextofcaller

Syntax

htext=helptextofcaller

Output Parameter

htext: help text

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

Output Results

Algorithm Steps

  1. The function begins by calling dbstack, which returns a structure array with information about the function call stack.
  2. 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.
  3. If a calling function exists, it retrieves the name of the calling function from caller(2).name.
  4. If there is no calling function, it sets fname to an empty string.
  5. The function then calls help(fname) to retrieve the help text of the calling function.
  6. 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