AX
電霊 BBS

このBBSは 電子の言霊 に関する 意見、質問、感想、ソフトの不具合報告
などを書き込む場所です。なんでも思った事を書き込んで行ってください。雑談なんかも歓迎です!

投稿の際 ふさわしいトピックが無い場合は
新規投稿から書き込みをしてください。新しくトピックが作られます。

自分も相手も嫌な気持ちにならないよう心がけましょう。



1件 〜 4 件(全 82 件表示)
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | >
No.502 必殺!チラウラスレver0.3 Date: 2015/05/29(金) 07:21
Name :y.tack  7SM67tY6bA  HOME [このトピックに書き込む]
y.tackがチラウラとして
どうでもいいことを(本人にとっては大事)
延々と垂れ流すスレです
現在は簡易プログラム言語作成と簡易エディタ作成がテーマです

TrackBackスレ ver 0.1
http://dentama.1616bbs.com/bbs/dentama_topic_pr_148.html

必殺!チラウラスレver0.2
http://dentama.1616bbs.com/bbs/dentama_topic_pr_406.html

投稿NOが500越えたのをきっかけに立ててみました

No.619 RE:必殺!チラウラスレver0.3 Date: 2016/01/19(火) 21:24
Name :Y_repeat  7SM67tY6bA  HOME
ちょいマクロをサブルーチンへ
ってか更新履歴もメモもないから何やってるかわかりませんでしたw
しかし差分アプリ使ったらマクロがサブルーチンになってて
何気に便利ですね

年も明けましたことですし
ここらでこのスレッドの更新を終わりとして
新スレ建てようと思います

no_6x_subr_var_label_manage.hsp:変わらず
no_6x_subr_command.hsp:変わらずw
main:更新


#include "no_6x_subr_var_label_manage.hsp"
#include "no_6x_subr_command.hsp"
#module num_rgst
#deffunc num_rgst_init
dim ar_rgst_num,256,2
return
#deffunc num_rgst_num int p_index,int p_num,int p_line
ar_rgst_num.p_index.0=p_num
ar_rgst_num.p_index.1=p_line
return
#deffunc num_rgst_dump
repeat 16
logmes "num "+cnt+":"+ar_rgst_num.cnt.0
logmes "line "+cnt+":"+ar_rgst_num.cnt.1
loop
return
#defcfunc search_rgst_num int p_line
for i,0,256,1
if ar_rgst_num.i.1==p_line{
; dialog p_line,0
return ar_rgst_num.i.0
}
next
return -1
#global
num_rgst_init

;dim pc_stack,5000
;n_pc_stack=0
hoge_pc=1
// line search のみ有効
flag_on_do=0
flag_on_line_search=1
flag_on_label_search=0

#define ctype l_avoid(%1) goto *l_a_%1
#define ctype catch_l_avoid(%1)*l_a_%1
#define ctype l_def(%1)*l_def_%1
#define ctype l_def_go(%1) *l_def_%1
#define switch_set_B my_pc_B
#define eq_B(%1) case %1:my_pc_B++:
#define eq_B_one(%1,%2) case %1:my_pc_B++:cp1=%2:goto *sw_begin
#define eq_B_two(%1,%2,%3):\
case %1:my_pc_B++:cp1=%2:goto *sw_begin:case %1+1:my_pc_B++:cp2=%3:goto *sw_begin:
#define eq_B_three(%1,%2,%3,%4):\
case %1:my_pc_B++:cp1=%2:goto *sw_begin:case %1+1:my_pc_B++:cp2=%3:goto *sw_begin:\
case %1+2:my_pc_B++:cp3=%4:goto *sw_begin:
#define cmd_fin :my_pc_B=1:cmd_pc++:goto *com_sw: goto *sw_begin
;#define ctype do_eq_one(%1,%2)if my_pc_B==%1:my_pc_B++:cr_com=%2:cmd_fin
;#define ctype do_eq_one(%1,%2)case %1:my_pc_B++:cr_com=%2:cmd_fin
;#define ctype do_eq_one(%1,%2)case %1:my_pc_B++:cr_com=en_cls0:cmd_fin
;#define ctype do_eq_two(%1,%2,%3):\
;if my_pc_B==%1{my_pc_B++:cr_com=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp1=%3:cmd_fin}
; case %1:my_pc_B++:cr_com=%2:goto *sw_begin:case %1+1:my_pc_B++:cp1=%3:cmd_fin:goto *sw_begin
#define ctype do_eq_three(%1,%2,%3,%4):\
if my_pc_B==%1{my_pc_B++:cr_com=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp1=%3:goto *sw_begin}:\
if my_pc_B==(%1+2){ my_pc_B++:cp2=%4:cmd_fin}
; case %1:my_pc_B++:cr_com=%2:goto *sw_begin:case %1+1:my_pc_B++:cp1=%3:goto *sw_begin:\
; case %1+2:my_pc_B++:cp2=%4:cmd_fin:goto *sw_begin
; case %1:my_pc_B++:cr_com=en_cls0:cmd_fin
#define ctype do_eq_three_lread(%1,%2,%3,%4):\
if my_pc_B==%1{my_pc_B++:cr_com=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp1=%3:goto *sw_begin}:\
if my_pc_B==(%1+2){ my_pc_B++:cp2=%4:goto *com_sw:goto *sw_begin}
; #define ctype do_eq_three_ldef(%1,%2,%3,%4):\
; case %1:my_pc_B++:cr_com=%2:goto *sw_begin:case %1+1:my_pc_B++:cp1=%3:goto *sw_begin:\
; case %1+2:my_pc_B++:cp2=%4:goto *com_sw:goto *sw_begin
#define ctype do_eq_ldef_three(%1,%2,%3,%4):\
if my_pc_B==%1{my_pc_B++:cp1=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp2=%3:goto *sw_begin}:\
if my_pc_B==(%1+2){ my_pc_B++:cp3=%4}if my_pc_B==(%1+3){ my_pc_B++: x_label_search_init@label_manage cp1,cp2,cp3:goto *sw_begin}
#define ctype do_eq_ldef_four(%1,%2,%3,%4):\
if my_pc_B==%1{my_pc_B++:cp1=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp2=%3:goto *sw_begin}:\
if my_pc_B==(%1+2){ my_pc_B++:cp3=%4}if my_pc_B==(%1+3){ my_pc_B++: x_label_search_init@label_manage cp1,cp2,cp3:goto *sw_begin}:\
if my_pc_B==(%1+4){my_pc_B=1:label_pc++:goto *sw_begin}
#define ctype do_eq_vardef_four(%1,%2,%3,%4):\
if my_pc_B==%1{my_pc_B++:cp1=%2:goto *sw_begin}:\
if my_pc_B==%1+1{my_pc_B++:cp2=%3:goto *sw_begin}:\
if my_pc_B==%1+2{my_pc_B++:cp3=%4:goto *sw_begin}:\
if my_pc_B==%1+3{my_pc_B++:x_var_search_init@variable_manage cp1,cp2,cp3:goto *sw_begin}

