DEV Community

anup-maharjan
anup-maharjan

Posted on

QBASIC Modular Programming

This code
https://repl.it/@computer2anup/ReverseName
is same like
DECLARE FUNCTION reverse$ (W$)
CLS
INPUT "Enter a name "; W$
PRINT " Reverse name = "; reverse$ (W$)
END

FUNCTION reverse$ (W$)

FOR P = 1 TO LEN(W$)
    C$ = MID$(W$,P,1)
    R$ = C$ + R$
NEXT P

reverse$ = R$

END FUNCTION

But still it lags, why?

Discussion (0)