define構造体

defineマクロで作った構造体

defineマクロで作った構造体

  • タグ:
  • タグはありません
#runtime "hsp3cl"

#define ctype Person(%1,%2,%3,%4,%5) \
	%1_name.%2=%3 :\
	%1_age.%2=%4 :\
	%1_height.%2=%5

#define ctype status(%1,%2) \
	mes strf("名前: %%s 年齢: %%d 身長: %%.1f",%1_name.%2,%1_age.%2,%1_height.%2)

#enum taro=0
#enum jiro
#enum sbro
Person(brother,taro,"太郎",25,168.3)
Person(brother,jiro,"次郎",23,190.0)
Person(brother,sbro,"参郎",18,175.8)

foreach brother_name
	status(brother,cnt)
loop