Why doesn't this work?
<?macrodef num_btn
		<?macroins btn_start name="b$(name)" hint="$name" ?>
			<script name=OnClick > 
				if(myvar==0 and notzero!=1)
				{
					if(dec==0 or deca==1)	{myvar=$name;}
					else{myvar=.$name;dec=0;}
					notzero=1;
				}
				else
				{
					if(dec==0 or deca==1)	{myvar=myvar|$name;}
					else{myvar=myvar|.$name;dec=0;deca=1;}
				}
				ascreen.SetText(myvar);
				if(ansa!=0){ansa=0;}
			</script>
		<?macroins btn_end ?> 
	?>

	<?macroins num_btn name="1" hint="" ?>

This does.
<?macroins btn_start name="b1" hint="1" ?>
<script name=OnClick > 
	if(myvar==0 and notzero!=1)
	{
		if(dec==0 or deca==1)	{myvar=1;}
		else{myvar=.1;dec=0;}
		notzero=1;
	}
	else
	{
		if(dec==0 or deca==1)	{myvar=myvar|1;}
		else{myvar=myvar|.1;dec=0;deca=1;}
	}
	ascreen.SetText(myvar);
	if(ansa!=0){ansa=0;}
</script>
<?macroins btn_end ?> 