;iconview 99.10.20 ANTARES #include "Exforce.as" #include "anthspex.as" gsel 0,-1 ttl="iconview" sdim dir,32000 sdim s,261 sdim arg,261 if cmdline!="" { extract arg,cmdline,1 chdir arg } notesel dir dirlist dir,"*.ico",1 notemax max: num=max dir="": dirlist dir,"*.cur",1 notemax max: num+=max dir="": dirlist dir,"*.ani",1 notemax max: num+=max if num<1 { dialog "アイコンファイルがありません",1,ttl: end } a=num: gosub *l_sqrt xmax=sqrt+1: if xmax<3: xmax=3 ymax=(num+xmax-1)/xmax wid=xmax*36+4: if wid<128: wid=128 heit=ymax*36+30: wx=(dispx-12-wid)/2: wy=(dispy-heit)/2 screen 2,wid,heit,,wx,wy: title ttl pos (wid-64)/2,heit-26: button "終了",*l_end sdim buf,num*64+1 x=4: y=4: i=0 dir="": dirlist dir,"*.ico",1 buf+=dir dir="": dirlist dir,"*.cur",1 buf+=dir dir="": dirlist dir,"*.ani",1 buf+=dir strsort buf notesel buf notemax max gosub *l_iconload stop *l_end end *l_iconload repeat max noteget s,cnt pos x,y: icoload s,1 i++ if i>=xmax { i=0: y+=36: x=4 } else { x+=36 } wait 10 loop return ;------------------------------------------------------------------------------ ;平方根を求める ;入力:a ;出力:sqrt ;破壊:i ;------------------------------------------------------------------------------ *l_sqrt ;下の値をxとすると、小数点以下切り捨てとして(x*2)^2-1=262143まで有効 i=256 sqrt=0 repeat 9 ;0〜8 if a>=((sqrt+i)*(sqrt+i)) { sqrt+=i } i=i>>1 loop return