parsedocTL
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - File handling
Introduced first in SolidGeometry 1.0, Creation date: 2013-01-08, Last change: 2025-09-14
returns the documentation string related to Tim Lueth's documentation rules
Example Illustration
Syntax
Dclass=parsedocTL(fname)
Input Parameter
Output Parameter
Dclass: | | Documentation information |
Copyright 2013-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, parsedocTL, is designed to extract documentation information from a file, specifically following Tim Lueth's documentation rules.
Input Parameters
- fname: The name of the file from which documentation information is to be extracted.
Output Results
- Dclass: A structure containing the extracted documentation information, including the author and creation date.
Algorithm Steps
- Initialize
Dclass as an empty array.
- Use the
dir function to check if the file specified by fname exists.
- If the file exists, open it in read-text mode with UTF-8 encoding.
- Read the entire file content into a character array
FStr.
- Close the file.
- Search for the string
'(by ' in FStr to locate the author's information.
- If found, determine the position of the first occurrence and store it in
a. If not found, set a to infinity.
- Find all newline characters (both LF and CR) in
FStr and sort them into array b.
- Identify the first newline character after the author's information and store its position in
c.
- If the author's information is found, extract it from
FStr and store it in Dclass.Author. If not found, set Dclass.Author to 'unknown'.
- Check if the position
c is greater than 12 to determine if a creation date might be present.
- If a creation date is present, extract it and format it using
parsedatestr function, storing the result in Dclass.Creationdate.
- If no creation date is found, set
Dclass.Creationdate to a placeholder string.
- If the file does not exist, raise an error with the message 'File not found!'.
Algorithm explaination created using ChatGPT on 2025-08-19 01: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