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

質問編集履歴

2

2019/12/05 02:15

投稿

teruchan
teruchan

スコア5

title CHANGED
File without changes
body CHANGED
@@ -5,14 +5,9 @@
5
5
  ③判別した
6
6
  文字列の数が10個以上あればエラーメッセージを出力
7
7
  ```ここに言語を入力```ここに言語を入力```ここに言語を入力```ここに言語を入力
8
+
8
9
  コード
9
10
  ```
10
- コード
11
- ```
12
- コード
13
- ```
14
- コード
15
- ```
16
11
  例)以下のように入力した文字列が10個以上指定されている場合
17
12
  1,2,3,4,5,6,7,8,9,10,11
18
13
 

1

2019/12/05 02:15

投稿

teruchan
teruchan

スコア5

title CHANGED
File without changes
body CHANGED
@@ -4,7 +4,15 @@
4
4
 
5
5
  ③判別した
6
6
  文字列の数が10個以上あればエラーメッセージを出力
7
-
7
+ ```ここに言語を入力```ここに言語を入力```ここに言語を入力```ここに言語を入力
8
+ コード
9
+ ```
10
+ コード
11
+ ```
12
+ コード
13
+ ```
14
+ コード
15
+ ```
8
16
  例)以下のように入力した文字列が10個以上指定されている場合
9
17
  1,2,3,4,5,6,7,8,9,10,11
10
18
 
@@ -25,7 +33,42 @@
25
33
 
26
34
  ### 該当のソースコード
27
35
 
36
+ ;-------------------------------------
37
+ ; 指定番号入力
38
+ ;-------------------------------------
39
+ num_select:
40
+ l_imput = 'P_no,P_no,P_no, …とカンマ区切りで入力すること'#13'MAX 10個までサポート'
41
+ call sub_input
42
+ strsplit inputstr ','
43
+ if result > 10 then
44
+ messagebox '10個までしかサポートされていません。' '選択数エラー'
45
+ goto num_select
46
+ endif
47
+ P_no = inputstr
28
48
 
49
+ ;-------------------------------------
50
+ ; 入力確認処理
51
+ ;-------------------------------------
52
+ :sub_input
53
+ result = 0
54
+ while result = 0
55
+ sprintf2 l_msg '【%sの入力】' l_imput
56
+ inputbox l_msg D_TOOLVERSION
57
+ if chkflg = 1 then
58
+ strcompare inputstr ''
59
+ if result = 0 then
60
+ sprintf2 l_msg '【%s】入力文字列に誤りがあります。' inputstr
61
+ messagebox l_msg '入力エラー'
62
+ result = -1
63
+ break
64
+ endif
65
+ sprintf2 l_msg '%sの確認【 %s 】' l_imput inputstr
66
+ yesnobox l_msg '入力値チェック'
67
+ endif
68
+ endwhile
69
+ if result = -1 goto sub_input
70
+ return
71
+
29
72
  ### 試したこと
30
73
 
31
74