BASIC Programming/Beginning BASIC/Control Structures/WHILE...WEND
< BASIC Programming < Beginning BASIC < Control StructuresINPUT "What is your name"; UserName$ PRINT "Hello "; UserName$ DO INPUT "How many stars do you want"; NumStars Stars$ = "" Stars$ = REPEAT$("*", NumStars) '<-ANSI BASIC 'Stars$ = STRING$(NumStars, "*") '<-MS BASIC PRINT Stars$ DO INPUT "Do you want more stars"; Answer$ LOOP UNTIL Answer$ <> "" LOOP WHILE UCASE$(LEFT$(Answer$, 1)) = "Y" PRINT "Goodbye "; FOR A = 1 TO 200 PRINT UserName$; " "; NEXT A PRINT
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.