新闻if-then-else问题 [英] newsbie if-then-else question
问题描述
你好,
我刚刚转向ASP。我过去两年一直在用PHP开发
年。我必须说,我对
初学者教程的质量有点失望。他们没有进一步教学
<%Response.Write(Hello World)%>
我还缺少一个官方网站,所有ASP命令都解释过,比如
你有php.net for PHP。
无论如何,我走了,这段代码包含一个错误:
If(lang2 =" DUT" OR lang2 =" dut" OR lang2 =" NL" OR lang2 =" nl")
然后(
left =" column_left_nl.html"
top =" top_nl.html"
)
否则if(lang2 =" FRE" OR lang2 =" fre" OR lang2 =" FR" OR
lang2 =" fr")然后(
left =" column_left_fr.html"
top =" top_fr.html"
)
否则if(lang2 = " ENG"或lang2 =" eng")然后(
left =" column_left_eng.html"
top =" top_eng.html"
)
结束如果
没有教程可以解释我是否使用括号
以及我应该使用哪种括号。那么,我需要所有这些
括号吗?
为什么:
lang =" DUT" ;
a声明,还有几行比较?
我真的很困惑,请帮帮我。
>
格雷茨,
巴顿
你可能会更快乐...更开心,用C#。这是一个更加特殊/硬性的语言,没有那么多的假设,比如
VB。使用ASP.NET,您可以使用任何符合CLR的语言编写应用程序
(VB.NET,C#,J#,托管C ++?)..这里是C#中的代码:
if(lang2 ==" DUT" || lang2 ==" dut" || lang2 ==" NL" || lang2 ==" nl")
{
left =" column_left_nl.html";
top =" top_nl.html";
}
elseif(lang2 ==" FRE" || lang2 ==" fre" || lang2 ==" FR" || lang2 ==" fr")
{
left =" column_left_fr.html";
top =" top_fr.html";
}
elseif(lang2 ==" ENG"
|| lang2 ==" eng")
{
left = " column_left_eng.html";
top =" top_eng.html";
}
没有假设。 =用于分配,==用于比较..
分号终止一条线等等......
Barton < BC *** @ NOSPAMMMhotmail.com>在留言中写道
新闻:0s ******************************** @ 4ax.com ...您好,
我刚刚转向ASP。我过去两年一直在用PHP开发。我必须说,我对
初学者教程的质量有点失望。他们没有进一步教学
<%Response.Write(Hello World)%>
我也缺少所有ASP的官方网站命令解释,比如
你有php.net for PHP。
无论如何,这里我去,这段代码包含一个bug:
If(lang2 = DUT或lang2 =dut或lang2 =NL或lang2 =nl)
然后(
left =" column_left_nl.html"
top = " top_nl.html"
)
否则if(lang2 =" FRE" OR lang2 =" fre" OR lang2 =" FR" OR
lang2 =" fr")然后(
left =" column_left_fr.html"
top =" top_fr.html"
)
否则if(lang2 =" ENG" OR lang2 =" eng" ;)然后(
left =" column_left_eng.html"
top =" top_eng.html"
)
结束如果
没有教程,解释我是否使用括号
和我应该使用哪种支架。那么,我需要所有这些
括号吗?
为什么:
lang =" DUT"
声明,还有几行比较?
我真的很困惑,请帮帮我。
格雷茨,
Barton>
转到 http://codemaster.digitalrice.com 并查看ASP部分
初学者教程
" Barton" < BC *** @ NOSPAMMMhotmail.com>在留言中写道
新闻:0s ******************************** @ 4ax.com ...您好,
我刚刚转向ASP。我过去两年一直在用PHP开发。我必须说,我对
初学者教程的质量有点失望。他们没有进一步教学
<%Response.Write(Hello World)%>
我也缺少所有ASP的官方网站命令解释,比如
你有php.net for PHP。
无论如何,这里我去,这段代码包含一个bug:
If(lang2 = DUT或lang2 =dut或lang2 =NL或lang2 =nl)
然后(
left =" column_left_nl.html"
top = " top_nl.html"
)
否则if(lang2 =" FRE" OR lang2 =" fre" OR lang2 =" FR" OR
lang2 =" fr")然后(
left =" column_left_fr.html"
top =" top_fr.html"
)
否则if(lang2 =" ENG" OR lang2 =" eng" ;)然后(
left =" column_left_eng.html"
top =" top_eng.html"
)
结束如果
没有教程,解释我是否使用括号
和我应该使用哪种支架。那么,我需要所有这些
括号吗?
为什么:
lang =" DUT"
声明,还有几行比较?
我真的很困惑,请帮帮我。
格雷茨,
Barton>
我用它们来更清楚
" Barton" < BC *** @ NOSPAMMMhotmail.com>在留言中写道
新闻:0s ******************************** @ 4ax.com ...您好,
我刚刚转向ASP。我过去两年一直在用PHP开发。我必须说,我对
初学者教程的质量有点失望。他们没有进一步教学
<%Response.Write(Hello World)%>
我也缺少所有ASP的官方网站命令解释,比如
你有php.net for PHP。
无论如何,这里我去,这段代码包含一个bug:
If(lang2 = DUT或lang2 =dut或lang2 =NL或lang2 =nl)
然后(
left =" column_left_nl.html"
top = " top_nl.html"
)
否则if(lang2 =" FRE" OR lang2 =" fre" OR lang2 =" FR" OR
lang2 =" fr")然后(
left =" column_left_fr.html"
top =" top_fr.html"
)
否则if(lang2 =" ENG" OR lang2 =" eng" ;)然后(
left =" column_left_eng.html"
top =" top_eng.html"
)
结束如果
没有教程,解释我是否使用括号
和我应该使用哪种支架。那么,我需要所有这些
括号吗?
为什么:
lang =" DUT"
声明,还有几行比较?
我真的很困惑,请帮帮我。
格雷茨,
Barton>
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.html"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr.html"
top = "top_fr.html"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_eng.html"
top = "top_eng.html"
)
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
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.html";
}
elseif (lang2 == "FRE" || lang2 == "fre" || lang2 == "FR" || lang2 == "fr")
{
left = "column_left_fr.html";
top = "top_fr.html";
}
elseif (lang2 == "ENG"
|| lang2 == "eng")
{
left = "column_left_eng.html";
top = "top_eng.html";
}
There are no assumptions. = is for assignment, == is for comparison..
semi-colons terminate a line, etc, etc...
"Barton" <bc***@NOSPAMMMhotmail.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.html"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr.html"
top = "top_fr.html"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_eng.html"
top = "top_eng.html"
)
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
Go to http://codemaster.digitalrice.com and check the ASP section for
beginners tutorial
"Barton" <bc***@NOSPAMMMhotmail.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.html"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr.html"
top = "top_fr.html"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_eng.html"
top = "top_eng.html"
)
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
I use them to be more clear
"Barton" <bc***@NOSPAMMMhotmail.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.html"
)
Else if (lang2 = "FRE" OR lang2 = "fre" OR lang2 = "FR" OR
lang2 = "fr") Then (
left = "column_left_fr.html"
top = "top_fr.html"
)
Else if (lang2 = "ENG" OR lang2 = "eng") Then (
left = "column_left_eng.html"
top = "top_eng.html"
)
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
这篇关于新闻if-then-else问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!