Visual Programming


Drag Drop Ex. 3 - Validating User Input

This exercise is to help you learn how to code.  

The following questions are about checking that a user's input is valid.
You should have completed the File Handling tutorial first.


Instructions

Read the questions in the grey boxes below on the left .

Drag each question in the grey boxes to the blue box with the correct code.

Then press the "Submit" button to check your answers.

What's the code to ..? Check if a textbox is empty. If it is, display an error message
What's the code to ..? Check if a user has entered a number in the textbox called Text1. If not, display an error message
If ( Not Text1 = "") ) then
   msgbox "some message"
End If
What's the code to ..? Check if a user has entered anything in the textbox. If so, display a message
If (Not IsNumeric(Text1) ) then
   msgbox "invalid input"
End If
If ( IsNumeric(Text1) ) then
   msgbox "invalid input"
End If
If ( Text1 = "" ) then
   msgbox "invalid input"
End If

 

 

   

  Unit Information

Assessment

Syllabus

Scheme of Work

Notes &Tutorials

Assignments

Quizzes

Books & Things

Links

ADR 2002