Skip to content

Instantly share code, notes, and snippets.

@thunderpoot
Last active February 29, 2020 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thunderpoot/e37659886f4a2f7556af9e0930257827 to your computer and use it in GitHub Desktop.
Save thunderpoot/e37659886f4a2f7556af9e0930257827 to your computer and use it in GitHub Desktop.
Loading bar in TeleBASIC
10 PRINT "Loading..." : PRINT : S% = 1 : E% = 60 : FOR T% = S% TO E%
20 SLEEP 0.1 : REM YOUR PROGRAM LOGIC HERE, ADJUST S% AND E% VALUES
30 MD = INT((T%/E%*100)/10) : ML = 10 - INT((T%/E%*100)/10) : P% = INT(T%/E%*100)
40 IF O% <> P% THEN GOTO 50 : ELSE IF P% <> 100 THEN NEXT T%
50 PRINT CHR$(27) "[A" "[" STRING$(MD, "#") STRING$(ML, " ") "] " STR$(P%) "%" : O% = P% : NEXT T%
60 PRINT CHR$(27) "[A" CHR$(27) "[18C" "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment