Which is better? (whatever "better" is)
This:
if {[info exists CHIPNAME]} {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME at91r40008
}
or this:
set _CHIPNAME [defaultval $CHIPNAME at91r40008]
# Std proc to be added
proc defaultval {varname defval} {
if {[uplevel "info exists $varname"]} {
return $varname
} else {
return $defval
}
}
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development