Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: if/else structure.....?


Message #1 by "Sukhi" <sukhdeepsamra@h...> on Wed, 24 Oct 2001 23:51:02
I am if/else statement in my asp page...can anyone please let me know what 

ia m missing here...

is there a way to do switch in ASP?? or no?? The follwoing code give me 

error..its say 'end expected' ..right after 'insert record'...any cluess??





if eof then

	if title=1 then

		if array(i)=2 || array(i)3 then

		 	display eror

		end if

	if title=2 then

		if array(i)=2 || array(i)3 then

		 	display eror

		end if

	if title=3 then

		if array(i)=2 || array(i)3 then

		 	display eror

		end if

	else

		"Insert record"



					

else

	"already exists"



end if
Message #2 by Anupama Nallari <ANallari@p...> on Wed, 24 Oct 2001 17:51:36 -0500
You do not have the right number of endif's. You need to add three more end

if's at the end of the last end if.



Anu







-----Original Message-----

From: Sukhi [mailto:sukhdeepsamra@h...]

Sent: Wednesday, October 24, 2001 6:51 PM

To: ASP Web HowTo

Subject: [asp_web_howto] if/else structure.....?





I am if/else statement in my asp page...can anyone please let me know what 

ia m missing here...

is there a way to do switch in ASP?? or no?? The follwoing code give me 

error..its say 'end expected' ..right after 'insert record'...any cluess??





if eof then

	if title=1 then

		if array(i)=2 || array(i)3 then

		 	display eror

		end if

	if title=2 then

		if array(i)=2 || array(i)3 then

		 	display eror

		end if

	if title=3 then

		if array(i)=2 || array(i)3 then

		 	display eror

		end if

	else

		"Insert record"



					

else

	"already exists"



end if



// You need to have 



end if

end if

end if here



Message #3 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Thu, 25 Oct 2001 09:41:08 +0100
the vbscript equivalent of switch is select case



Select case title

 case 1

 ...

 case 2

 ...

 case 3

 ...

End Select



-----Original Message-----

From: Sukhi [mailto:sukhdeepsamra@h...]

Sent: 25 October 2001 00:51

To: ASP Web HowTo

Subject: [asp_web_howto] if/else structure.....?





I am if/else statement in my asp page...can anyone please let me know what 

ia m missing here...

is there a way to do switch in ASP?? or no?? The follwoing code give me 

error..its say 'end expected' ..right after 'insert record'...any cluess??





if eof then

 if title=1 then

  if array(i)=2 || array(i)3 then

    display eror

  end if

 if title=2 then

  if array(i)=2 || array(i)3 then

    display eror

  end if

 if title=3 then

  if array(i)=2 || array(i)3 then

    display eror

  end if

 else

  "Insert record"



     

else

 "already exists"



end if



Message #4 by "O'Hara, Elliott M" <EMOHARA@k...> on Thu, 25 Oct 2001 05:48:04 -0400
in vbs

use 

Select Case X

	Case 1

	do stuff

	Case 2

	other stuff

	Case Else

	whatever

End Select



-----Original Message-----

From: Sukhi [mailto:sukhdeepsamra@h...]

Sent: Wednesday, October 24, 2001 7:51 PM

To: ASP Web HowTo

Subject: [asp_web_howto] if/else structure.....?





I am if/else statement in my asp page...can anyone please let me know what 

ia m missing here...

is there a way to do switch in ASP?? or no?? The follwoing code give me 

error..its say 'end expected' ..right after 'insert record'...any cluess??





if eof then

	if title=1 then

		if array(i)=2 || array(i)3 then

		 	display eror

		end if

	if title=2 then

		if array(i)=2 || array(i)3 then

		 	display eror

		end if

	if title=3 then

		if array(i)=2 || array(i)3 then

		 	display eror

		end if

	else

		"Insert record"



					

else

	"already exists"



end if

Message #5 by Tarey Gettys <tareyg@y...> on Thu, 25 Oct 2001 08:01:24 -0700 (PDT)
You need an end if statement after "insert record".

This is for the if Title = 1 statement.



However, a select case would be much cleaner.

Tarey

--- "Alex Shiell, ITS, EC, SE"

<alex.shiell@s...> wrote:

> the vbscript equivalent of switch is select case

> 

> Select case title

>  case 1

>  ...

>  case 2

>  ...

>  case 3

>  ...

> End Select

> 

> -----Original Message-----

> From: Sukhi [mailto:sukhdeepsamra@h...]

> Sent: 25 October 2001 00:51

> To: ASP Web HowTo

> Subject: [asp_web_howto] if/else structure.....?

> 

> 

> I am if/else statement in my asp page...can anyone

> please let me know what 

> ia m missing here...

> is there a way to do switch in ASP?? or no?? The

> follwoing code give me 

> error..its say 'end expected' ..right after 'insert

> record'...any cluess??

> 

> 

> if eof then

>  if title=1 then

>   if array(i)=2 || array(i)3 then

>     display eror

>   end if

>  if title=2 then

>   if array(i)=2 || array(i)3 then

>     display eror

>   end if

>  if title=3 then

>   if array(i)=2 || array(i)3 then

>     display eror

>   end if

>  else

>   "Insert record"

> 

>      

> else

>  "already exists"

> 

> end if

  Return to Index