Add hupdateif <path> <value> [<format>] for conditional update of hipadaba
This commit is contained in:
@ -917,6 +917,27 @@ proc handle_exception {status message args} {
|
||||
}
|
||||
}
|
||||
|
||||
proc hupdateif {path new_value {cmp_format ""}} {
|
||||
if { ${cmp_format} == "" } {
|
||||
if { [hpropexists ${path} compare_format] } {
|
||||
set compare_format [hgetpropval ${path} compare_format]
|
||||
} else {
|
||||
set compare_format ""
|
||||
}
|
||||
} else {
|
||||
set compare_format ${cmp_format}
|
||||
}
|
||||
if { ${compare_format} == "" } {
|
||||
if { [hval ${path}] != ${new_value} } {
|
||||
hupdate ${path} ${new_value}
|
||||
}
|
||||
} else {
|
||||
if { [format ${compare_format} [hval ${path}]] != [format ${compare_format} ${new_value}] } {
|
||||
hupdate ${path} ${new_value}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace import ::utility::*;
|
||||
Publish getinfo spy
|
||||
Publish setpos user
|
||||
|
Reference in New Issue
Block a user