Weekly Qbasic and Qb64 Lesson Topics
April 20, 2024, 02:15:04 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
  Home Help Search Arcade Links Staff List Login Register  

What I have so Far,Learning program

Pages: [1] 2
  Print  
Author Topic: What I have so Far,Learning program  (Read 1662 times)
OlDosLover
Guest
« on: June 11, 2011, 07:48:11 pm »

Hi all,
    While ... Wend is like Do ... Loop. The syntax is
WHILE condition true WEND. So in this case where
Quote
WHILE Letter$ <> CHR$(z)
is written , it means in plain english, While the generated letter does not equal the inputted letter. Which leads to repetition and allows user to select another letter.
    If you want to respond to an incorrect letter then simply add a comparison and message off that comparisson.
Code:
WHILE Letter$ <> CHR$(z)
        INPUT "Letter: ", Letter$ '//// somewhere in here, I want it to print "sorry, that is not the correct letter, try again " if the letter is not correct
        Letter$ = UCASE$(Letter$)
        If ucase$(Letter$) <> chr$(z) then
           Print "You selected ";Letter$;" which is wrong.Please enter ";chr$(z)
        end if
    WEND
OlDosLover.
« Last Edit: June 11, 2011, 07:51:54 pm by OlDosLover » Report Spam   Logged

Pages: [1] 2
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy