dbpause
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Debug
Introduced first in SolidGeometry 5.1, Creation date: 2021-12-12, Last change: 2025-09-15
similar to pause, but shows the calling fnct and if dbprintmode is on, jumps to the line
Description
Debug function of Tim Lueth
dbprintf
dbpause
dbsave
dbreturn
dbprintmode
See Also: dbprintf
, dbreturn
, dbsave
, dbprintmode
Example Illustration
Syntax
ch=dbpause([str,str2])
Input Parameter
str: | | string, if there is no time, or zero or seconds |
str2: | | prompt if a time is used |
Output Parameter
ch: | | key character that was used in the graphics figure to continue after pause |
Copyright 2021-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, dbpause, is a debugging utility designed to pause the execution of a MATLAB script, providing information about the calling function and allowing for user interaction. It is part of the SolidGeometry library.
Input Parameters
- str: A string or numeric value. If numeric, it represents the pause duration in seconds. If a string, it is a message displayed during the pause.
- str2: A string used as a prompt if a time is specified in
str.
Output
- ch: The key character used to continue after the pause.
Algorithm Steps
- Initialize the current character of the figure to
char(0).
- Retrieve the input parameters
str and str2 using getfuncparams.
- Determine the title of the calling function using
titleofcaller.
- If
str is numeric:
- If
str is greater than 1, print a pause message using str2.
- Calculate the number of iterations
n as ceil(str/0.05).
- Pause for 0.05 seconds in each iteration, updating the display with
drawnowvid.
- If
str is not numeric:
- Call
drawnowvid to update the display.
- If
Videoquick_vw is not empty, call Videoquickwritegcf to write the current figure.
- If
str and str2 are not equal, concatenate them.
- Print the calling function title and the message
str.
- Pause execution until a key is pressed.
- Retrieve the current character from the figure using
get(gcf,'CurrentCharacter').
- If
str is numeric and greater than 1, print a newline.
- Call
commandwindowTL to focus on the command window.
Algorithm explaination created using ChatGPT on 2025-08-19 07:58. (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