|
-
May 12th, 2003, 10:22 PM
#1
Thread Starter
Addicted Member
If Then Statements?
can someone give me examples of If Then statements..
-
May 13th, 2003, 11:59 AM
#2
Lively Member
You are a lively member. Not that this really means anything, but If Then Statements are basic to programming from the beginning.
Is there something specific you are looking for?
-
May 13th, 2003, 12:04 PM
#3
Frenzied Member
I agree, you should have learned If...Then...Else statements within the first 2 weeks of any programming class.
VB Code:
Dim a As Integer
a = 10
If(a = 10) then
'process some code here
Else
'process some code here
End If
Oh, and please don't double post...You have 8 replies in your other post asking the same question.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
May 13th, 2003, 02:25 PM
#4
I'm new at all this so I don't mind helping with IF/Then/Else 101:
Here are some basics:
If A = B then
do something
end if
If A = B then
do something
elseif A = C then
do something else
end if
If A = B then
If A = C then
do something
end if
else
end if
It helps alot if you use proper indentation.
-
May 13th, 2003, 02:25 PM
#5
I'm new at all this so I don't mind helping with IF/Then/Else 101:
Here are some basics:
If A = B then
do something
end if
If A = B then
do something
elseif A = C then
do something else
end if
If A = B then
If A = C then
do something
end if
else
do something else
end if
It helps alot if you use proper indentation.
-
May 13th, 2003, 03:12 PM
#6
The way I use it.
If your testing one condition expression against several possible values then use Select Case instead of If...ElseIf...End If
VB Code:
Select Case A
Case B
'Statements
Case C
'Statements
Case Else 'A <> B, A <> C
'Statements
End Select
If your testing several condition expressions then use If...ElseIf...End If.
VB Code:
If A = B Then
'Statements
ElseIf A + C = B Then
'Statements
Else
'Statements
End If
I hardly use If...ElseIf...End If. Add an About Form to see a sample of If...ElseIf...End If.
-
May 13th, 2003, 03:29 PM
#7
Lively Member
I don't think any of us mind helping. In fact, Memnoch1207 even gave an example. I just wanted to know more specifics to give a better answer.
Now I understand. Personally, I love the SELECT statement. I prefer that over ELSEIF. That just looks to confusing. The SELECT statement I think is much cleaner.
Just my humble (only a 'member') opinion.
How does one use proper indention on this website anyway?
-
May 13th, 2003, 03:36 PM
#8
PowerPoster
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
May 13th, 2003, 03:39 PM
#9
Fanatic Member
Originally posted by Virgil J. Schmidt
How does one use proper indention on this website anyway? [/B]
Enclose "vbcode" in brackets to start the code sample, then enclose "/vbcode" in brackets to end the sample. (Without the quotes)
-
May 13th, 2003, 03:41 PM
#10
Lively Member
True, True
I thougth of that, but I usually use that to complete an equation.
X = iff(a=y, b,c)
So I didn't consider it was the same in this case.
Last edited by Virgil J. Schmidt; May 13th, 2003 at 03:44 PM.
-
May 13th, 2003, 03:43 PM
#11
Lively Member
Originally posted by demotivater
Enclose "vbcode" in brackets to start the code sample, then enclose "/vbcode" in brackets to end the sample. (Without the quotes)
Thank you.
So
Hey, it works...Sorry for the thread interuption.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|