Program to reverse a string using function
Declare function  reverse$(a$)
CLS
INPUT "Enter a string"; (a$)
PRINT "String after reverse is", reverse$(a$)
END
FUNCTION reverse$ (a$)
    FOR i = LEN(a$) TO 1 STEP -1
        b$ = b$ + MID$(a$, i, 1)
    NEXT i
    reverse$ = b$
END FUNCTION