|
-
Jun 21st, 2000, 04:24 AM
#1
Thread Starter
Registered User
Hello, i have a question i just was reading threw this book and i tried both codes but it didn't make sense to me why you had to use End if, but in the other Do Until loop, you didn't have too! well here is the code
Code:
'this is a little program to convert F to C
'and he didn't even Dim all the variables, tisk tisk
Prompt = "Enter a Fahrenheit temperature."
Do
FTemp = InputBox(Prompt, "Fahrenheit to Celcius")
If FTemp <> "" Then
CTemp = Int((FTemp - 32) * 5 / 9)
MsgBox (CTemp), , "Celcius Temperature"
End If
Loop While FTemp <> ""
that was the program that needed hte "END IF" but i don't know why, and here is the one that didn't need the "END If"
[/CODE]
Do
InpName = Inputbox("Enter your name or type Done to quit.")
If InpName <> "Done" then Print InpName
Loop Until InpName = "Done"
as you can see, he used the "If then Statement" but he didn't have to use the "END IF" unlike the top code, witch he used it in the same way and had to use "END IF" to make the program work, becuase i did it without the "END IF" and it woudlnt' work! so can you please tlel me why he had to use the "END IF" statement on the top code but not the bottem code? thanks for listening! 
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
|