DINfindinTab

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - ENG-Standards
Introduced first in SolidGeometry 4.9, Creation date: 2020-07-14, Last change: 2025-09-14

searches an entry with in a table name



See Also: DIN13 , DIN20273 , DIN336 , DIN433 , DIN464 , DIN4AMfitting , DIN7991 , DIN912 , DIN913 , DIN934 , DIN965 , DIN985

Example Illustration

 missing image of DINfindinTab(M,Tab,takelarg)

Syntax

TL=DINfindinTab(M,Tab,[takelarg])

Input Parameter

M: Scalar to find in Tab
Tab: Table with M as first col; Table name is important
takelarg: if true nearest larger is selected; default is true

Output Parameter

TL: Table row

Examples


DIN433=[ 1.0 1.1 2.5 0.3; 1.2 1.3 3.0 0.3];
DINfindinTab(1.1,DIN433)




Copyright 2020-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, DINfindinTab, is designed to search for a specific scalar value within a given table and return the corresponding row. It is part of the SolidGeometry library and was introduced in version 4.9.

Input Parameters

Output

Algorithm Steps

  1. The function begins by setting the takelarg parameter using the getfuncparams function, which defaults to true if not specified.
  2. It determines the number of rows in the table Tab.
  3. The function iterates over each row of the table to check if the first column matches the scalar M. If a match is found, it returns the entire row as TL.
  4. If no exact match is found and takelarg is true, the function searches for the first row where the first column is greater than or equal to M and returns that row.
  5. If takelarg is false, the function searches for the last row where the first column is less than or equal to M. If such a row is found, it returns that row. If no such row exists, it throws an error indicating that no suitable value was found.
  6. Finally, if no exact match is found, a debug message is printed indicating that the nearest value was returned instead.
Algorithm explaination created using ChatGPT on 2025-08-19 01:26. (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