RosettaCodeData/Task/String-case/EasyLang/string-case.easy

26 lines
554 B
Plaintext

proc toUppercase string$ . result$ .
for i = 1 to len string$
code = strcode substr string$ i 1
if code >= 97 and code <= 122
code -= 32
.
result$ &= strchar code
.
.
proc toLowercase string$ . result$ .
for i = 1 to len string$
code = strcode substr string$ i 1
if code >= 65 and code <= 90
code += 32
.
result$ &= strchar code
.
.
string$ = "alphaBETA"
print string$
call toUppercase string$ result$
print result$
result$ = ""
call toLowercase string$ result$
print result$