# fixed plus single named param + used optional class OptParam def main is shared x = OptParam() x.clr x.foo('default', 44) assert x.value == 44 assert x.value1 == 0 x.clr assert x.value == 0 and x.value1 == 0 x.foo('default', nmd=45) assert x.value == 45 assert x.value1 == 0 x.clr x.foo('opt', 45, 1) assert x.value == 45 assert x.value1 == 1 x.clr x.foo('opt', 0, nmd2=50) assert x.value == 0 assert x.value1 == 50 x.clr x.foo('opt', nmd2=1, nmd=51) assert x.value == 51 assert x.value1 == 1 x.clr x.foo('opt', nmd2=99, nmd=55) assert x.value == 55 assert x.value1 == 99 var value = 0 var value1 = 0 def foo(s as String, nmd as int, nmd2 as int = 0) #trace nmd .value = nmd if s =='default', assert nmd2 == 0 #trace nmd2 .value1 = nmd2 def clr .value = .value1 = 0