'*':CommandWord: 'Undo';
'J': CommandWord: 'Join';
'B': CommandWord: 'Break';
'S': CommandWord: 'Save';
'O': CommandWord: 'Open';
'C': CommandWord: 'Close';
else FatalError('Unexpected command In DisplayCommand.')
end; {case}
case
Pascal
function CommandFromword(CommandCode:char);string;
begin
{expand the command abbreviation to a meaningful command word}
case CommadCode of
'L': CommandFromWord: 'Left';
'R': CommandFromWord: 'Right'
'U': CommandFromWord: 'Up'
'D': CommandFromWord: 'Down';
'E': CommandFromWord: 'Enter';
'X': CommandFromWord: 'Delete';
'*': CommandFromWord: 'Undo';
'J': CommandFromWord: 'Join';
'B': CommandFromWord: 'Break';
'S': CommandFromWord: 'Save';
'O': CommandFromWord: 'Open';
'C': CommandFromWord: 'Close';
else FatalError('Unexpected command In DisplayCommand.')
end; {case}
end {CommandFromWord }
DisplayCommand() case CommandFromWord();
CommandWord: CommandFromWord(CommandFromWord(CommandSentence[2])