Improved setboundarycode function/dialog: