teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

hanteiの修正

2016/11/17 08:29

投稿

mdj
mdj

スコア220

answer CHANGED
@@ -1,5 +1,3 @@
1
- AとA'の差異がどのくらいあるかのような気がします。
2
- 現状ではAとA'の違いがどのくらいあるかわかりませんので、処理部分をまとめるくらいでしょうか。
3
1
  ```ここに言語を入力
4
2
  sub main()
5
3
  dim type as string = hantei(勤務データ.役職)
@@ -7,17 +5,21 @@
7
5
  end sub
8
6
 
9
7
  function hantei(Position as string)
10
- select case position
8
+ dim rtn as string
11
- case "上級職"
12
- if A then return "残業"
13
- if B then return "有給"
14
- if C then return "出張"
15
- case "一般職"
16
- if A' then return "残業"
9
+ if A(position) then rtn = "残業"
17
- if B' then return "有給"
10
+ if B(position) then rtn = "有給"
18
- if C' then return "出張"
11
+ if C(position) then rtn = "出張"
12
+ return rtn
19
13
  end function
20
14
 
15
+ function A(position as string) as boolean
16
+ select case position
17
+ case "上級職":上級職・残業判定
18
+ case "一般職":一般職・残業判定
19
+ end select
20
+ return bln
21
+ end function
22
+
21
23
  sub syori(type as string)
22
24
  select case type
23
25
  case "残業": 残業の処理
@@ -27,13 +29,6 @@
27
29
  end sub
28
30
  ```
29
31
 
30
- まとめられるなら
31
- ```ここに言語を入力
32
- function hantei(Position as string)
33
- if A(position) then return "残業"
34
- if B(position) then return "有給"
35
- if C(position) then return "出張"
36
- end function
37
- ```
38
32
  のようにするとメンテナンスも楽かなと思います。
39
- 宜しくお願い致します。
33
+ 宜しくお願い致します。
34
+ (一部修正しました。)