473,799 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

newsbie if-then-else question

Hello,

I just made to move to ASP. I have been developing in PHP the past two
years. I must say that I'm a little disappointed in the quality of the
beginners tutorials. They don't go further then teaching

<% Response.Write( "Hello World") %>

I also lack an official website with all ASP commands explained, like
you have php.net for PHP.

Anyway, here I go, this piece of code contains a bug:

If (lang2 = "DUT" OR lang2 = "dut" OR lang2 = "NL" OR lang2 = "nl")
Then (
left = "column_left_nl .html"
top = "top_nl.htm l"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr .html"
top = "top_fr.htm l"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_en g.html"
top = "top_eng.ht ml"
)
End If

There is no tutorial that explains me whether to use brackets or not
and which kind of brackets I should use. So, do I need all these
brackets?

And why is:

lang = "DUT"

a declaration, and a couple lines further a comparison?
I'm really confused, please help me out.

Greetz,

Barton
Nov 17 '05 #1
9 1426
You might be happier... much happier, with C#. It's a much more
specific/hard-lined language where there aren't as many assumptions, like in
VB. With ASP.NET, you can write your app in any CLR-compliant language
(VB.NET, C#, J#,managed C++?).. here's that code in C#:

if (lang2 == "DUT" || lang2 == "dut" || lang2 == "NL" || lang2 == "nl")
{
left = "column_left_nl .html";
top = "top_nl.htm l";
}
elseif (lang2 == "FRE" || lang2 == "fre" || lang2 == "FR" || lang2 == "fr")
{
left = "column_left_fr .html";
top = "top_fr.htm l";
}
elseif (lang2 == "ENG"
|| lang2 == "eng")
{
left = "column_left_en g.html";
top = "top_eng.ht ml";
}

There are no assumptions. = is for assignment, == is for comparison..
semi-colons terminate a line, etc, etc...
"Barton" <bc***@NOSPAMMM hotmail.com> wrote in message
news:0s******** *************** *********@4ax.c om...
Hello,

I just made to move to ASP. I have been developing in PHP the past two
years. I must say that I'm a little disappointed in the quality of the
beginners tutorials. They don't go further then teaching

<% Response.Write( "Hello World") %>

I also lack an official website with all ASP commands explained, like
you have php.net for PHP.

Anyway, here I go, this piece of code contains a bug:

If (lang2 = "DUT" OR lang2 = "dut" OR lang2 = "NL" OR lang2 = "nl")
Then (
left = "column_left_nl .html"
top = "top_nl.htm l"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr .html"
top = "top_fr.htm l"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_en g.html"
top = "top_eng.ht ml"
)
End If

There is no tutorial that explains me whether to use brackets or not
and which kind of brackets I should use. So, do I need all these
brackets?

And why is:

lang = "DUT"

a declaration, and a couple lines further a comparison?
I'm really confused, please help me out.

Greetz,

Barton

Nov 17 '05 #2
Go to http://codemaster.digitalrice.com and check the ASP section for
beginners tutorial

"Barton" <bc***@NOSPAMMM hotmail.com> wrote in message
news:0s******** *************** *********@4ax.c om...
Hello,

I just made to move to ASP. I have been developing in PHP the past two
years. I must say that I'm a little disappointed in the quality of the
beginners tutorials. They don't go further then teaching

<% Response.Write( "Hello World") %>

I also lack an official website with all ASP commands explained, like
you have php.net for PHP.

Anyway, here I go, this piece of code contains a bug:

If (lang2 = "DUT" OR lang2 = "dut" OR lang2 = "NL" OR lang2 = "nl")
Then (
left = "column_left_nl .html"
top = "top_nl.htm l"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr .html"
top = "top_fr.htm l"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_en g.html"
top = "top_eng.ht ml"
)
End If

There is no tutorial that explains me whether to use brackets or not
and which kind of brackets I should use. So, do I need all these
brackets?

And why is:

lang = "DUT"

a declaration, and a couple lines further a comparison?
I'm really confused, please help me out.

Greetz,

Barton

Nov 17 '05 #3
I use them to be more clear

"Barton" <bc***@NOSPAMMM hotmail.com> wrote in message
news:0s******** *************** *********@4ax.c om...
Hello,

I just made to move to ASP. I have been developing in PHP the past two
years. I must say that I'm a little disappointed in the quality of the
beginners tutorials. They don't go further then teaching

<% Response.Write( "Hello World") %>

I also lack an official website with all ASP commands explained, like
you have php.net for PHP.

Anyway, here I go, this piece of code contains a bug:

If (lang2 = "DUT" OR lang2 = "dut" OR lang2 = "NL" OR lang2 = "nl")
Then (
left = "column_left_nl .html"
top = "top_nl.htm l"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr .html"
top = "top_fr.htm l"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_en g.html"
top = "top_eng.ht ml"
)
End If

There is no tutorial that explains me whether to use brackets or not
and which kind of brackets I should use. So, do I need all these
brackets?

And why is:

lang = "DUT"

a declaration, and a couple lines further a comparison?
I'm really confused, please help me out.

Greetz,

Barton

Nov 17 '05 #4
I'm not impressed with the Tutorials. They are too basic! And they
don't tell anything about the brackets, about ISSET commands etc.

Greetz,

Barton

On Tue, 26 Aug 2003 02:28:50 +0600, "Arsalan"
<ar***********@ hotmail.com> wrote:
Go to http://codemaster.digitalrice.com and check the ASP section for
beginners tutorial

"Barton" <bc***@NOSPAMMM hotmail.com> wrote in message
news:0s******* *************** **********@4ax. com...
Hello,

I just made to move to ASP. I have been developing in PHP the past two
years. I must say that I'm a little disappointed in the quality of the
beginners tutorials. They don't go further then teaching

<% Response.Write( "Hello World") %>

I also lack an official website with all ASP commands explained, like
you have php.net for PHP.

Anyway, here I go, this piece of code contains a bug:

If (lang2 = "DUT" OR lang2 = "dut" OR lang2 = "NL" OR lang2 = "nl")
Then (
left = "column_left_nl .html"
top = "top_nl.htm l"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr .html"
top = "top_fr.htm l"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_en g.html"
top = "top_eng.ht ml"
)
End If

There is no tutorial that explains me whether to use brackets or not
and which kind of brackets I should use. So, do I need all these
brackets?

And why is:

lang = "DUT"

a declaration, and a couple lines further a comparison?
I'm really confused, please help me out.

Greetz,

Barton


Nov 17 '05 #5
Well, this sounds much more familiar to me!
I'm used to "=" and "==" and also the ";" for ending lines.

But does this C# run at every normal ISS server?

Greetz,

Barton

On Mon, 25 Aug 2003 20:13:39 GMT, "Frank Drebin"
<no*****@imsick ofspam.com> wrote:
You might be happier... much happier, with C#. It's a much more
specific/hard-lined language where there aren't as many assumptions, like in
VB. With ASP.NET, you can write your app in any CLR-compliant language
(VB.NET, C#, J#,managed C++?).. here's that code in C#:

if (lang2 == "DUT" || lang2 == "dut" || lang2 == "NL" || lang2 == "nl")
{
left = "column_left_nl .html";
top = "top_nl.htm l";
}
elseif (lang2 == "FRE" || lang2 == "fre" || lang2 == "FR" || lang2 == "fr")
{
left = "column_left_fr .html";
top = "top_fr.htm l";
}
elseif (lang2 == "ENG"
|| lang2 == "eng")
{
left = "column_left_en g.html";
top = "top_eng.ht ml";
}

There are no assumptions. = is for assignment, == is for comparison..
semi-colons terminate a line, etc, etc...
"Barton" <bc***@NOSPAMMM hotmail.com> wrote in message
news:0s******* *************** **********@4ax. com...
Hello,

I just made to move to ASP. I have been developing in PHP the past two
years. I must say that I'm a little disappointed in the quality of the
beginners tutorials. They don't go further then teaching

<% Response.Write( "Hello World") %>

I also lack an official website with all ASP commands explained, like
you have php.net for PHP.

Anyway, here I go, this piece of code contains a bug:

If (lang2 = "DUT" OR lang2 = "dut" OR lang2 = "NL" OR lang2 = "nl")
Then (
left = "column_left_nl .html"
top = "top_nl.htm l"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr .html"
top = "top_fr.htm l"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_en g.html"
top = "top_eng.ht ml"
)
End If

There is no tutorial that explains me whether to use brackets or not
and which kind of brackets I should use. So, do I need all these
brackets?

And why is:

lang = "DUT"

a declaration, and a couple lines further a comparison?
I'm really confused, please help me out.

Greetz,

Barton


Nov 17 '05 #6
I would write the code as such

If lang2.ToUpper = "DUT" OR lang2.ToUpper = "NL" Then
left = "column_left_nl .html"
top = "top_nl.htm l"
ElseIf lang2.ToUpper = "FRE" OR lang2.ToUpper = "FR" Then
left = "column_left_fr .html"
top = "top_fr.htm l"
ElseIf lang2.ToUpper = "ENG" Then
left = "column_left_en g.html"
top = "top_eng.ht ml"
End If
This is very readable to me, but then I learned .NET using VB not C#

Severin



"Barton" <bc***@NOSPAMMM hotmail.com> wrote in message
news:0s******** *************** *********@4ax.c om...
Hello,

I just made to move to ASP. I have been developing in PHP the past two
years. I must say that I'm a little disappointed in the quality of the
beginners tutorials. They don't go further then teaching

<% Response.Write( "Hello World") %>

I also lack an official website with all ASP commands explained, like
you have php.net for PHP.

Anyway, here I go, this piece of code contains a bug:

If (lang2 = "DUT" OR lang2 = "dut" OR lang2 = "NL" OR lang2 = "nl")
Then (
left = "column_left_nl .html"
top = "top_nl.htm l"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr .html"
top = "top_fr.htm l"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_en g.html"
top = "top_eng.ht ml"
)
End If

There is no tutorial that explains me whether to use brackets or not
and which kind of brackets I should use. So, do I need all these
brackets?

And why is:

lang = "DUT"

a declaration, and a couple lines further a comparison?
I'm really confused, please help me out.

Greetz,

Barton

Nov 17 '05 #7
I get the error: Object required: 'DUT'

Seems I first need to make an object of DUT?
How do I do this?

Greetz,

Barton

On Mon, 25 Aug 2003 16:48:28 -0500, "Severin" <se*@sevsamp.co m> wrote:
I would write the code as such

If lang2.ToUpper = "DUT" OR lang2.ToUpper = "NL" Then
left = "column_left_nl .html"
top = "top_nl.htm l"
ElseIf lang2.ToUpper = "FRE" OR lang2.ToUpper = "FR" Then
left = "column_left_fr .html"
top = "top_fr.htm l"
ElseIf lang2.ToUpper = "ENG" Then
left = "column_left_en g.html"
top = "top_eng.ht ml"
End If
This is very readable to me, but then I learned .NET using VB not C#

Severin



"Barton" <bc***@NOSPAMMM hotmail.com> wrote in message
news:0s******* *************** **********@4ax. com...
Hello,

I just made to move to ASP. I have been developing in PHP the past two
years. I must say that I'm a little disappointed in the quality of the
beginners tutorials. They don't go further then teaching

<% Response.Write( "Hello World") %>

I also lack an official website with all ASP commands explained, like
you have php.net for PHP.

Anyway, here I go, this piece of code contains a bug:

If (lang2 = "DUT" OR lang2 = "dut" OR lang2 = "NL" OR lang2 = "nl")
Then (
left = "column_left_nl .html"
top = "top_nl.htm l"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr .html"
top = "top_fr.htm l"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_en g.html"
top = "top_eng.ht ml"
)
End If

There is no tutorial that explains me whether to use brackets or not
and which kind of brackets I should use. So, do I need all these
brackets?

And why is:

lang = "DUT"

a declaration, and a couple lines further a comparison?
I'm really confused, please help me out.

Greetz,

Barton


Nov 17 '05 #8
Severin,

A Select Case statement might be more readable.

Select Case lang2.ToUpper
Case "DUT", "NL"
left = "column_left_nl .html"
top = "top_nl.htm l"

Case "FRE", "FR"
left = "column_left_fr .html"
top = "top_fr.htm l"

Case "ENG"
left = "column_left_en g.html"
top = "top_eng.ht ml"

End Select
--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Severin" <se*@sevsamp.co m> wrote in message
news:bi*******@ library2.airnew s.net...
I would write the code as such

If lang2.ToUpper = "DUT" OR lang2.ToUpper = "NL" Then
left = "column_left_nl .html"
top = "top_nl.htm l"
ElseIf lang2.ToUpper = "FRE" OR lang2.ToUpper = "FR" Then
left = "column_left_fr .html"
top = "top_fr.htm l"
ElseIf lang2.ToUpper = "ENG" Then
left = "column_left_en g.html"
top = "top_eng.ht ml"
End If
This is very readable to me, but then I learned .NET using VB not C#

Severin



"Barton" <bc***@NOSPAMMM hotmail.com> wrote in message
news:0s******** *************** *********@4ax.c om...
Hello,

I just made to move to ASP. I have been developing in PHP the past two
years. I must say that I'm a little disappointed in the quality of the
beginners tutorials. They don't go further then teaching

<% Response.Write( "Hello World") %>

I also lack an official website with all ASP commands explained, like
you have php.net for PHP.

Anyway, here I go, this piece of code contains a bug:

If (lang2 = "DUT" OR lang2 = "dut" OR lang2 = "NL" OR lang2 = "nl")
Then (
left = "column_left_nl .html"
top = "top_nl.htm l"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr .html"
top = "top_fr.htm l"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_en g.html"
top = "top_eng.ht ml"
)
End If

There is no tutorial that explains me whether to use brackets or not
and which kind of brackets I should use. So, do I need all these
brackets?

And why is:

lang = "DUT"

a declaration, and a couple lines further a comparison?
I'm really confused, please help me out.

Greetz,

Barton


Nov 17 '05 #9
Severin,

A Select Case statement might be more readable.

Select Case lang2.ToUpper
Case "DUT", "NL"
left = "column_left_nl .html"
top = "top_nl.htm l"

Case "FRE", "FR"
left = "column_left_fr .html"
top = "top_fr.htm l"

Case "ENG"
left = "column_left_en g.html"
top = "top_eng.ht ml"

End Select
--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Severin" <se*@sevsamp.co m> wrote in message
news:bi*******@ library2.airnew s.net...
I would write the code as such

If lang2.ToUpper = "DUT" OR lang2.ToUpper = "NL" Then
left = "column_left_nl .html"
top = "top_nl.htm l"
ElseIf lang2.ToUpper = "FRE" OR lang2.ToUpper = "FR" Then
left = "column_left_fr .html"
top = "top_fr.htm l"
ElseIf lang2.ToUpper = "ENG" Then
left = "column_left_en g.html"
top = "top_eng.ht ml"
End If
This is very readable to me, but then I learned .NET using VB not C#

Severin



"Barton" <bc***@NOSPAMMM hotmail.com> wrote in message
news:0s******** *************** *********@4ax.c om...
Hello,

I just made to move to ASP. I have been developing in PHP the past two
years. I must say that I'm a little disappointed in the quality of the
beginners tutorials. They don't go further then teaching

<% Response.Write( "Hello World") %>

I also lack an official website with all ASP commands explained, like
you have php.net for PHP.

Anyway, here I go, this piece of code contains a bug:

If (lang2 = "DUT" OR lang2 = "dut" OR lang2 = "NL" OR lang2 = "nl")
Then (
left = "column_left_nl .html"
top = "top_nl.htm l"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr .html"
top = "top_fr.htm l"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_en g.html"
top = "top_eng.ht ml"
)
End If

There is no tutorial that explains me whether to use brackets or not
and which kind of brackets I should use. So, do I need all these
brackets?

And why is:

lang = "DUT"

a declaration, and a couple lines further a comparison?
I'm really confused, please help me out.

Greetz,

Barton


Nov 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3705
by: John Ryan | last post by:
What PHP code would I use to check if submitted sites to my directory actually exist?? I want to use something that can return the server code to me, ie HTTP 300 OK, or whatever. Can I do this with sockets??
2
3004
by: Sugapablo | last post by:
My brain is frozen on a convenient way to figure out if today is the 1st, 2nd, 3rd, 4th, or last Thursday of the month. Basically I need something that will figure this out for any given day for any given month. date() has everything BUT a 0-5 return for this. -- Sugapablo - russpghREMOVE@stargate.net http://www.sugapablo.com | ICQ: 902845
5
3717
by: george | last post by:
Guys and girls, I'll be quite honest. I don't have the faintest idea how to do this, while I can do other php without a problem. Once I know how to go about it I'll be okay. It's two things I think? 1. see if there's a trailing slash and delete it. 2. Remove the preceding path to /x, the folders and slashes, and delete them. and then I have x. X by the way is the final folder in a website and this grabs it for
5
1878
by: Steve | last post by:
Hello, I've been a PHP programmer for a number of years and have just started to learn JS. My Employer (a water analysis lab) wants what should be a very simple .js written that basically takes sample hold time data from EPA regulations and spits out when a sample would expire, so we can properly label the thing. The problem is that the .js I have written appears to be doing something unexpected. The Analysis options are presented as...
14
2404
by: Santi | last post by:
I see in some code, I don´t remember now if it is c# or c++, that the when they perform a comparison they use the value first and then the variable, like: if( null == variable ){} Is there an explanation for this or is it the same as doing the usual variable == value? -- Santi
0
2647
by: Benny Ng | last post by:
Hi,All, When i deploy Enterprise library with my application ,i used XCOPY to deploy it into my test server. But when application runs, shown some error related registry. (But actually I haven't any method or component to wrote registry) After I used "InstallUtil" to registry Enterprise Library (those DLLs) to the deployment server, the application runs smoothly. Now I wonder why i need to registry those Enterprise Library DLLs into
40
2997
by: Jeff | last post by:
I have a system on a network and want to determine if anyone is currently connected to the back-end files. An interesting twist is that I have noticed that some users can be connected (have the front end open at the first form) and even though this links to the back-end files, there are no ldb files created. This is so I know when it is safe to compact the back-end files without going round to make sure everyone is logged off. User...
6
1651
by: =?Utf-8?B?UmljaA==?= | last post by:
In C# you have If ... { { ... } } If you place the mouse cursor next to a bracket and press ctrl something
2
1405
by: .rhavin grobert | last post by:
hello;-) i have that following little template that defines some type of vector. it works with structs and i want to use it also for simple pointers. the problem is, in following function... ______________________________________ template <class T, typename I>
1
1396
by: grego9 | last post by:
I have a problem in Excel 2000. I am trying to return a value in Column F based on what is Column E. There are about 14 different text variants in Column E (all look like "2008H1", "2008H2)). Depending on the variable in column E I want a different columns value (eg column P, S, T etc) returning in Column F for that row. The nested IF function didn't work as I was limited to 7 variants. I tried doing something called criteria - which...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10485
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10252
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.