And a recode of your snippet would be:
<CODE>
sub convert {
$dec = $_;
$hex = $dec;
if($dec==10){$hex = "A"}
elsif($dec==11){$hex = "B"}
elsif($dec==12){$hex = "C"}
elsif($dec==13){$hex = "D"}
elsif($dec==14){$hex = "E"}
elsif($dec==15){$hex = "F"}
return $hex;
}
</CODE>
--
__________________________________
Never mind the bear, beware of Papa!
"Rosco" <no*****@this.net> schreef in bericht
news:00*****************************@news.verizon. net...
What is wrong with the syntax in the following bit of code:
sub convert($dec){
$hex = $dec;
if($dec==10){$hex = "A"}
else{if($dec==11){$hex = "B"}}
else{if($dec==12){$hex = "C"}}
else{if($dec==13){$hex = "D"}}
else{if($dec==14){$hex = "E"}}
else{if($dec==15){$hex = "F"}}
return $hex
};