VB'NET Logical Operators and Control structure - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

VB'NET Logical Operators and Control structure

Description:

Elseif logical_expression then. statement. else. statement. End ... Next variable. For I=1 to 10. print I. Next I. VB6. Do while (condition) body of loop. Loop ... – PowerPoint PPT presentation

Number of Views:644
Avg rating:3.0/5.0
Slides: 13
Provided by: com106
Category:

less

Transcript and Presenter's Notes

Title: VB'NET Logical Operators and Control structure


1
VB.NET (Logical Operators and Control structure)
  • By
  • Srisawangwong,P. Asst. Prof.

2
Condition expression
Comparison operators
3
If statement
  • If logical_expression then
  • statement
  • Else
  • statement
  • End if

4
Nested If If logical_expression
then statement Elseif logical_expression
then statement else statement End if
5
Compound comparison
  • Logical operation
  • A And B true ????????????????????
  • A Or B true ????????????????????????????????????
  • Not A true ????? A ????????
  • A Xor B true ????????????????????????????

6
Select ..Case
  • Select case variable_or_expression
  • Case value_1
  • statement
  • Case value_2
  • statement
  • .
  • Case else
  • statement
  • End Select
  • value_x ???????? 3 ??????
  • ??????????????????/??????
  • ???? Is relation ???? Case Is lt 20, Case Is 8
  • ???? range value ????? ?????? to ???? Case 1 to 5

7
Loop
  • For Next
  • For Each ltvargt In ltarray or collection namegt
  • Statement
  • Exit For
  • Next ltvargt
  • While ltconditiongt
  • Statement
  • Exit while
  • End While
  • Do
  • Statement.
  • Exit Do
  • Loop Until ltconditiongt
  • Do whileltconditiongt
  • Statement..
  • Exit Do
  • Loop

8
For loop
  • Format
  • For variable start_value to end_value
  • statement
  • Next variable
  • For I1 to 10
  • print I
  • Next I

9
Do while loop
  • Do while (condition)
  • body of loop
  • Loop
  • Do while (I lt 10)
  • I I 1
  • Loop

10
DO Until loop
  • Do
  • body of loop
  • Loop Until (condition)
  • Do
  • I I 1
  • Loop Until ( I gt 10)

11
Exit loop
  • Normal exit
  • Command exit with Exit Do and Exit For

12
???????????? 4
  • ?????????????????????????????????? array ???? 10
    ???? ????????????? textbox ??????????????????????
Write a Comment
User Comments (0)
About PowerShow.com