5 Replies - 799 Views - Last Post: 07 January 2011 - 02:41 PM Rate Topic: -----

#1 jnstech  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-January 11

if (statement)

Posted 06 January 2011 - 02:14 AM

need help from statement using if, and,else please help to understand well. :surrender:
Is This A Good Question/Topic? 0
  • +

Replies To: if (statement)

#2 sas1ni69  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 85
  • View blog
  • Posts: 431
  • Joined: 04-December 08

Re: if (statement)

Posted 06 January 2011 - 03:31 AM

An IF statement is used when you have a condition to meet. Say if you're developing a grade system maybe you'd use something like this:

Dim studentMark As Integer
Dim studentGrade As String

studentMark = textbox1.text

If number < 50 Then
    studentGrade = "Fail"
Else
    studentGrade = "Pass"
End If





You could also check out this link MSDN VB Help
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6064
  • View blog
  • Posts: 23,520
  • Joined: 23-August 08

Re: if (statement)

Posted 06 January 2011 - 04:50 AM

It appears from the one of the other topics opened by this person (which was banished to the "Give Me The Codez" section), they're ACTUALLY using Visual Basic .NET, so I'll move this there. OP, VB6 is VERY DIFFERENT from VB.NET.

If you're having trouble with if/else...you've got a LONG road ahead.
Was This Post Helpful? 0
  • +
  • -

#4 Luc001  Icon User is offline

  • D.I.C Addict

Reputation: 84
  • View blog
  • Posts: 617
  • Joined: 04-May 09

Re: if (statement)

Posted 06 January 2011 - 05:54 AM

Hi,

You can find some explanation, about If statements, here.
Was This Post Helpful? 0
  • +
  • -

#5 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: if (statement)

Posted 07 January 2011 - 03:31 AM

If statement, is to see if a condition is true or false.

If the door is not open, it's closed...
Was This Post Helpful? 0
  • +
  • -

#6 Guest_Tess F*


Reputation:

Re: if (statement)

Posted 07 January 2011 - 02:41 PM

View Postjnstech, on 06 January 2011 - 01:14 AM, said:

need help from statement using if, and,else please help to understand well. :surrender:


If / else statements are conditions statements.

Always have the following sytax if -> then -> elseif -> then ->else->endif
your can have as many statements as you want

for example
if grade>=85 ANd grade<=100 then
lbl.text="A"
Elseif Grade >=70 and grade<=84 then
lbl.text="B"
Else
lbl.text="C"
End if
Was This Post Helpful? 0

Page 1 of 1