質問編集履歴
3
詳しく修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,9 +12,19 @@
|
|
12
12
|
|
13
13
|
{
|
14
14
|
|
15
|
-
public float a
|
15
|
+
public float a ; // textboxの値を取ってきます
|
16
16
|
|
17
|
+
public float b ; // textboxの値を取ってきます
|
18
|
+
|
19
|
+
|
20
|
+
|
17
|
-
public
|
21
|
+
public void keisan()
|
22
|
+
|
23
|
+
{
|
24
|
+
|
25
|
+
Test.test(a,b)
|
26
|
+
|
27
|
+
}
|
18
28
|
|
19
29
|
|
20
30
|
|
@@ -22,7 +32,7 @@
|
|
22
32
|
|
23
33
|
{
|
24
34
|
|
25
|
-
Save.save (
|
35
|
+
Save.save ( x ); // クラス「Test」内の変数、x を受け取り、引数で渡したい
|
26
36
|
|
27
37
|
}
|
28
38
|
|
@@ -34,7 +44,19 @@
|
|
34
44
|
|
35
45
|
{
|
36
46
|
|
37
|
-
public float x
|
47
|
+
public float x;
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
public static void test ( float a, float b )
|
52
|
+
|
53
|
+
{
|
54
|
+
|
55
|
+
Test t = new Test();
|
56
|
+
|
57
|
+
t.x = a + b;
|
58
|
+
|
59
|
+
}
|
38
60
|
|
39
61
|
}
|
40
62
|
|
@@ -44,15 +66,23 @@
|
|
44
66
|
|
45
67
|
{
|
46
68
|
|
47
|
-
public static void
|
69
|
+
public static void save( float x)
|
48
70
|
|
49
71
|
{
|
50
72
|
|
51
|
-
|
73
|
+
StreamWriter sw = new System.IO.StreamWriter(
|
52
74
|
|
53
|
-
|
75
|
+
@"C:\data\file",
|
54
76
|
|
77
|
+
true,
|
78
|
+
|
79
|
+
System.Text.Encoding.GetEncoding("shift_jis")
|
80
|
+
|
55
|
-
|
81
|
+
);
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
sw.WriteLine(String.Format("C {0}", x);
|
56
86
|
|
57
87
|
}
|
58
88
|
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,25 +36,7 @@
|
|
36
36
|
|
37
37
|
public float x = 30;
|
38
38
|
|
39
|
-
・
|
40
|
-
|
41
|
-
・
|
42
|
-
|
43
|
-
・
|
44
|
-
|
45
|
-
public static void sample1
|
46
|
-
|
47
|
-
{
|
48
|
-
|
49
|
-
・
|
50
|
-
|
51
|
-
・
|
52
|
-
|
53
|
-
・
|
54
|
-
|
55
|
-
|
39
|
+
}
|
56
|
-
|
57
|
-
}
|
58
40
|
|
59
41
|
|
60
42
|
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
-
p
|
21
|
+
public void save_bt_Click(object sender, EventArgs e)
|
22
22
|
|
23
23
|
{
|
24
24
|
|