#define cmd_true_p if cmd_pc==search_rgst_num(my_line)
#define label_true_p if label_pc==search_rgst_num(my_line)
goto *subr_avoid
; #define ctype do_eq_two(%1,%2,%3):\
; if my_pc_B==%1{my_pc_B++:cr_com=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp1=%3:cmd_fin}
; do_eq_one(1,en_cls0)
; #define cmd_fin :my_pc_B=1:cmd_pc++:goto *com_sw: goto *sw_begin
; do_eq_two(1,en_mes,"ボタンを押してください")
#deffunc subr_do_eq_1 int p1,int p2
if my_pc_B==p1{
my_pc_B=1:cr_com=p2:cmd_pc++:
global_label=*com_sw: is_jump_p=1:return }
#deffunc subr_do_eq_2_p3s int p1,int p2,str p3_s
if my_pc_B==p1{
my_pc_B++:cr_com=p2:
global_label=*sw_begin: is_jump_p=1:return }
if my_pc_B==p1+1{
my_pc_B=1:cp1=p3_s
cmd_pc++:
global_label=*com_sw: is_jump_p=1:return }
is_jump_p=0:return
#deffunc subr_do_eq_2_p3var int p1,int p2,var p3_var
if my_pc_B==p1{
my_pc_B++:cr_com=p2:
global_label=*sw_begin: is_jump_p=1:return }
if my_pc_B==p1+1{
my_pc_B=1:cp1=p3_var
cmd_pc++:
global_label=*com_sw: is_jump_p=1:return }
is_jump_p=0:return
#deffunc subr_do_eq_ldef4 int p1,str p2_s,int p3,int p4
if my_pc_B==p1{
my_pc_B++:cp1=p2_s
global_label=*sw_begin: is_jump_p=1:return }
if my_pc_B==p1+1{
my_pc_B++:cp2=p3:
global_label=*sw_begin: is_jump_p=1:return }
if my_pc_B==p1+2{
my_pc_B++:cp3=p4
global_label=*sw_begin: is_jump_p=1:return }
if my_pc_B==p1+3{
my_pc_B++: x_label_search_init@label_manage cp1,cp2,cp3
global_label=*sw_begin: is_jump_p=1:return }
if my_pc_B==p1+4{
my_pc_B=1:label_pc++
global_label=*sw_begin: is_jump_p=1:return }
is_jump_p=0:return
#deffunc do_eq_button_A_two_add1 int p1,str p_s
if my_pc_B==p1{
my_pc_B++:cr_com=en_button_A:goto *sw_begin}
if my_pc_B==(p1+1){
my_pc_B++:cp1=p_s:goto *sw_begin}
if my_pc_B==(p1+2){
my_pc_B++:bt_pc_1=subr_label:cmd_fin}
return
#deffunc do_eq_button_B_two_add1 int p1,str p_s
if my_pc_B==p1{
my_pc_B++:cr_com=en_button_B:goto *sw_begin}
if my_pc_B==(p1+1){
my_pc_B++:cp1=p_s:goto *sw_begin}
if my_pc_B==(p1+2){
my_pc_B++:bt_pc_2=subr_label:cmd_fin}
return
*subr_avoid

;goto *l_def_A
;goto l_def(A)
;l_def(E):
;*l_def_B
;x_label_init@mod_label 1,"a",1 ;0
;x_label_init@mod_label 0,"aa1",11 ;1
;x_label_init@mod_label 0,"ab1",13 ;2
;x_label_init@mod_label 0,"ax1a",15 ;3
dim one_code,256
x=0
f_stop=0
// ボタンによって選択される選択肢のID
selected_btnext="a"


my_pc=1
my_pc_B=1
flag_on_l_search=1
goto *@f
*search_l_end
flag_on_l_search=0
goto *sw_begin
*@
flag_on_line_search=1
if 0{
*count_b
flag_on_line_search=0
flag_on_label_search=1
flag_on_do=0
label_pc=1
}
if 0{
*count_c
flag_on_line_search=0
flag_on_label_search=0
flag_on_do=1
cmd_pc=1
}
goto *sbr_end
*sbr_l_search
if flag_on_line_search==1{
num_rgst_num hoge_pc,hoge_pc-1,my_line:hoge_pc++
}
return
*sbr_no_jump_lab_search
if flag_on_label_search==1{
label_true_p{
if my_pc_B==1{;logmes "途中C":
my_pc_B=1:label_pc++:
global_label=*sw_begin
is_jump_p=1
return
}// label
}
}
return
*sbr_no_jump_do
if flag_on_do==1{
; logmes "途中D"
; logmes ""+num_stack.my_line
; logmes "pc"+cmd_pc
cmd_true_p{
; logmes "途中inE1"
my_pc_B=1:cmd_pc++:
global_label=*sw_begin
is_jump_p=1
return
}
}
return
;*flag_clear
; on_flag_on_line_search=0
; on_flag_on_label_search=0
; on_flag_on_do==0
; return

*sbr_end

global_label=*sw_begin
is_jump_p=0

*sw_begin
await 1
; logmes "BEGIN"

// case 0: def label
my_line=int(__LINE__)
; on_flag_on_line_search=1
; on_flag_on_label_search=1
; on_flag_on_do=1

gosub *sbr_l_search
; gosub *sbr_do

; gosub *sbr_no_jump_lab_search
; if is_jump_p==1{
; is_jump_p=0:goto global_label
; }
; gosub *sbr_do
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
label_true_p{ logmes "途中A"
subr_do_eq_ldef4 1,"0",1,label_pc
if is_jump_p==1:is_jump_p=0:goto global_label
; do_eq_ldef_four(1,"0",1,label_pc)
}
}

// case 1: def label
my_line=int(__LINE__)
; on_flag_on_line_search=1
; on_flag_on_label_search=1
; on_flag_on_do=1

gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
label_true_p{ logmes "途中A"
subr_do_eq_ldef4 1,"a",1,label_pc
if is_jump_p==1:is_jump_p=0:goto global_label
; do_eq_ldef_four(1,"a",1,label_pc)
}
}
; gosub *flag_clear

// case 2: cls 0
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
logmes "途中inE2"
subr_do_eq_1 1,en_cls0
if is_jump_p==1:is_jump_p=0:goto global_label
; do_eq_one(1,en_cls0)
}
}

// case 3: objsize
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_objsize,120,24)
}
}
// case 4:
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
logmes "inE4"
do_eq_three_lread(1,en_get_my_label,"aa1",11)
}
}
// button
if flag_on_do==1{
cmd_true_p{
logmes "inE5"
subr_label=my_label
do_eq_button_A_two_add1 4,"X足す1"
; switch my_pc_B
; eq_B 4:cp1="X足す1":goto *sw_begin
; eq_B 5:bt_pc_1=my_label: goto *sw_begin
; eq_B 6:cr_com=en_button_A:cmd_fin
; swend
}
}

// case 5:
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"ab1",12)
}
}
// button
if flag_on_do==1{
cmd_true_p{
subr_label=my_label
do_eq_button_B_two_add1 4,"X引く1"
; switch my_pc_B
; eq_B 4:cp1="X引く1":goto *sw_begin
; eq_B 5:bt_pc_2=my_label: goto *sw_begin
; eq_B 6:cr_com=en_button_B:cmd_fin
; swend
}
}
// case 6: pos
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_pos,150,0)
}
}
// case 7: mes
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
subr_do_eq_2_p3s 1,en_mes,"ボタンを押してください"
if is_jump_p==1:is_jump_p=0:goto global_label
}
}
// case 8: stop
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
subr_do_eq_1 1,en_stop
if is_jump_p==1:is_jump_p=0:goto global_label
}
}
// case 9:"aa1" def label
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
label_true_p{
do_eq_ldef_three(1,"aa1",11,label_pc)
}
label_true_p{
do_eq_vardef_four(5,"x",10,0)
}
label_true_p{
do_eq_vardef_four(9,"y",20,0)
eq_B 13:my_pc_B=1:label_pc++:goto *sw_begin
}
}
// case 10: calc
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// 変数値取得
if flag_on_do==1{
; v1=get_x_var_value@variable_manage("x",1)
cmd_true_p{
switch my_pc_B
eq_B_two 1,"x",10
eq_B 3:cr_com=en_get_from_var:goto *com_sw: goto *sw_begin
eq_B 4:reg1=cpr
; reg1=get_x_var_value@variable_manage(cp1,cp2):logmes ""+reg1:goto *sw_begin
swend
switch my_pc_B
eq_B_two 5,"y",20
eq_B 7:cr_com=en_get_from_var:goto *com_sw: goto *sw_begin
eq_B 8:reg2=cpr
; eq_B 6:reg2=get_x_var_value@variable_manage(cp1,cp2):goto *sw_begin
swend
; switch my_pc_B
; eq_B 1:reg1=x:goto *sw_begin
; eq_B 2:reg2=y:goto *sw_begin
; swend
}
}
// 演算
if flag_on_do==1{
cmd_true_p{
switch my_pc_B
eq_B 9:reg3=reg1+1:goto *sw_begin
eq_B 10:reg2+=2:goto *sw_begin
eq_B 11:cr_com=en_calc:goto *com_sw: goto *sw_begin
swend
}
}
// 代入
if flag_on_do==1{
; set_x_var_value@variable_manage "x",1,v1
cmd_true_p{
switch my_pc_B
eq_B_three 12,"x",10,reg3
eq_B 15:cr_com=en_set_to_var:goto *com_sw: goto *sw_begin
swend
switch my_pc_B
eq_B_three 16,"y",20,reg2
eq_B 19:cr_com=en_set_to_var:cmd_fin
logmes "通過check B":cmd_fin
swend
}
}
// case 11:
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"ax1a",21)
}
}

// goto
if flag_on_do==1{
cmd_true_p{
subr_do_eq_2_p3var 4,en_goto,my_label
if is_jump_p==1:is_jump_p=0:goto global_label
; if my_pc_B==4{
; my_pc_B++:cr_com=en_goto:
; goto *sw_begin
; }
; if my_pc_B==5{
; my_pc_B=1:cp1=my_label
; cmd_pc++:
; goto *com_sw:
; }
; do_eq_two(4,en_goto,my_label)
}
}
// case 12:"ab1" def label
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
label_true_p{
do_eq_ldef_four(1,"ab1",12,label_pc)
}
}
// case 13: calc
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// 変数値取得
if flag_on_do==1{
; v1=get_x_var_value@variable_manage("x",1)
cmd_true_p{
switch my_pc_B
eq_B_two 1,"x",10
eq_B 3:cr_com=en_get_from_var:goto *com_sw: goto *sw_begin
eq_B 4:reg1=cpr
; reg1=get_x_var_value@variable_manage(cp1,cp2):logmes ""+reg1:goto *sw_begin
swend
switch my_pc_B
eq_B_two 5,"y",20
eq_B 7:cr_com=en_get_from_var:goto *com_sw: goto *sw_begin
eq_B 8:reg2=cpr
; logmes "通過check C"
; eq_B 6:reg2=get_x_var_value@variable_manage(cp1,cp2):goto *sw_begin
swend
; switch my_pc_B
; eq_B 1:reg1=x:goto *sw_begin
; eq_B 2:reg2=y:goto *sw_begin
; swend
}
}
// 演算
if flag_on_do==1{
cmd_true_p{
switch my_pc_B
; logmes "通過check C2"
eq_B 9:reg3=reg1-1:goto *sw_begin
eq_B 10:reg2-=2:goto *sw_begin
eq_B 11:cr_com=en_calc:goto *com_sw: goto *sw_begin
swend
}
}
// 代入
if flag_on_do==1{
; set_x_var_value@variable_manage "x",1,v1
cmd_true_p{
switch my_pc_B
eq_B_three 12,"x",10,reg3
eq_B 15:cr_com=en_set_to_var:goto *com_sw: goto *sw_begin
swend
switch my_pc_B
eq_B_three 16,"y",20,reg2
eq_B 19:cr_com=en_set_to_var:cmd_fin
; logmes "通過check B"
swend
}
}
// case 14
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"ax1a",21)
}
}
// goto
if flag_on_do==1{
cmd_true_p{
subr_do_eq_2_p3var 4,en_goto,my_label
if is_jump_p==1:is_jump_p=0:goto global_label
}
}
// case 15:"ax1a" def label
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label


if flag_on_label_search==1{
label_true_p{
do_eq_ldef_four(1,"ax1a",21,label_pc)
}
}
// case 16 cls 0
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
subr_do_eq_1 1,en_cls0
if is_jump_p==1:is_jump_p=0:goto global_label
}
}
// case 17 objsize
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_objsize,120,24)
}
}
// case 18
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"a",1)
}
}
// button
if flag_on_do==1{
cmd_true_p{
subr_label=my_label
do_eq_button_A_two_add1 4,"NEXT"
}
}
// case 19 pos
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_pos,150,0)
}
}
// case 20 mes
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
switch my_pc_B
eq_B_two 1,"x",10
eq_B 3:reg1=get_x_var_value@variable_manage(cp1,cp2):logmes ""+reg1:goto *sw_begin
swend
switch my_pc_B
eq_B_two 4,"y",20
eq_B 6:reg2=get_x_var_value@variable_manage(cp1,cp2):goto *sw_begin
swend
switch my_pc_B
eq_B 7:cp1="Xの値は"+reg1+"です":goto *sw_begin
eq_B 8:cr_com=en_mes:cmd_fin
swend
}
}
// case 21 jz
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label var
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"l4jz",31)
}
cmd_true_p{
switch my_pc_B
eq_B_two 4,"x",10
eq_B 6:cr_com=en_get_from_var:goto *com_sw
eq_B 7:reg1=cpr:goto *sw_begin
mes ""+reg1:goto *sw_begin
swend
}
}
// jz
; if flag_on_do==1{
; cmd_true_p{
; ;cp1=my_label:cr_com=en_goto:cmd_fin
; eq_B 8:cp1=reg1:cp2=my_label:cr_com=en_jz:goto *com_sw
; if my_pc_B==9:cr_com=en_nop:cmd_fin
; }
; }
if flag_on_do==1{
cmd_true_p{
switch my_pc_B
eq_B_two 8,reg1,my_label
eq_B 10
cr_com=en_jz:goto *com_sw
swend
}
}
// case 22tmp
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label var
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"l4jnz",30)
}
cmd_true_p{
switch my_pc_B
eq_B_two 4,"x",10
eq_B 6:cr_com=en_get_from_var:goto *com_sw
eq_B 7:reg1=cpr: goto *sw_begin
mes ""+reg1:goto *sw_begin
swend
}
}
// jnz
if flag_on_do==1{
cmd_true_p{
switch my_pc_B
eq_B_two 8,reg1,my_label
eq_B 10
cr_com=en_jnz:goto *com_sw
swend
}
}
// case 23 stop
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
subr_do_eq_1 1,en_stop
if is_jump_p==1:is_jump_p=0:goto global_label
}
}

// case 24:"l4jz" def label
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
label_true_p{
do_eq_ldef_four(1,"l4jz",31,label_pc)
}
}
// case 25 cls 0
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
subr_do_eq_1 1,en_cls0
if is_jump_p==1:is_jump_p=0:goto global_label
}
}
// case 26 objsize
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_objsize,120,24)
}
}
// case 27
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"a",1)
}
}
// button
if flag_on_do==1{
cmd_true_p{
subr_label=my_label
do_eq_button_B_two_add1 4,"NEXT"
}
}
// case 28 pos
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_pos,150,0)
}
}
// case 29 mes
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
subr_do_eq_2_p3s 1,en_mes,"Xの値は0です!!!"
if is_jump_p==1:is_jump_p=0:goto global_label
}
}
// case 30 stop
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
subr_do_eq_1 1,en_stop
if is_jump_p==1:is_jump_p=0:goto global_label
}
}
// case 31:"l4jnz" def label
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
logmes "jnz A"
logmes ""+label_pc
; logmes ""+num_stack.my_line
; num_stack.my_line=30
label_true_p{
do_eq_ldef_four(1,"l4jnz",30,label_pc)
}
}

// case 32 cls 0
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
subr_do_eq_1 1,en_cls0
if is_jump_p==1:is_jump_p=0:goto global_label
}
}
// case 33 objsize
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_objsize,120,24)
}
}
// case 34
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"a",1)
}
}
// button
if flag_on_do==1{
cmd_true_p{
subr_label=my_label
do_eq_button_A_two_add1 4,"NEXT"
}
}
// case 35 pos
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_pos,150,0)
}
}
// case 36 mes
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label


if flag_on_do==1{
cmd_true_p{
switch my_pc_B
eq_B_two 1,"x",10
eq_B 3:cr_com=en_get_from_var:goto *com_sw
eq_B 4:reg1=cpr:goto *sw_begin
swend
subr_do_eq_2_p3s 5,en_mes,"Xの値は"+reg1+"です。。。"
if is_jump_p==1:is_jump_p=0:goto global_label
}
}
// case 37 stop
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
subr_do_eq_1 1,en_stop
if is_jump_p==1:is_jump_p=0:goto global_label
}
}
//if flag_on_label_search==1:mes 6:goto *_2do
;mes 6
; goto *sw_begin
;}
if flag_on_line_search==1{
; logmes "B"
goto *count_b
}
if flag_on_label_search==1{
goto *count_c
}
num_rgst_dump
mes "stop"
stop


*get_my_label
my_label=get_x_label_l_value@mod_label(cp1,cp2)
; my_label=get_x_label_l_value@mod_label("a",0)
goto *sw_begin
*bt_hoge_1
; mes my_pc
; mes bt_pc_1
cmd_pc=bt_pc_1
goto *sw_begin
*bt_hoge_2
cmd_pc=bt_pc_2
goto *sw_begin
*sw_end
stop


No.618 RE:必殺!チラウラスレver0.3 Date: 2016/01/14(木) 18:50
Name :Y_repeat  7SM67tY6bA  HOME
塊ごとにユニークラベルを作って
ラベル配列に入れちゃうサンプルです
ラベル配列と行データと
塊データ(配列のindexですけどw)
を使って管理します

#define push_label %tdef_label *%i
#define pop_label %tdef_label *%o
ldim linels,256
dim that_line,256
flag_on_line_search=1

my_line=int(__LINE__): push_label
if flag_on_line_search==1{
linels.hoge_pc=pop_label
that_line.hoge_pc=my_line
; num_rgst_num hoge_pc,hoge_pc-1,my_line:
hoge_pc++
}

my_line=int(__LINE__): push_label
if flag_on_line_search==1{
linels.hoge_pc=pop_label
that_line.hoge_pc=my_line
; num_rgst_num hoge_pc,hoge_pc-1,my_line:
hoge_pc++
}


No.617 RE:必殺!チラウラスレver0.3 Date: 2016/01/13(水) 23:34
Name :Y_repeat  7SM67tY6bA  HOME
なんかサブルーチンの中でおもいっきりgotoしてたんですがw
グローバル変数にgoto先のラベルを入れて
returnした直後にgotoしております
なんでエラーでないかというと
たぶん割と小規模だからでしょう
no_6x_subr_var_label_manage.hsp:変わらず
no_6x_subr_command.hsp:変わらずw
main:更新

#include "no_6x_subr_var_label_manage.hsp"
#include "no_6x_subr_command.hsp"
#module num_rgst
#deffunc num_rgst_init
dim ar_rgst_num,256,2
return
#deffunc num_rgst_num int p_index,int p_num,int p_line
ar_rgst_num.p_index.0=p_num
ar_rgst_num.p_index.1=p_line
return
#deffunc num_rgst_dump
repeat 16
logmes "num "+cnt+":"+ar_rgst_num.cnt.0
logmes "line "+cnt+":"+ar_rgst_num.cnt.1
loop
return
#defcfunc search_rgst_num int p_line
for i,0,256,1
if ar_rgst_num.i.1==p_line{
; dialog p_line,0
return ar_rgst_num.i.0
}
next
return -1
#global
num_rgst_init

;dim pc_stack,5000
;n_pc_stack=0
hoge_pc=1
// line search のみ有効
flag_on_do=0
flag_on_line_search=1
flag_on_label_search=0

#define ctype l_avoid(%1) goto *l_a_%1
#define ctype catch_l_avoid(%1)*l_a_%1
#define ctype l_def(%1)*l_def_%1
#define ctype l_def_go(%1) *l_def_%1
#define switch_set_B my_pc_B
#define eq_B(%1) case %1:my_pc_B++:
#define eq_B_one(%1,%2) case %1:my_pc_B++:cp1=%2:goto *sw_begin
#define eq_B_two(%1,%2,%3):\
case %1:my_pc_B++:cp1=%2:goto *sw_begin:case %1+1:my_pc_B++:cp2=%3:goto *sw_begin:
#define eq_B_three(%1,%2,%3,%4):\
case %1:my_pc_B++:cp1=%2:goto *sw_begin:case %1+1:my_pc_B++:cp2=%3:goto *sw_begin:\
case %1+2:my_pc_B++:cp3=%4:goto *sw_begin:
#define cmd_fin :my_pc_B=1:cmd_pc++:goto *com_sw: goto *sw_begin
#define ctype do_eq_one(%1,%2)if my_pc_B==%1:my_pc_B++:cr_com=%2:cmd_fin
;#define ctype do_eq_one(%1,%2)case %1:my_pc_B++:cr_com=%2:cmd_fin
;#define ctype do_eq_one(%1,%2)case %1:my_pc_B++:cr_com=en_cls0:cmd_fin
#define ctype do_eq_two(%1,%2,%3):\
if my_pc_B==%1{my_pc_B++:cr_com=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp1=%3:cmd_fin}
; case %1:my_pc_B++:cr_com=%2:goto *sw_begin:case %1+1:my_pc_B++:cp1=%3:cmd_fin:goto *sw_begin
#define ctype do_eq_three(%1,%2,%3,%4):\
if my_pc_B==%1{my_pc_B++:cr_com=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp1=%3:goto *sw_begin}:\
if my_pc_B==(%1+2){ my_pc_B++:cp2=%4:cmd_fin}
; case %1:my_pc_B++:cr_com=%2:goto *sw_begin:case %1+1:my_pc_B++:cp1=%3:goto *sw_begin:\
; case %1+2:my_pc_B++:cp2=%4:cmd_fin:goto *sw_begin
; case %1:my_pc_B++:cr_com=en_cls0:cmd_fin
#define ctype do_eq_three_lread(%1,%2,%3,%4):\
if my_pc_B==%1{my_pc_B++:cr_com=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp1=%3:goto *sw_begin}:\
if my_pc_B==(%1+2){ my_pc_B++:cp2=%4:goto *com_sw:goto *sw_begin}
; #define ctype do_eq_three_ldef(%1,%2,%3,%4):\
; case %1:my_pc_B++:cr_com=%2:goto *sw_begin:case %1+1:my_pc_B++:cp1=%3:goto *sw_begin:\
; case %1+2:my_pc_B++:cp2=%4:goto *com_sw:goto *sw_begin
#define ctype do_eq_ldef_three(%1,%2,%3,%4):\
if my_pc_B==%1{my_pc_B++:cp1=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp2=%3:goto *sw_begin}:\
if my_pc_B==(%1+2){ my_pc_B++:cp3=%4}if my_pc_B==(%1+3){ my_pc_B++: x_label_search_init@label_manage cp1,cp2,cp3:goto *sw_begin}
#define ctype do_eq_ldef_four(%1,%2,%3,%4):\
if my_pc_B==%1{my_pc_B++:cp1=%2:goto *sw_begin}if my_pc_B==(%1+1){ my_pc_B++:cp2=%3:goto *sw_begin}:\
if my_pc_B==(%1+2){ my_pc_B++:cp3=%4}if my_pc_B==(%1+3){ my_pc_B++: x_label_search_init@label_manage cp1,cp2,cp3:goto *sw_begin}:\
if my_pc_B==(%1+4){my_pc_B=1:label_pc++:goto *sw_begin}
#define ctype do_eq_vardef_four(%1,%2,%3,%4):\
if my_pc_B==%1{my_pc_B++:cp1=%2:goto *sw_begin}:\
if my_pc_B==%1+1{my_pc_B++:cp2=%3:goto *sw_begin}:\
if my_pc_B==%1+2{my_pc_B++:cp3=%4:goto *sw_begin}:\
if my_pc_B==%1+3{my_pc_B++:x_var_search_init@variable_manage cp1,cp2,cp3:goto *sw_begin}

#define cmd_true_p if cmd_pc==search_rgst_num(my_line)
#define label_true_p if label_pc==search_rgst_num(my_line)

goto *subr_avoid
#deffunc do_eq_button_A_two_add1 int p1,str p_s
if my_pc_B==p1{
my_pc_B++:cr_com=en_button_A:goto *sw_begin}
if my_pc_B==(p1+1){
my_pc_B++:cp1=p_s:goto *sw_begin}
if my_pc_B==(p1+2){
my_pc_B++:bt_pc_1=subr_label:cmd_fin}
return
#deffunc do_eq_button_B_two_add1 int p1,str p_s
if my_pc_B==p1{
my_pc_B++:cr_com=en_button_B:goto *sw_begin}
if my_pc_B==(p1+1){
my_pc_B++:cp1=p_s:goto *sw_begin}
if my_pc_B==(p1+2){
my_pc_B++:bt_pc_2=subr_label:cmd_fin}
return
*subr_avoid

;goto *l_def_A
;goto l_def(A)
;l_def(E):
;*l_def_B
;x_label_init@mod_label 1,"a",1 ;0
;x_label_init@mod_label 0,"aa1",11 ;1
;x_label_init@mod_label 0,"ab1",13 ;2
;x_label_init@mod_label 0,"ax1a",15 ;3
dim one_code,256
x=0
f_stop=0
// ボタンによって選択される選択肢のID
selected_btnext="a"


my_pc=1
my_pc_B=1
flag_on_l_search=1
goto *@f
*search_l_end
flag_on_l_search=0
goto *sw_begin
*@
flag_on_line_search=1
if 0{
*count_b
flag_on_line_search=0
flag_on_label_search=1
flag_on_do=0
label_pc=1
}
if 0{
*count_c
flag_on_line_search=0
flag_on_label_search=0
flag_on_do=1
cmd_pc=1
}
goto *sbr_end
*sbr_l_search
if flag_on_line_search==1{
num_rgst_num hoge_pc,hoge_pc-1,my_line:hoge_pc++
}
return
*sbr_no_jump_lab_search
if flag_on_label_search==1{
label_true_p{
if my_pc_B==1{;logmes "途中C":
my_pc_B=1:label_pc++:
global_label=*sw_begin
is_jump_p=1
return
}// label
}
}
return
*sbr_no_jump_do
if flag_on_do==1{
; logmes "途中D"
; logmes ""+num_stack.my_line
; logmes "pc"+cmd_pc
cmd_true_p{
; logmes "途中inE1"
my_pc_B=1:cmd_pc++:
global_label=*sw_begin
is_jump_p=1
return
}
}
return
;*flag_clear
; on_flag_on_line_search=0
; on_flag_on_label_search=0
; on_flag_on_do==0
; return

*sbr_end

global_label=*sw_begin
is_jump_p=0

*sw_begin
await 1
; logmes "BEGIN"

// case 0: def label
my_line=int(__LINE__)
; on_flag_on_line_search=1
; on_flag_on_label_search=1
; on_flag_on_do=1

gosub *sbr_l_search
; gosub *sbr_do

; gosub *sbr_no_jump_lab_search
; if is_jump_p==1{
; is_jump_p=0:goto global_label
; }
; gosub *sbr_do
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
label_true_p{ logmes "途中A"
do_eq_ldef_four(1,"0",1,label_pc)
}
}

