? Text-Only Loading Bar ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Text-Only Loading Bar

A progress/loading bar, made from only text. It's accurate to the nearest pixel DEF TEXTBAR$ LENGTH PRINT ""*(LENGTH DIV 8); IF LENGTH MOD 8 THEN PRINT " "[LENGTH MOD 8] END Draws a LENGTH * 8(pixel) rectangle with text For loading on the top screen LENGTH should be PROGRESS/MAXIMUM * 400
Author
12Me21
Updated
Rating
4 votes
Categories
Keywords
9 Comment(s) ProgrammingChicken ProgrammingChicken Forum Contributor Hidden Achievements Avatar Embargo I didn't change my avatar for 90 days Website Banana For Scale Hidden Easter Eggs woah, you can do string picking using array syntax? what is this wizardry? 12Me21 12Me21 Admin Helper Received for being very helpful around SmileBASIC Source Achievements Syntax Highlighter Received for creating the code syntax highlighter on SBS Winter 2016 Contest Winner I won the SmileBASICSource Winter 2016 Contest! Programming Contest It's called not being terrible at programming Yeah, strings are kind of like arrays of characters, so you can use most array commands on them, like PUSH, POP, COPY, etc. ProgrammingChicken ProgrammingChicken Forum Contributor Hidden Achievements Avatar Embargo I didn't change my avatar for 90 days Website Banana For Scale Hidden Easter Eggs D: SquareFingers SquareFingers Code gives syntax error. Use + for string concatenation. It would also be more useful if there wasn't a space character at the end of lengths that are multiples of 8. 12Me21 12Me21 Admin Helper Received for being very helpful around SmileBASIC Source Achievements Syntax Highlighter Received for creating the code syntax highlighter on SBS Winter 2016 Contest Winner I won the SmileBASICSource Winter 2016 Contest! Programming Contest yeah, that was a typo as for the space at the end, I'll add *!!(LENGTH MOD 8) or something SquareFingers SquareFingers The second string now appears to have only 7 characters: for the indexing to work, you need 8 characters in the string, including one for the condition L MOD 8 == 0, even though that character will be removed from the resulting string by *0. - I hope I do not annoy, I just want to see this code be the best it can be. 12Me21 12Me21 Admin Helper Received for being very helpful around SmileBASIC Source Achievements Syntax Highlighter Received for creating the code syntax highlighter on SBS Winter 2016 Contest Winner I won the SmileBASICSource Winter 2016 Contest! Programming Contest Yeah, another typo. thanks SquareFingers SquareFingers I'd recommend using the # suffix so it also works in programs that have OPTION DEFINT. EDIT: I'd also make the max length a parameter, so it can be used on the lower screen and as part of a line. And to answer your question, a variable named PERCENT should have a percent value. Perhaps you're looking for PROGRESS#. 12Me21 12Me21 Admin Helper Received for being very helpful around SmileBASIC Source Achievements Syntax Highlighter Received for creating the code syntax highlighter on SBS Winter 2016 Contest Winner I won the SmileBASICSource Winter 2016 Contest! Programming Contest length is in pixels, so it doesn't really matter if it's an integer or not.