Last active
June 21, 2018 22:30
-
-
Save R3V1Z3/399b69445ae646c0160d644db08f5ed9 to your computer and use it in GitHub Desktop.
QuickBasic example from Wikipedia's BASIC entry. https://ugotsta.github.io/code-glory/?gist=399b69445ae646c0160d644db08f5ed9&css=adc373c2d5a5d2b07821686e93a9630b&bg=cornsilk&highlight=grayscale&width=40&padding=2&saturate=100&scale=1.41&rotateX=15&rotateY=3&rotateZ=10&offsetX=100&offsetY=264
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE SUB PrintSomeStars (StarCount!) | |
REM QuickBASIC example | |
INPUT "What is your name: ", UserName$ | |
PRINT "Hello "; UserName$ | |
DO | |
INPUT "How many stars do you want: ", NumStars | |
CALL PrintSomeStars(NumStars) | |
DO | |
INPUT "Do you want more stars? ", Answer$ | |
LOOP UNTIL Answer$ <> "" | |
Answer$ = LEFT$(Answer$, 1) | |
LOOP WHILE UCASE$(Answer$) = "Y" | |
PRINT "Goodbye "; UserName$ | |
END | |
SUB PrintSomeStars (StarCount) | |
REM This procedure uses a local variable called Stars$ | |
Stars$ = STRING$(StarCount, "*") | |
PRINT Stars$ | |
END SUB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment