TABLE OF CONTENTS


::pwtk::stopOnError

SYNOPSIS

proc ::pwtk::stopOnError {{stopOnError {}}} {

PURPOSE

Set or query the "stopOnError" flag, which can be either ON or OFF. If "stopOnError" is ON, the PWTK execution aborts if an error occurs during QE calculation, whereas if "stopOnError" is OFF, then the execution of PWTK script continues even if an error occurs during QE calculation.

ARGUMENTS

RETURN VALUE

The value of the "stopOnError" flag.

SOURCE

    variable state

    if { $stopOnError != {} } {        
        # e.g., .true. --> true
        set stopOnError [string trim $stopOnError .] 
        
        if { ! [string is boolean $stopOnError] } {
            ::pwtk::error "expecting a boolean argument, but got \"$stopOnError\",\nwhile executing \"stopOnError $stopOnError\"" 1
        }
        set state(stopOnError) [::pwtk::is_true $stopOnError]

        if { $state(stopOnError) } {
            ::pwtk::print "stopOnError mode is ON\n"
        } else {
            ::pwtk::print "stopOnError mode is OFF\n"
        }

    }
    return $state(stopOnError)
}