?
Solved

Using If / then /else

Posted on 2003-03-12
3
Medium Priority
?
209 Views
Last Modified: 2010-04-15
I'm trying to impliment some code.  There are two chunks that are duplicates except for a few pieces in each. I need to set up an if statement to get it to work but because I have the same "Dim" on both chunks of code. I was getting the name is being redefined error.

Is there a proper way to use the if statement I was using this

<% If cstr(requestform("whatisit")) = cstr("server")  Then


buch of code here

else If cstr(requestform("whatisit")) = cstr("standalone")  Then


more code here


end if
end if

0
Comment
Question by:gpyper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 46

Accepted Solution

by:
Kent Olsen earned 500 total points
ID: 8120066
Of course, C doesn't use "then" and "endif".  :)  Here are a couple of forms of nested "if"s.


if (condition-1)
{
}
else if (condition-2)
{
}
else if (condition-3)
{
}
etc....

if (condition-1)
{
  if (condition-2)
  {
  }
  else
  {
  }
else if (condition-3)
{
}
else if (condition-4)
{
  if (condition-5)
  {
  }
}


All of the above are valid.

Kdo
0
 
LVL 6

Expert Comment

by:gj62
ID: 8120080
put the Dim outside the If statement.

BTW - this seems more like VB than C...
0
 

Author Comment

by:gpyper
ID: 8120451
Doh ... posted to the wrong bloody section.... free points
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question