Anonymous user
$MORSE.REX: Difference between revisions
m
added whitespace.
m (→{{header|REXX}}: added/changed comments and whitespace, changed indentations, simplified some code.) |
m (added whitespace.) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1:
The following is the '''$MORSE.REX''' (REXX) program.
<br>The help for the '''$MORSE.REX''' REXX program is included here ──► [[$MORSE.HEL]].▼
<br><br>This program supports the ''International Morse code'' as well as the ''USA Morse code'' (the later being primarily used by the North American Railroads). ▼
This program supports the ''International Morse code'' as well as
▲
<br>This REXX program normally shows Morse code words one word to a line before sounding.▼
North American Railroads).
<br><br>The '''$MORSE.REX''' REXX program makes use of '''LINESIZE''' REXX program (or BIF) which is used to determine the screen width (or linesize) of the terminal (console). ▼
Some translation is done for unsupported characters such as
<br>The '''LINESIZE.REX''' REXX program is included here ──► [[LINESIZE.REX]].▼
braces '''{''' '''}''',
<br><br>The '''$MORSE.REX''' REXX program makes use of '''$T.REX''' REXX program which is used to display text and/or write the text to a file. ▼
<br><br>The '''$MORSE.REX''' REXX program makes use of '''$ERR.REX''' REXX program which is used to display error messages (via '''$T.REX'''). ▼
<br>The '''$ERR.REX ''' REXX program is included here ──► [[$ERR.REX]].▼
<br><br>The '''$MORSE.REX''' REXX program makes use of '''SOUND.REX''' REXX program which is used to express sound (via the internal speaker). ▼
This REXX programs only works
<br>The '''SOUND.REX''' REXX program is included here ──► [[SOUND.REX]].▼
REXXes (specifically '''R4''' and '''ROO''') will only display the Morse code,
but not sound it.
The help for the '''$MORSE.REX''' REXX program is included
here ──► [[$MORSE.HEL]].
▲
program (or BIF) which is used to determine the screen width (or linesize) of the
terminal (console).
▲
here ──► [[LINESIZE.REX]].
▲
program which is used to display text and/or write the text to a file.
The '''$T.REX''' REXX program is included
here ──► [[$T.REX]].
▲
program which is used to delay (sleep) a specified amount time.
The '''DELAY.REX ''' REXX program is included
here ──► [[DELAY.REX]].
▲
program which is used to display error messages (via '''$T.REX''').
▲
here ──► [[$ERR.REX]].
▲
program which is used to express sound (via the internal speaker).
▲
Some older REXXes don't have a '''changestr''' BIF, so one is included
here ──► [[CHANGESTR.REX]].
<lang rexx>/*REXX program sounds out (on the PC speaker) Morse code for (almost) any given text.*/
trace off /*suppress non-zero return code message*/
Line 316 ⟶ 361:
unpsu: return translate(arg(1), , _b1 || _b2 || _b3)
verchar:procedure; parse arg y,w; _=length(y); if _==1 then return y; if _==2 then do; if \ishex(y) then call er 40,y w; return x2c(y); end; if _==3 then do; if \int(y) then call er 92,y ',' w; return d2c(y); end; call er 55,y w</lang>
[[Category:REXX library routines]]
|