Academic Tutorials



English | French | Portugese | Dutch | Italian
Google

em linha

Home Códigos de fonte E-Livros Downloads Contatar-nos Sobre nós

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


If indicação
Previous Next




Com If a indicação, tomada de decisão simples em básico visual ocorrer, que tem o seguinte formato geral.

If condition Then

...statements

End If



Operadores condicionais

Usando operadores relacionais, as expressões condicionais são ajustadas até comparam valores e estes operadores, que foram apresentados mais cedo, são repetidos na seguinte tabela.

Operator Use
= Tests whether two values are equal.
<> Tests whether two values are not equal.
< Tests whether the first value is less than the second value.
> Tests whether the first value is greater than the second value.
<= Tests whether the first value is less than or equal to the second value.
>= Tests whether the first value is greater than or equal to the second value.
Uma expressão condicional é dada forma relacionando valores -- constantes ou variáveis -- com estes operadores. A comparação é avaliada como verdadeiro ou falso booleano, e o certificado reage a essa circunstância. O seguinte certificado apresenta um exemplo simples da tomada de decisão do certificado.
Sub Button_Click (Src As Object, Args As CommandEventArgs)

  If Args.CommandName = "Button 1" Then

    ButtonResponse.Text = "You clicked Button 1"

  End If

End Sub

<asp:Button Text="Click Me" runat="server"
  OnCommand="Button_Click" CommandName="Button 1"/>
<asp:Button Text="Click Me" runat="server"
  OnCommand="Button_Click" CommandName="Button 2"/>
<asp:Label id="ButtonResponse" EnableViewState="False" runat="server"/>



Operadores lógicos

Às vezes você necessita combinar testes da circunstância e essa vez, você pôde necessitar saber If um valor numérico estivesse dentro de uma escala particular; isto é, If o número é mais grande de um valor e menos do que um outro valor. Ou, você pôde querer ver If o número fosse fora de uma escala testando If é menos de um valor ou mais grande do que um segundo valor e estes tipos de testes da combinação estão feitos possíveis usando uns testes dois ou mais relacionais combinados com os operadores lógicos e, ou, e para não dar forma a comparações múltiplas. Estes operadores foram apresentados mais cedo e são repetidos na tabela dada abaixo.

Logical
Operator
Comparison
And condition1 And condition2
The condition1 and condition2 tests both must be true for the expression to be evaluated as True.
Or condition1 Or condition2
Either the condition1 or condition2 test must be true for the expression to be evaluated as True.
Not Not condition
The expression result is set to its opposite; a True condition is set to False and a False condition is set to True.
Xor condition1 Xor condition2
Either condition1 is true or condition2 is true, but not both, for the condition test to be evaluated as True.



Abaixo está um exemplo que use um teste múltiplo da circunstância e após ter incorporado um valor à caixa de texto, estala a tecla da “verificação”. O certificado determina If você incorporar um número entre 1 e 10.If assim, confirma este valor com uma mensagem.

Sub Check_Number (Src As Object, Args As EventArgs)

If Number.Text <> "" Then

If Number.Text >= 1 And Number.Text <= 10 Then
NumberResponse.Text = "The number is between 1 and 10."
End If

End If

End Sub
<asp:TextBox id="Number" Size="1" runat="server"/>
<asp:Button Text="Check" OnClick="Check_Number" runat="server"/>
<asp:Label id="NumberResponse" EnableViewState="False" runat="server"/>

If Number.Text <> "" Then checks whether a value has been entered into the textbox (it is not equal to empty, or null) and if this condition is true, then the enclosed statements are executed. The enclosed statements form a second If test and in this case the value entered in the textbox is tested so see if it is greater than or equal to 1 and if it is less than or equal to 10. If these two conditions are true, then only the message is displayed





Previous Next

Keywords: The If Statement in VB.NET, if shell script, if unix shell, switch case statement, if visual basic, while loop statement, sql server if, for loop statement, sql server statement, if perl, php if, if unix, java statement, javascript if, sql if


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.