Ys TOOLs A

cmd一覧standard ver 0.1.0

・始めに
このTOOLは一覧からHSP標準命令を検索するTOOLです
(ごめんなさいデータ古いです)

・特徴
このTOOLはlistboxから標準命令を選択し
その後、button一つでコピペできます
また、PATHを選択することでクリップボードの中身を引数に
HDLを起動できます

・使い方

・・左側のbutton

そのbuttonを押すと
一覧にbuttonの文字から始まる命令を表示します

・inputbox 内容 
現在、選択中の命令を表示します

・inputbox クリップボード
現在のクリップボードの中身を表示します

・button コピー
内容 inputboxの中身をコピーします

・listbox
現在の範囲の命令を一覧表示します
ここのlistboxの項目を選択すると
その選択項目が、内容 inputboxに表示されます

・PATH指定 button
このbuttonを押すとFILE選択dialogを開きます
HDLのPATHを選択しましょう

また、FILE選択dialogっでFILEを選択すると自動的にFILE名が保存されます
そしてそのFILE名はTOOL起動時に読み込まれます

・HDL button
FILE選択dialogで選択したFILEを実行します
引数付きで呼び出すので、引数に対応していないFILEだと上手くいきません
HDLのPATHを設定した後でこのbuttonを押してHDLを起動することを想定しています

作成:高畑ラボ(Y_repeat)

・連絡先
バグなどありましたらご報告ください
また改造後再配布時配布URLを教えていただけると嬉しいです
y.tack2010@gmail.com

  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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
#include "hspda.as"
#include "hspext.as"
 
#define global push_on_button_set_A %tbt_set_unil_A %i0
#define global get_on_button_set_A %tbt_set_unil_A *%p
#define global pop_on_button_set_A %tbt_set_unil_A *%o
#define global push_on_button_set_B %tbt_set_unil_B %i0
#define global get_on_button_set_B %tbt_set_unil_B *%p
#define global pop_on_button_set_B %tbt_set_unil_B *%o
 
//    特殊マクロについて 詳しくは、HSP Document Libraryの#defineのページにて
 
//    buttonを押すと変数に値を代入してからjumpするマクロ
//    %1:buttonに表示する文字列
//    %2:buttonを押すと代入する対象
//    %3:代入する値
//    %4:buttonを押すと代入をしてからjumpするラベル
 
#define global ctype button_set(%1,%2,%3,%4):push_on_button_set_A:push_on_button_set_B:\
button %1,get_on_button_set_A:goto get_on_button_set_B:pop_on_button_set_A:%2=%3:goto %4:pop_on_button_set_B
 
pos 100,0
 
//    ノートパッド用。cmd一覧のtxtを取得するのに使う
sdim s,65000
 
notesel s
noteload "cmd_standard.txt"
//    同じ文字から始まる命令名を\nで区切って一要素にする
//    それを格納する文字列配列
sdim sort_cmd,1000,500
//    命令名格納用配列
//    選択するとここから取り出す
sdim t,256,1000
//    命令名は\nで区切っているので\nで分割
split s,"\n",t
//    命令が入っているtxtの行数繰り返し
repeat notemax
    tmp=""
//    ノートパッドより一行取得
    noteget tmp,cnt
//    その一行の先頭の文字を取得
    c=peek(tmp,0)
//    配列の文字の値番目に加算
    sort_cmd.c+=tmp+"\n"
loop
ss=""
u=""
flag=0
pos 100,0
mes "内容"
mes "クリップボード"
pos 200,0
//    選択中の命令を表示するinputbox
input ss, 300,20
//    クリップボードの中身を表示するinputbox
input u,300,20
pos 100,40
//    このbuttonを押すと選択中の命令をコピペ
button "コピー",*sel
objsize 400,400
//    命令一覧表示用listbox
listbox flag,0,s
objsize 64,20
pos 500,0
//    このbuttonを押すとHDL起動
button "HDL",*use_my_HDL
//    このbuttonを押すとdialogでHDLのPATHを選択
button "PATH指定",*set_HDL_path
objsize 30,30
//    これらのbuttonを押すとその文字から始まる命令をlistboxに表示
pos 0,0
button_set("#",sel_char,'#',*do_sel)
button_set("_",sel_char,'_',*do_sel)
 
button_set("a",sel_char,'a',*do_sel)
button_set("b",sel_char,'b',*do_sel)
button_set("c",sel_char,'c',*do_sel)
button_set("d",sel_char,'d',*do_sel)
button_set("e",sel_char,'e',*do_sel)
button_set("f",sel_char,'f',*do_sel)
button_set("g",sel_char,'g',*do_sel)
 
pos 30,0
button_set("h",sel_char,'h',*do_sel)
button_set("i",sel_char,'i',*do_sel)
button_set("j",sel_char,'j',*do_sel)
button_set("k",sel_char,'k',*do_sel)
button_set("l",sel_char,'l',*do_sel)
button_set("m",sel_char,'m',*do_sel)
button_set("n",sel_char,'n',*do_sel)
 
