TABLE OF CONTENTS


::pwtk::stopOnError

SYNOPSIS

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

PURPOSE

Set or query the "stopOnError" flag; "stopOnError" can be either ON or OFF. If "stopOnError" is ON, the PWTK execution will abort if an error occurs in QE calculation, whereas if the "stopOnError" is OFF then the execution of PWTK script will continue even if an error occurs in 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 "Stop-on-error mode is ON\n"
        } else {
            ::pwtk::print "Stop-on-error mode is OFF\n"
        }

    }
    return $state(stopOnError)
}