.


:




:

































 

 

 

 


If




End If

! curOnֳ 10 , , curOֳ > 1000. .

 

:

 

If < 1> Then

< 1>

ElseIf < 2> Then

< 2>

ElseIf < 3> Then

< 3>

..

ElseIf< n> Then

< n>

End If

 

. <1> True, < 1>, <2>; <2> True, < 2>, <3>; .., < n>. , If , End If.

, , . , , Else.

 

If

 

.

.

 

 

Private Sub CommandButton1_Click()

'. x.

' :

' y, :

'x^2-3*x+1, x<-2;

'sin(3*x)^2*log(abs(2*x-1))/log(3), -2=<x=<3;

'x^2+5*x+1, 0<x<2;

'2^(-x), x>=2;

Dim x, y As Single

x = CSng(TextBox1.Text)

If x <= -2 Then

y = x ^ 2 - 3 * x + 1

ElseIf (x >= -2) And (x <= 0) Then

y = Sin(3 * x) ^ 2 * Log(Abs(2 * x - 1)) / Log(3)

ElseIf (x > 0) And (x < 2) Then

y = x ^ 2 + 5 * x + 1

Else

y = 2 ^ (-x)

End If

MsgBox "x=" & Format(x, "0000.00") & " y=" & _

Format(y, "0000.00")

TextBox1.Text = Format(x, "0000.00")

TextBox2.Text = Format(y, "0000.00")

TextBox3.Text = TextBox3.Text _

+ "x=" + Format(x, "0000.00") + " y=" + _

Format(y, "0000.00") + vbCr

End Sub

 

 

11.6. Select Case

 

 
 

Select Case :

 

< > - , , ;

<1>, <2>, , < n> - , ;

< 1>, < 2>, , < Else > - VBA .

, . 15.4 .

 

.15.4. ase

ase
 
1, 3, 5, 7
1, 3, 5, 7 To 9, 11
3, 5, Is > 7
Is < 0, 0, 1, 3, 5 To 7, Is >10

 

ϳ Select Case < >, . , <1>. , <1>, < 1>, . <1>, , <2> .. , < Else >, Else , Select Case.

 





:


: 2016-12-06; !; : 516 |


:

:

80% - .
==> ...

1723 - | 1568 -


© 2015-2024 lektsii.org - -

: 0.009 .