Structured Programming (2024)

For i = 1 To n Step k &nbsp ' Step k is optional
&nbsp&nbsp&nbsp&nbsp action
Next
Example:

Select Statement &nbsp Execute the action corresponding to the valueof the expression.

Select Case value1
&nbsp&nbsp&nbsp Case value1
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp action1
&nbsp&nbsp&nbsp Case value2
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp action2
&nbsp&nbsp&nbsp Case value3
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp action3
&nbsp&nbsp&nbsp Case Else
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp defaultAction
End Select
Example:

Select Case n
&nbsp&nbsp&nbsp Case 1
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp WriteLine("One")
&nbsp&nbsp&nbsp Case 2
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp WriteLine("Two")
&nbsp&nbsp&nbsp Case 3
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp WriteLine("Three")
&nbsp&nbsp&nbsp Case Else
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp WriteLine("Many")
End Select

Structured Programming (2024)

References

Top Articles
Latest Posts
Article information

Author: Kimberely Baumbach CPA

Last Updated:

Views: 6522

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Kimberely Baumbach CPA

Birthday: 1996-01-14

Address: 8381 Boyce Course, Imeldachester, ND 74681

Phone: +3571286597580

Job: Product Banking Analyst

Hobby: Cosplaying, Inline skating, Amateur radio, Baton twirling, Mountaineering, Flying, Archery

Introduction: My name is Kimberely Baumbach CPA, I am a gorgeous, bright, charming, encouraging, zealous, lively, good person who loves writing and wants to share my knowledge and understanding with you.