HSPLet あれこれ

仮引数へ代入が可能

#runtime "hsplet3"
#module
#deffunc f int a
	mes a ; >> 123
	a = 456
	mes a ; >> 456
	return
#global

f 123

仮引数が静的にふるまう

#runtime "hsplet3"
#module
#deffunc f int a
	if a >= 5 : return
	mes "" + b + ", " + a
	b ++
	f a + 1
	b --
	mes "" + b + ", " + a
	return
#global

f

; >> 0, 0
; >> 1, 1
; >> 2, 2
; >> 3, 3
; >> 4, 4
; >> 4, 5
; >> 3, 5
; >> 2, 5
; >> 1, 5
; >> 0, 5

strmid や instr の第一引数を変数に限定しない

#runtime "hsplet3"

mes strmid("hoge", 1, 2) ; >> og
mes instr("abcdefg", 1, "de") ; >> 2

noteunsel 用に多段に記憶している

#runtime "hsplet3"
a = "*"
notesel a
mes notesize ; >> 1
	b = "**"
	notesel b
	mes notesize ; >> 2
		c = "***"
		notesel c
		mes notesize ; >> 3
			d = "****"
			notesel d
			mes notesize ; >> 4
			mes notesize ; >> 4
			noteunsel
		mes notesize ; >> 3
		noteunsel
	mes notesize ; >> 2
	noteunsel
mes notesize ; >> 1