Shadow Blade
Morrowland Presents Apron Tutorials
game - design - multimedia - web - programming - tutorials - There are currently viewers visiting Apron Tutorials.
   
 
TECHNICAL
GRAPHICAL
SOUND
GAME
WEB
ARTICLE
TOOL
PROJECT
 
 NEWS

  news

  history


 TECHNICAL TUTORIALS

  opengl

  direct3d

  c/c++

  visual basic

  java

  c#


 WEB TUTORIALS

  html

  dhtml

  asp

  php


 IMAGE EDITING

  photoshop

  draw sketch


 3D MODELING

  3d studio


 PROJECTS

  shadow blade

  game environment

  virtual 3d guide

  billy blue flame


 DEMOS

  win32 api


 ARTICLES

  general

  opengl


 COMMUNITY

  about us

  credit

  contact











' The IF statement is the first thing i learned in programming.
' IF? is your questions to the application, so that you can
' decide what is going to happen next..

' if a counter is 10 then set it back to 0
' if you don't have any money left, you can't buy that dvd-player.
' if your character fall more than 3 units in a game, then he loses energy etc.

Dim num As Integer
Dim strReply As String


Private Sub Form_Load() 'Ask our question when the program loads Label1.Caption = "How many cars do you have?" End Sub
Private Sub Command1_Click() num = Int(Text1.Text) 'Input If (num > 0) Then strReply = "You have a car!" Else strReply = "You don't have a car!" End If If (num > 1) Then strReply = "Are you rich!" 'display our comment Label1.Caption = strReply End Sub 'sometimes you just need one if statement 'IF (?) Then do this 'IF (?) Then ' do this 'End If 'sometimes you ned two or more if statements 'If (question1?) Then to this 'If (question2?) Then to that 'sometimes it is easier to use if else 'If(question1?) Then to this Else do that 'If(question1?) Then 'to this 'Else 'do that 'End If 'sometimes it is easier to use if else if 'If(question1?) Then 'to this 'Else If 'do that 'End If ' I have tried to demonstrate different ways to use if tests ' It all depend on the "situation", and how you prefer to do your programming...


Download The Source Code! Visual Basic Source Code


I hope you found this Visual Basic tutorial useful!

Don't forget to mention Apron Tutorials in your References!

Best Regards
Ronny André Reierstad

 LINKS

  morrowland home



 GAME DEVELOPEMENT

  nvidia

  gamedev

  polycount


 PROJECTS

  shadow blade

  game environment

  virtual 3d guide

  billy blue flame


 MATH AND PHYSICS

  mathworld

  physicsworld







PLEASE LINK TO


  All rights reserved Morrowland © 2011  
Ronny André Reierstad