diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /map65/libm65/nchar.f90 | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (diff) | |
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'map65/libm65/nchar.f90')
| -rw-r--r-- | map65/libm65/nchar.f90 | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/map65/libm65/nchar.f90 b/map65/libm65/nchar.f90 index 21593bd1..5f8688f0 100644 --- a/map65/libm65/nchar.f90 +++ b/map65/libm65/nchar.f90 @@ -1,23 +1,25 @@ -function nchar(c) +module nchar_mod + implicit none +contains + integer function nchar(c) + implicit none + character, intent(in) :: c + integer :: n -! Convert ascii number, letter, or space to 0-36 for callsign packing. - - character c*1 - - n=0 !Silence compiler warning - if(c.ge.'0' .and. c.le.'9') then - n=ichar(c)-ichar('0') - else if(c.ge.'A' .and. c.le.'Z') then - n=ichar(c)-ichar('A') + 10 - else if(c.ge.'a' .and. c.le.'z') then - n=ichar(c)-ichar('a') + 10 - else if(c.ge.' ') then - n=36 - else - Print*,'Invalid character in callsign ',c,' ',ichar(c) - call exit(1) - endif - nchar=n - - return -end function nchar + n=0 !Silence compiler warning + if(c.ge.'0' .and. c.le.'9') then + n=ichar(c)-ichar('0') + else if(c.ge.'A' .and. c.le.'Z') then + n=ichar(c)-ichar('A') + 10 + else if(c.ge.'a' .and. c.le.'z') then + n=ichar(c)-ichar('a') + 10 + else if(c.ge.' ') then + n=36 + else + ! TODO: Return an invalid status instead of terminating MAP65. + ! Print*,'Invalid character in callsign ',c,' ',ichar(c) + stop 1 + endif + nchar=n + end function nchar +end module nchar_mod |
