RosettaCodeData/Task/Abbreviations-easy/EasyLang/abbreviations-easy.easy
2025-06-11 20:16:52 -04:00

42 lines
1.2 KiB
Text

a$ = "Add ALTer BAckup Bottom CAppend Change SCHANGE CInsert CLAst COMPress COpy"
a$ &= " COUnt COVerlay CURsor DELete CDelete Down DUPlicate Xedit EXPand EXTract Find"
a$ &= " NFind NFINDUp NFUp CFind FINdup FUp FOrward GET Help HEXType Input POWerinput"
a$ &= " Join SPlit SPLTJOIN LOAD Locate CLocate LOWercase UPPercase LPrefix MACRO"
a$ &= " MErge MODify MOve MSG Next Overlay PARSE PREServe PURge PUT PUTD Query QUIT"
a$ &= " READ RECover REFRESH RENum REPeat Replace CReplace RESet RESTore RGTLEFT"
a$ &= " RIght LEft SAVE SET SHift SI SORT SOS STAck STATus TOP TRAnsfer Type Up"
cmd$[] = strtok a$ " "
#
func$ toupper s$ .
for c$ in strchars s$
c = strcode c$
if c >= 97 : c -= 32
r$ &= strchar c
.
return r$
.
for i to len cmd$[]
h$ = ""
for c$ in strchars cmd$[i]
if strcode c$ > strcode "Z" : break 1
h$ &= c$
.
abbr$[] &= h$
cmd$[i] = toupper cmd$[i]
.
func$ getabbr in$ .
in$ = toupper in$
for i to len cmd$[]
if strpos cmd$[i] in$ = 1 and strpos in$ abbr$[i] = 1
return cmd$[i]
.
.
return "*error*"
.
in$[] = strtok input " "
for s$ in in$[]
write getabbr s$ & " "
.
#
input_data
riG rePEAT copies put mo rest types fup. 6 poweRin