1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
-
-
|
-
|
!
!
-
-
|
|
-
|
!
!
-
-
|
-
|
!
!
-
|
|
|
|
|
|
|
|
|
-
|
!
|
#module
#deffunc ListSet array _strlist, array _intItemid, int _lmaxnum
sdim strlist, 128, 256 dim intItemid, 256
lmaxnum = _lmaxnum lsctnum = 0 if lmaxnum <= 0 : lsctnum = -1
i = lmaxnum
if lmaxnum<0 : i = length(_strlist)
repeat i
strlist.cnt = _strlist.cnt
intItemid.cnt = _intItemid.cnt
loop
return
#defcfunc ListSelect int p1
if (lsctnum>=0)&(lsctnum<lmaxnum) : lsctnum+=p1
if (lmaxnum>0)&(lsctnum<0) : lsctnum = 0
if lsctnum >= lmaxnum : lsctnum = lmaxnum-1
return lsctnum
#defcfunc ListGet int p1, int p2
if p1=0 : return lmaxnum if p1=1 : return lsctnum if p1=2 {
if (lsctnum>=0)&(lsctnum<lmaxnum) {
return intItemid.lsctnum } else {
return 0
}
}
if p1=3 {
if (p2>=0)&(p2<lmaxnum) {
k = ""+strlist.p2
return k } else {
return ""
}
}
if p1=4 {
if (p2>=0)&(p2<lmaxnum) {
return intItemid.p2 } else {
return 0
}
}
return 0
#deffunc ListAddItem str strls, int intls, int _innum
innum = _innum
if innum<0 : return 1
if innum>lmaxnum : innum = lmaxnum strlist1 = strlist.innum
intItemid1 = intItemid.innum
repeat lmaxnum-innum, innum+1
strlist0 = strlist1
strlist1 = strlist.cnt
strlist.cnt = strlist0
intItemid0 = intItemid1
intItemid1 = intItemid.cnt
intItemid.cnt = intItemid0
loop
strlist.innum = strls
intItemid.innum = intls
lmaxnum++
if lsctnum >= innum : lsctnum++
if lsctnum = -1 : lsctnum = 0
return
#deffunc ListDelItem int p1
if (p1>=lmaxnum)|(p1<0): return 1
if lmaxnum>0 {
repeat lmaxnum-p1, p1
i = cnt +1
strlist.cnt = strlist.i
intItemid.cnt = intItemid.i
loop
lmaxnum--
strlist.lmaxnum = ""
intItemid.lmaxnum = 0
if lsctnum >= lmaxnum : lsctnum = lmaxnum-1
} else {
return 1
}
return 0
#global
button "追加", *tuika
button "削除", *kesu
bangou = 2
input bangou
sdim li,64,10
li = "0:しりとり","1:りんご","2:ごりら","3:らっぱ","4:パンダ","5:ダチョウ","6:うなぎ","7:ぎんやんま","8:マッスルタッグマッチ","9:稚鮎"
liid = 100,11,22,33,44,55,66,77,88,99
lsctnum = 0 ListSet li, liid, length( li )
tuikanum = length( li )
*main
redraw 1 : await 33 : redraw 0 : color 255,255,255 : boxf : color
pos 100,30
stick key
if key&2 : lsctnum = ListSelect(-1)
if key&8 : lsctnum = ListSelect(1)
mes "個数:"+ListGet(0)
mes "選択:"+ListGet(1)
repeat ListGet(0)
mes "[ID_"+ListGet(4, cnt)+"] "+ListGet(3, cnt)
loop
pos 100, 0
if ListGet(1)>=0 : mes "選択("+ ListGet(1) +"):[ID_"+ListGet(2)+"] "+ListGet(3,ListGet(1))
goto *main
*tuika
ListAddItem ""+tuikanum+":追加", tuikanum*10, bangou
tuikanum++
goto *main
*kesu
ListDelItem bangou
goto *main
|