button_set("o",sel_char,'o',*do_sel)
button_set("p",sel_char,'p',*do_sel)
 
pos 60,0
button_set("q",sel_char,'q',*do_sel)
button_set("r",sel_char,'r',*do_sel)
button_set("s",sel_char,'s',*do_sel)
button_set("t",sel_char,'t',*do_sel)
button_set("u",sel_char,'u',*do_sel)
 
 
button_set("v",sel_char,'v',*do_sel)
button_set("w",sel_char,'w',*do_sel)
button_set("x",sel_char,'x',*do_sel)
button_set("y",sel_char,'y',*do_sel)
//    txt(最初は空)よりPATHを読み込む
gosub *set_HDL_PATH_begin
//    listboxの選択項目とクリップボードの中身を調べるループへ
goto *sel_loop
 
//    txt(最初は空)よりPATHを読み込む
*set_HDL_PATH_begin
//    HDLのPATH格納用変数
    HDL_PATH=""
//    ノートパッド用変数
    for_note=""
//    ノートパッド指定
    notesel for_note
//    FILE読み込み
    noteload "HDL_PATH.txt"
//    FILEの一行目読み込み
    noteget HDL_PATH,0
//    ノートパッド指定解除
    noteunsel
    return
 
//    HDL起動
*use_my_HDL
    tmp_cb=""
//    クリップボードより文字列取得
    clipget tmp_cb
//    PATHのFILEは存在するか?
    exist HDL_PATH
//    存在すれば
    if strsize!=-1{
//    クリップボードの中身を引数に起動
        exec ""+HDL_PATH+" "+tmp_cb
    }else{
//    PATHのFILEが存在しないのでerrorメッセージ
        dialog {"HDLのPATHが設定されていないか、正しくありません。
		PATH設定buttonを押してHDLのPATHを指定してください"}
    }
//    listboxの選択項目とクリップボードの中身を調べるループへ
    goto *sel_loop
/**use_hdl
    tmp_cb=""
    clipget tmp_cb
    exec "C:\\Program Files (x86)\\hsp32\\hsphelp\\helpman"+" "+tmp_cb
    goto *sel_loop*/
    
//    HDLのPATHを設定するサブルーチン
*set_HDL_PATH
//    ノートパッド用
    for_note=""
//    ノートパッド指定
    notesel for_note
//    FILE選択dialog
    dialog "exe",16,"HDLのPATH"
//    FILE選択が成功なら
    if stat==1{
        for_note=refstr
//    FILEの名前を保存
        notesave "HDL_PATH.txt"
//    FILEの名前を代入
        noteget HDL_PATH,0        
    }
//    ノートパッド指定解除
    noteunsel
//    listboxの選択項目とクリップボードの中身を調べるループへ
    goto *sel_loop
    
//    listboxの選択項目とクリップボードの中身を調べるループ
*sel_loop
//    flagにはlistboxの選択項目が入っている
    tmp=flag
//    ループ開始
*hoge
//    listboxの選択が-1でない
//    更にflagとtmpが等しくない場合(listboxの選択項目が変わっている)
    if flag!=tmp&flag!=-1{
//    tは命令名格納用配列
//    選択するとここから取り出す
//    そのflag番目を取り出すことはlistboxで選択中の項目を取得すること
        ss=t.flag
//    選択中の命令を表示するinputbox更新
        objprm 0,ss
        tmp=flag
    }
//    クリップボードの中身代入用
    cb_hoge=""
    clipget cb_hoge
//    uはクリップボードの中身を表示するinputbox用文字列
    if u!=cb_hoge{
        u=cb_hoge
//    クリップボードの中身を表示するinputbox更新
        objprm 1,cb_hoge
    }
//    少々待つ
    await 50
//    gotoによるループ
    goto *hoge
    
//    命令名の先頭の文字のbuttonを押した
*do_sel
//    選択一文字を数値表現で取得
    n=peek(sel_char,0)
//    sort_cmdの数値番目を取得すると
//    その文字から始まる\nで区切った命令一覧を得られる
    sss=sort_cmd.n
//    listbox更新
    objprm 3,sss
//    命令名格納用配列
//    選択するとここから取り出す
    sdim t,500,500
//    命令名は\nで区切っているので\nで分割
    split sss,"\n",t
    flag=0
//    listboxの選択項目とクリップボードの中身を調べるループへ
    goto *sel_loop
    
//    選択中の命令をコピペ
*sel
//    listboxが非選択なら選択を0に
    if flag<0:flag=0
//    tは命令名格納用配列
//    選択するとここから取り出す
//    そのflag番目を取り出すことはlistboxで選択中の項目を取得すること
    ss=t.flag
//    クリップボードの中身を表示するinputbox更新
    objprm 1,ss
//    クリップボード更新
    clipset ss
//    listboxの選択項目とクリップボードの中身を調べるループへ
    goto *sel_loop

添付ファイル: fileYs_A08 cmd_list_standard wiki.zip 16件 [詳細]