Testing Palindrome

CLS
INPUT "Enter string to be tested: ";t$
t$=LCASE$(t$)
FOR I=LEN(t$) TO 1 STEP -1
  r$=r$+MID$(t$, I, 1)
NEXT I
IF r$=t$ THEN
  PRINT t$; " is Palindrome!"
ELSE
  PRINT t$; " is not Palindrome!"
ENDIF
END

Testing Palindrome Using Function...End Function

DECLARE FUNCTION rev$(s$)
CLS
INPUT "Enter string to be tested"; t$
t$=LCASE$(t$)
IF t$=rev$(t$) THEN
  PRINT t$;" is Palindrome!"
ELSE
  PRINT t$;" is not Palindrome!"
ENDIF
END

FUNCTION rev$(s$)
FOR I = LEN(s$) to 1 STEP -1
  r$=r$+MID$(s$, I, 1)
NEXT I
rev$=r$
END FUNCTION