in reply to Repeating Code - there has GOT to be a better way!
if (int($fssbCmd{$cmd}{fixed_pattern}) <= 15) { $opcode = sprintf("0%x",$<name>Cmd{$cmd}{fixed_pattern}); } else { $opcode = sprintf("%x",$<name>Cmd{$cmd}{fixed_pattern}); }
with
$opcode = sprintf("%02x",$<name>Cmd{$cmd}{fixed_pattern});
It might help a little bit, anyway.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Repeating Code - there has GOT to be a better way!
by jedikaiti (Hermit) on Apr 01, 2010 at 16:41 UTC |