// RGBを最大5パターン扱ってみる
pattern = 5
// RGB格納マクロ
dim _rgb, pattern
#define setrgb(%1, %2 = 0, %3 = 0, %4 = 0) : _rgb.%1 = %4 << 16 + (%3 << 8) + %2
#define ctype getrgb(%1, %2 = 0) _rgb.%1 >> (%2 * 8) & 0xFF
// 表示準備
dim col, 1
sdim label, 128
repeat pattern, 1
if cnt > 1 : label += "\n"
label += "No." + cnt
loop
objsize 80, 25
pos 100, 30 : combox index, 100, label
pos 100, 60 : button "S e t", *set
pos 100, 90 : button "G e t", *get
stop
*set
dialog "", 33
if stat : setrgb index, rval, gval, bval
stop
*get
col = getrgb(index, 0) : tmp = "赤:" + col + " "
col = getrgb(index, 1) : tmp += "青:" + col + " "
col = getrgb(index, 2) : tmp += "緑:" + col
dialog tmp, , "No" + index + "の格納情報"
stop
|