[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
TRACE                        Statement Trace

    Default value = FALSE.  Determines whether statements are traced  during
    execution.

    QTAwk  has  a  facility  for  debugging  programs.   This  facility  is
    activated through the built-in variable 'TRACE'.  QTAwk  can trace  the
    loop control statements, 'if',  'while', 'do', 'for' (both  forms), and
    'switch'.   In addition,  built-in functions  and user-defined function
    are traced.

    By default, TRACE is FALSE and no tracing is done.  The variable may be
    set to any value, numeric, string or a regular expression and the value
    will determine the statements traced.  If TRACE has a nonzero  numeric
    value then QTAwk will  trace  all statements of  the  type listed.   If
    TRACE  has  a  string  value,  then  the string is compared against the
    keywords:

    if
    while
    do
    for
    switch
    function_b ( for built-in functions )
    function_u ( for user-defined functions )

    If an exact match (case is  important) is found, then the statement  is
    traced.  If TRACE is set to a regular expression, then the keywords are
    matched against the regular expression.  If a match is found, then  the
    statement is traced.

    In tracing a statement, QTAwk  issues a message to the  standard output
    file "stdout".  This file may  be re-directed if desired.  The  message
    issued will have the form:

    Stmt Trace:  stmt_str value_str
    Action File line:  xxxx
    Scanning File:  FILENAME
    Line:  xxxxx
    Record:  xxxxxx

    where  stmt_str  is  the  appropriate  keyword  listed  above  for  the
    statement traced and value_str is a value dependent upon the  statement
    traced as listed below:

    keyword          value string
    if          ==>  0/1 conditional expression TRUE/FALSE
    while       ==>  0/1 conditional expression TRUE/FALSE
    do          ==>  0/1 conditional expression TRUE/FALSE
    for         ==>  0/1 conditional expression TRUE/FALSE
    for         ==>  subscript value
    switch      ==>  switch expression value
    function_b  ==>  function name
    function_u  ==>  function name

    When a statement that  can be traced is  encountered, the value of  the
    statement is determined, e.g., for an 'if' statement, the value of  the
    conditional is evaluated before issuing the trace statement.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson