VB.NET . , Dim.
:
OptionExplicit. OptionExplicit, . OptionStrict, . OptionExplicit .
OptionStrict. OptionStrictOn . , (, Integer Boolean), .
OptionCompare. , (Binary) (Text).
. (x y) , (z = ).
<F9> , . . , , . <F10>,
z, . <F10>, . .
, ( ) , .
, OptionStrict ( ). On .
, (. 4.2.8-6).
. 4.2.8 -6.
. 4.2.8 -7. VS,
x = TextBox 1. Text, , OptionStrictOn String Double. , , Double. . , .
|
|
, , , (. .1.2-7).
Option Strict On Imports System. Math ' PublicClass Form1 PrivateSub Button1_Click(sender AsObject, _ e As EventArgs) Handles Button1.Click Dim , y, z, m, n AsDouble, p AsSingle, k AsInteger Dim s1, s2 AsString = CDbl (TextBox1.Text) ' String Double y = CDbl (TextBox2.Text) z = (0.002 - Exp( ^ y)) / ((100 - y) * ( + 2)) p = CSng (z) ' Double Single k = CInt (z) ' Double Integer m = Fix(z): n = Int(z) s1 = CStr (z): s2 = CStr (p) ' String TextBox3.Text = CStr (z): TextBox4.Text = CStr (k) TextBox5.Text = CStr (m): TextBox6.Text = CStr (n) TextBox7.Text = CStr (p) TextBox8.Text = CStr (z + p) ' TextBox9.Text = s1 + s2 ' EndSub PrivateSub Button2_Click(sender AsObject, _ e As EventArgs) Handles Button4.2.Click End EndSub EndClass |
. 4.2.8 -8. 2.1
, , , , , CDbl(). CStr() . ( k) z CInt(), , . , OptionStrictOn , .
. .1.2-8
.
2.2 . 2.2 , , .