Skip to content

Instantly share code, notes, and snippets.

@R3V1Z3
Last active June 21, 2018 22:30
Show Gist options
  • Save R3V1Z3/399b69445ae646c0160d644db08f5ed9 to your computer and use it in GitHub Desktop.
Save R3V1Z3/399b69445ae646c0160d644db08f5ed9 to your computer and use it in GitHub Desktop.
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