// case 1: def label
my_line=int(__LINE__)
; on_flag_on_line_search=1
; on_flag_on_label_search=1
; on_flag_on_do=1

gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
label_true_p{ logmes "途中A"
do_eq_ldef_four(1,"a",1,label_pc)
}
}
; gosub *flag_clear

// case 2: cls 0
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
logmes "途中inE2"
do_eq_one(1,en_cls0)
}
}

// case 3: objsize
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_objsize,120,24)
}
}
// case 4:
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
logmes "inE4"
do_eq_three_lread(1,en_get_my_label,"aa1",11)
}
}
// button
if flag_on_do==1{
cmd_true_p{
logmes "inE5"
subr_label=my_label
do_eq_button_A_two_add1 4,"X足す1"
; switch my_pc_B
; eq_B 4:cp1="X足す1":goto *sw_begin
; eq_B 5:bt_pc_1=my_label: goto *sw_begin
; eq_B 6:cr_com=en_button_A:cmd_fin
; swend
}
}

// case 5:
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"ab1",12)
}
}
// button
if flag_on_do==1{
cmd_true_p{
subr_label=my_label
do_eq_button_B_two_add1 4,"X引く1"
; switch my_pc_B
; eq_B 4:cp1="X引く1":goto *sw_begin
; eq_B 5:bt_pc_2=my_label: goto *sw_begin
; eq_B 6:cr_com=en_button_B:cmd_fin
; swend
}
}
// case 6: pos
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_pos,150,0)
}
}
// case 7: mes
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_two(1,en_mes,"ボタンを押してください")
}
}
// case 8: stop
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_one(1,en_stop)
}
}
// case 9:"aa1" def label
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
label_true_p{
do_eq_ldef_three(1,"aa1",11,label_pc)
}
label_true_p{
do_eq_vardef_four(5,"x",10,0)
}
label_true_p{
do_eq_vardef_four(9,"y",20,0)
eq_B 13:my_pc_B=1:label_pc++:goto *sw_begin
}
}
// case 10: calc
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// 変数値取得
if flag_on_do==1{
; v1=get_x_var_value@variable_manage("x",1)
cmd_true_p{
switch my_pc_B
eq_B_two 1,"x",10
eq_B 3:cr_com=en_get_from_var:goto *com_sw: goto *sw_begin
eq_B 4:reg1=cpr
; reg1=get_x_var_value@variable_manage(cp1,cp2):logmes ""+reg1:goto *sw_begin
swend
switch my_pc_B
eq_B_two 5,"y",20
eq_B 7:cr_com=en_get_from_var:goto *com_sw: goto *sw_begin
eq_B 8:reg2=cpr
; eq_B 6:reg2=get_x_var_value@variable_manage(cp1,cp2):goto *sw_begin
swend
; switch my_pc_B
; eq_B 1:reg1=x:goto *sw_begin
; eq_B 2:reg2=y:goto *sw_begin
; swend
}
}
// 演算
if flag_on_do==1{
cmd_true_p{
switch my_pc_B
eq_B 9:reg3=reg1+1:goto *sw_begin
eq_B 10:reg2+=2:goto *sw_begin
eq_B 11:cr_com=en_calc:goto *com_sw: goto *sw_begin
swend
}
}
// 代入
if flag_on_do==1{
; set_x_var_value@variable_manage "x",1,v1
cmd_true_p{
switch my_pc_B
eq_B_three 12,"x",10,reg3
eq_B 15:cr_com=en_set_to_var:goto *com_sw: goto *sw_begin
swend
switch my_pc_B
eq_B_three 16,"y",20,reg2
eq_B 19:cr_com=en_set_to_var:cmd_fin
logmes "通過check B":cmd_fin
swend
}
}
// case 11:
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"ax1a",21)
}
}

// goto
if flag_on_do==1{
cmd_true_p{
do_eq_two(4,en_goto,my_label)
}
}
// case 12:"ab1" def label
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
label_true_p{
do_eq_ldef_four(1,"ab1",12,label_pc)
}
}
// case 13: calc
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// 変数値取得
if flag_on_do==1{
; v1=get_x_var_value@variable_manage("x",1)
cmd_true_p{
switch my_pc_B
eq_B_two 1,"x",10
eq_B 3:cr_com=en_get_from_var:goto *com_sw: goto *sw_begin
eq_B 4:reg1=cpr
; reg1=get_x_var_value@variable_manage(cp1,cp2):logmes ""+reg1:goto *sw_begin
swend
switch my_pc_B
eq_B_two 5,"y",20
eq_B 7:cr_com=en_get_from_var:goto *com_sw: goto *sw_begin
eq_B 8:reg2=cpr
; logmes "通過check C"
; eq_B 6:reg2=get_x_var_value@variable_manage(cp1,cp2):goto *sw_begin
swend
; switch my_pc_B
; eq_B 1:reg1=x:goto *sw_begin
; eq_B 2:reg2=y:goto *sw_begin
; swend
}
}
// 演算
if flag_on_do==1{
cmd_true_p{
switch my_pc_B
; logmes "通過check C2"
eq_B 9:reg3=reg1-1:goto *sw_begin
eq_B 10:reg2-=2:goto *sw_begin
eq_B 11:cr_com=en_calc:goto *com_sw: goto *sw_begin
swend
}
}
// 代入
if flag_on_do==1{
; set_x_var_value@variable_manage "x",1,v1
cmd_true_p{
switch my_pc_B
eq_B_three 12,"x",10,reg3
eq_B 15:cr_com=en_set_to_var:goto *com_sw: goto *sw_begin
swend
switch my_pc_B
eq_B_three 16,"y",20,reg2
eq_B 19:cr_com=en_set_to_var:cmd_fin
; logmes "通過check B"
swend
}
}
// case 14
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"ax1a",21)
}
}
// goto
if flag_on_do==1{
cmd_true_p{
do_eq_two(4,en_goto,my_label)
}
}
// case 15:"ax1a" def label
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label


