home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn User 10
/
AU_CD10.iso
/
Updates
/
Perl
/
Non-RPC
/
!Perl
/
scripts
/
swi
< prev
next >
Wrap
Text File
|
1998-07-14
|
804b
|
42 lines
#! perl -w
use RISCOS;
# Rules:
# If it contains _ it's a name
# If it starts & or 0x or 0X it's hex
# If it contains a-fA-F it's probably hex
# Else it's decimal
# If you want to list all the Wimp SWIs
# perl -e 'system "perl scripts.swi " . join " ", (0x400c0..0x400ff)'
while( defined ( $_ = shift ) )
{
if( tr/_// )
{
$name = $_;
$number = SWINumberFromString( $name );
}
elsif( s/^\&/0x/ or /^0x/i or ( tr/A-Fa-f// and s/^/0x/ ))
{
$number = oct;
}
else
{
$number = $_;
}
$name = SWINumberToString( $number ) unless( defined $name );
if( defined $number )
{
printf "%10u %10X $name\n", $number, $number;
}
else
{
print " ? ? $name\n";
}
undef $name;
}