Create an array called something like Morse$ and dimension it to 26 (number of letters in the alphabet):
When the word is entered, loop through it getting the ASCII value of each character. Deduct 64 from this value to give you the array element which stores that letter's morse code.
Build up the word in morse and print it.
This should get you started:
Dim MorseCode$(26)
For N=1 To 26
Read M$
MorseCode$(N) = M$
Next N
Input "Enter Word: ";Word$
Word$ = Upper$(Word$)
MorseWord$=""
For N=1 To Len(Word$)
Char$=Mid$(Word$,N)
MorseWord$ = MorseWord$ + MorseCode$(ASC(Char$)-64)+" ": Rem ' ' represents a medium gap between words
Next N
Print MorseWord$
Wait Key
End
Rem A To J
Data ". -","- . . . "," - . - . "," - . . "," . "," - - . - "," - - . "," . . . . "," . . "," . - - - "
Rem K To T
Data " - . - "," . - . . "," - - "," - . "," - - - "," . - - . "," - - . - "," . - . "," . . . "," - "
Rem U To Z
Data " . . - "," . . . - "," . - - "," - . . - "," - . - - "," - - . . "
TDK_Man