簡易エディタ 更新しました
#include "hspda.as" #define WM_COMMAND 0x0111 onexit goto *prog_exit // WM_COMMAND を捕まえる oncmd gosub *lbl_WM_COMMAND, WM_COMMAND objsize 640,480 sdim _4note,65000 notesel _4note _4note="#define _001script v001=0:\n#define _002label v002=0:\na\nb\nc" stat4listbox=0 listbox stat4listbox,100,_4note ID4listbox=stat gosub *show_sub_B_window gsel 2,-1 gosub *show_sub_A_window gsel 1,-1 gosub *show_cmd_window stop *show_cmd_window screen 10,300,300 button "vsave",*do_vsave button "vload",*do_vload stat4input_FN="" input stat4input_FN,300,40 ID4input_FN=stat button "notesave",*do_notesave button "noteload",*do_noteload stop *do_notesave notesave stat4input_FN stop *do_noteload noteload stat4input_FN gsel 0 objprm ID4listbox,_4note stop *do_vsave vsave "v_tmp.dat" stop *do_vload vload "v_tmp.dat" gsel 0 objprm ID4listbox,_4note stop *show_sub_A_window screen 1,300,300 stat4input_A="" input stat4input_A,300,40 button "編集",*tmp_edit button "script",*tmp_l button "label",*tmp_ll return *show_sub_B_window screen 2,300,80 stat4input="" input stat4input,300,40 objsize 100,20 pos 0,40 button "上書き",*set_lb_str pos 100,40 button "挿入",*insert_lb_str pos 100,60 button "末尾挿入",*insert_last_lb_str pos 0,60 button "キャンセル",*lb_cansel return *tmp_edit stop *tmp_l gsel 1,-1 gsel 2,2 title "編集:script" stop *tmp_ll gsel 1,-1 gsel 2,2 title "編集:label" stop *lbl_WM_COMMAND if ( ( ( wparam >> 16 ) & 0xFFFF ) == 0x0002 ) { ; dialog "リストの " + stat4listbox + " 番目の要素が選択されました。",0 gsel 2 tmp="" if stat4listbox!=-1{ noteget tmp,stat4listbox objprm 0,tmp gsel 1,2 } } return *lb_cansel gsel 2,-1 stop *set_lb_str noteadd stat4input,stat4listbox,1 gsel 0 objprm ID4listbox,_4note gsel 2,-1 stop *insert_lb_str noteadd stat4input,stat4listbox,0 gsel 0 objprm ID4listbox,_4note gsel 2,-1 stop *insert_last_lb_str noteadd stat4input,-1,0 gsel 0 objprm ID4listbox,_4note gsel 2,-1 stop *prog_exit dialog "プログラムを終了しますか?",2 if stat==6:end