if flag_on_label_search==1{
label_true_p{
do_eq_ldef_four(1,"ax1a",21,label_pc)
}
}
// case 16 cls 0
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_one(1,en_cls0)
}
}
// case 17 objsize
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_objsize,120,24)
}
}
// case 18
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"a",1)
}
}
// button
if flag_on_do==1{
cmd_true_p{
subr_label=my_label
do_eq_button_A_two_add1 4,"NEXT"
}
}
// case 19 pos
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_pos,150,0)
}
}
// case 20 mes
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
switch my_pc_B
eq_B_two 1,"x",10
eq_B 3:reg1=get_x_var_value@variable_manage(cp1,cp2):logmes ""+reg1:goto *sw_begin
swend
switch my_pc_B
eq_B_two 4,"y",20
eq_B 6:reg2=get_x_var_value@variable_manage(cp1,cp2):goto *sw_begin
swend
switch my_pc_B
eq_B 7:cp1="Xの値は"+reg1+"です":goto *sw_begin
eq_B 8:cr_com=en_mes:cmd_fin
swend
}
}
// case 21 jz
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label var
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"l4jz",31)
}
cmd_true_p{
switch my_pc_B
eq_B_two 4,"x",10
eq_B 6:cr_com=en_get_from_var:goto *com_sw
eq_B 7:reg1=cpr:goto *sw_begin
mes ""+reg1:goto *sw_begin
swend
}
}
// jz
; if flag_on_do==1{
; cmd_true_p{
; ;cp1=my_label:cr_com=en_goto:cmd_fin
; eq_B 8:cp1=reg1:cp2=my_label:cr_com=en_jz:goto *com_sw
; if my_pc_B==9:cr_com=en_nop:cmd_fin
; }
; }
if flag_on_do==1{
cmd_true_p{
switch my_pc_B
eq_B_two 8,reg1,my_label
eq_B 10
cr_com=en_jz:goto *com_sw
swend
}
}
// case 22tmp
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label var
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"l4jnz",30)
}
cmd_true_p{
switch my_pc_B
eq_B_two 4,"x",10
eq_B 6:cr_com=en_get_from_var:goto *com_sw
eq_B 7:reg1=cpr: goto *sw_begin
mes ""+reg1:goto *sw_begin
swend
}
}
// jnz
if flag_on_do==1{
cmd_true_p{
switch my_pc_B
eq_B_two 8,reg1,my_label
eq_B 10
cr_com=en_jnz:goto *com_sw
swend
}
}
// case 23 stop
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_one(1,en_stop)
}
}

// case 24:"l4jz" def label
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
label_true_p{
do_eq_ldef_four(1,"l4jz",31,label_pc)
}
}
// case 25 cls 0
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_one(1,en_cls0)
}
}
// case 26 objsize
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_objsize,120,24)
}
}
// case 27
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"a",1)
}
}
// button
if flag_on_do==1{
cmd_true_p{
subr_label=my_label
do_eq_button_B_two_add1 4,"NEXT"
}
}
// case 28 pos
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_pos,150,0)
}
}
// case 29 mes
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_two(1,en_mes,"Xの値は0です!!!")
}
}
// case 30 stop
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_one(1,en_stop)
}
}
// case 31:"l4jnz" def label
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_do
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_label_search==1{
logmes "jnz A"
logmes ""+label_pc
; logmes ""+num_stack.my_line
; num_stack.my_line=30
label_true_p{
do_eq_ldef_four(1,"l4jnz",30,label_pc)
}
}

// case 32 cls 0
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_one(1,en_cls0)
}
}
// case 33 objsize
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_objsize,120,24)
}
}
// case 34
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

// read label
if flag_on_do==1{
cmd_true_p{
do_eq_three_lread(1,en_get_my_label,"a",1)
}
}
// button
if flag_on_do==1{
cmd_true_p{
subr_label=my_label
do_eq_button_A_two_add1 4,"NEXT"
}
}
// case 35 pos
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_three(1,en_pos,150,0)
}
}
// case 36 mes
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label


if flag_on_do==1{
cmd_true_p{
switch my_pc_B
eq_B_two 1,"x",10
eq_B 3:cr_com=en_get_from_var:goto *com_sw
eq_B 4:reg1=cpr:goto *sw_begin
swend
do_eq_two(5,en_mes,"Xの値は"+reg1+"です。。。")
}
}
// case 37 stop
my_line=int(__LINE__)
gosub *sbr_l_search
gosub *sbr_no_jump_lab_search
if is_jump_p==1:is_jump_p=0:goto global_label

if flag_on_do==1{
cmd_true_p{
do_eq_one(1,en_stop)
}
}
//if flag_on_label_search==1:mes 6:goto *_2do
;mes 6
; goto *sw_begin
;}
if flag_on_line_search==1{
; logmes "B"
goto *count_b
}
if flag_on_label_search==1{
goto *count_c
}
num_rgst_dump
mes "stop"
stop


*get_my_label
my_label=get_x_label_l_value@mod_label(cp1,cp2)
; my_label=get_x_label_l_value@mod_label("a",0)
goto *sw_begin
*bt_hoge_1
; mes my_pc
; mes bt_pc_1
cmd_pc=bt_pc_1
goto *sw_begin
*bt_hoge_2
cmd_pc=bt_pc_2
goto *sw_begin
*sw_end
stop

>そっか マクロじゃなくサブルーチンにすればいいのかにゃw
>ってサブルーチンじゃなくベタ書きな処理系を想像してたのにw
うっかり実装前にしゃべっちゃってはかどんないはかどんないw
1件 〜 4 件(全 82 件表示)
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | >


  


 

無料レンタル掲示板 1616BBS