Ok, here is the latest version of my code. Changes include:
Music can now be left playing while you explore. To stop it, press backspace.
The colors can be changed via the options button.
The my computer button works now.
Re-wrote several subroutines.
The date now includes the day of the week and the time is in 12 hour form, rather than 24.
There are a few other misc changes here and there, but these are the big ones.
set display mode 640,480,32
set window on
set window size 700,550
set window layout 1,1,0
set window title "BN2'S File scanner"
`image list:
`1=Back
`2=folder button
`3=Picture button
`4=Text Button
`5=object button
`6=sound button
`7=video button
`8-13=c,a,d,e,f,g
`14-17=quick buttons
`18=Back arrow
`19=up
`20=down
`21-24 highlights (drive,button,icon,small)
`25=mouse
`48=Drive
`49=EXE
`50=text
`78=Window
`1000=Main GUI
drive$=upper$(left$(get dir$(),1))
sync on
hide mouse
if path exist(drive$+":WINDOWSDesktop")=1
desktop$=drive$+":WINDOWSDesktop"
document$=drive$+":My Documents"
else
document$=getreg$("HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders","Personal",drive$)
desktop$=getreg$("HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders","Desktop",drive$)
endif
dim hotspots(700,500)
gosub makehotspots
show mouse
dim maincolor(4)
dim quickrgb1(4)
dim quickrgb2(4)
dim background(4)
color1=1
color2=1
color3=1
color4=1
quickrgb1(1)=rgb(243,203,141)
quickrgb2(1)=rgb(234,155,38)
maincolor(1)=rgb(0,127,50)
background(1)=rgb(0,0,0)
quickrgb1(2)=rgb(127,5,5)
quickrgb2(2)=rgb(255,5,5)
maincolor(2)=rgb(255,5,5)
background(2)=rgb(0,0,0)
quickrgb1(3)=rgb(5,127,5)
quickrgb2(3)=rgb(5,255,5)
maincolor(3)=rgb(5,255,5)
background(3)=rgb(0,0,0)
quickrgb1(4)=rgb(5,5,127)
quickrgb2(4)=rgb(5,5,255)
maincolor(4)=rgb(5,5,255)
background(4)=rgb(0,0,0)
gosub generategui
gosub makebuttons
sprite 11,0,1000,2
sprite 12,0,1000,3
sprite 13,0,1000,4
sprite 14,0,1000,5
sprite 15,0,1000,6
sprite 16,0,1000,7
sprite 17,0,1000,8
sprite 18,0,1000,49
set text font "arial",1
`background
sprite 1000,640,480,1
gosub assemblefiles
dim files(4000)
sprite 1,1000,1000,1000
set current bitmap 0
`gosub options
set text font "arial",1
do
set text font "arial",1
if backspacekey()=1 and music exist(1)=1
if music playing(1)
stop music 1
endif
delete music 1
endif
if backspacekey()=1 and sound exist(1)=1
if sound playing(1)
stop sound 1
endif
delete sound 1
endif
gosub makeui
ink 0,0
box 100,90,639,479
if fileoffset<0 then fileoffset=0
paste sprite 1,100,90-fileoffset
ink rgb(255,255,255),0
draw to front
sprite 2,mousex(),mousey(),25
set sprite 2,1,0
sprite 100,2000,2000,21
ink rgb(0,0,255),0
box 150,71,600,83
ink rgb(255,255,255),0
sprite 2,mousex(),mousey(),25
draw to front
text 150,71,upper$(get dir$())
paste sprite 1000,0,0
set text size 24
text 10,10,calcday$()
text 10,30,get date$()
hours=val(left$(get time$(),2))
if hours>12 : hours=hours-12 : ampm$="PM" : else : ampm$="AM" : endif
time$=str$(hours)+left$(right$(get time$(),6),3)+" "+ampm$
text 10,50,time$
set text size 12
gosub button_check
if upkey()=1 or scancode()=201
dec fileoffset,2
endif
if downkey()=1 or scancode()=209
inc fileoffset,2
endif
sync
cls
loop
end
generategui:
` ink rgb(255,255,50),0
ink maincolor(color1),0
` ink rgb(255,255,255),0
box 0,0,100,479
box 0,0,639,70
box 100,70,150,120
ink rgb(0,0,255),0
box 628,71,639,479
ink 0,0
fill(100,70,150,120,150,120,49,background(color4))
get image 1,0,0,640,480
cls
return
button_check:
col=sprite collision(2,0)
` scale sprite col,110
for i=1 to 1000
if sprite exist(i)
if col=i
scale sprite col,110
else
scale sprite i,100
endif
endif
next i
if mouseclick()=1
hide sprite 100
select col
case 3
if path exist("C:")
cd "C:"
fileoffset=0
gosub assemblefiles
endif
endcase
case 4
if path exist("D:")
cd "D:"
fileoffset=0
gosub assemblefiles
endif
endcase
case 5
if path exist("A:")
cd "A:"
fileoffset=0
gosub assemblefiles
endif
endcase
case 6
if path exist("E:")
cd "E:"
fileoffset=0
gosub assemblefiles
endif
endcase
case 7
fileoffset=0
gosub mycomputer
endcase
case 8
cd document$
fileoffset=0
gosub assemblefiles
endcase
case 9
fileoffset=0
endcase
case 10
cd desktop$
fileoffset=0
gosub assemblefiles
endcase
case 101: set dir "../" : gosub assemblefiles : fileoffset=0 : endcase
case 102: dec fileoffset,80 : endcase
case 103: inc fileoffset,80 : endcase
case 51: gosub options : endcase
case default: gosub filehandler: endcase
endselect
wait 300
endif
return
makehotspots:
Text 0,0,"Loading"
create bitmap 2,700,500
color=11
starty=83
for y=1 to 5
startx=125
color=1+10*y
for x=1 to 5
ink rgb(color,5,5),0
box startx,starty,startx+100,starty+80
inc color
inc startx,100
sync
next x
inc starty,80
next y
ink rgb(255,255,255),0
starty=startx=0
set current bitmap 2
for boxy=0 to 4
starty=boxy*81
for boxx=0 to 4
startx=boxx*100
color=rgbr(point(startx+125,starty+83))
for y=0 to 80
for x=0 to 100
hotspots(x+startx+125,y+starty+83)=color
next x
next y
next boxx
next boxy
set current bitmap 0
return
assemblefiles:
ink rgb(255,255,255),0
set current bitmap 1
cls
startx=25
starty=0
x=startx
y=starty
count=0
type=0
imgnum=0
filename$=""
empty checklist
perform checklist for files
totalfiles=checklist quantity()
find first
for i=1 to totalfiles
if get file name$()<>"." and get file name$()<>".."
filename$=get file name$()
type=typehandler(filename$)
select type
case 1 : imgnum=2 : sprite=11 : endcase
case 2 : imgnum=3 : sprite=12 : endcase
case 3 : imgnum=4 : sprite=13 : endcase
case 4 : imgnum=5 : sprite=14 : endcase
case 5 : imgnum=6 : sprite=15 : endcase
case 6 : imgnum=7 : sprite=16 : endcase
case 7 : imgnum=5 : sprite=14 : endcase
case 8 : imgnum=49 : sprite=18 : endcase
case default : imgnum=49 : sprite=18 : endcase
endselect
paste sprite sprite,x,y
center text x+sprite width(sprite)/2,y+65,filename$
inc x,100
inc count
if count=5
count=0
inc y,80
x=startx
endif
endif
` if get file type()<>-1
find next
` endif
next i
get image 1000,0,0,550,4000
set current bitmap 0
filename$=""
imgnum=0
sprite=0
type=0
return
filehandler:
if hotspots(mousex(),mousey())<>0
hotspot=hotspots(mousex(),mousey())
y=(hotspot/10)-1
x=hotspot-10*(y+1)
x=x+5*y+5*(fileoffset/80)
perform checklist for files
if (x-1)<=checklist quantity()
find first
if get file name$()="."
find next
find next
endif
if x>1
for i=1 to x-1
if get file type()<>-1
find next
endif
next i
endif
name$=get file name$()
type=typehandler(get file name$())
select type
case 1 : gosub pictures : endcase
case 2 : gosub handletext : endcase
case 3 : gosub object : endcase
case 4 : gosub sound : endcase
case 5 : gosub video : endcase
case 6 : if path exist(name$)=1 then cd name$ : gosub assemblefiles : endcase
case 7 : gosub music : endcase
case 8 : gosub exe : endcase
endselect
fileoffset=0
endif
endif
return
pictures:
if file exist(name$)
load image name$,567
sprite 567,0,0,567
set sprite 567,1,0
max#=320.0
repeat
if upkey()=1 : if 240>=cy: inc cy : endif : endif
if downkey()=1 : if cy>=-240 : dec cy : endif : endif
if leftkey()=1 and 320>=cx then inc cx
if rightkey()=1 and cx>=-320 then dec cx
if inkey$()="+" then inc max#,10.0
if inkey$()="-" then dec max#,10.0
if max#<=0.0 then max#=10.0
ink rgb(255,255,255),0
width#=sprite width(567)
scale#=max#/width#
scale sprite 567,scale#*100
sprite 567,320-(sprite width(567)/2)+cx,240-(sprite height(567)/2)+cy,567
sync
scale sprite 567,100
until returnkey()=1
delete sprite 567
delete image 567
endif
return
object:
if file exist(name$)
backdrop on
load object name$,1
repeat
turn object right 1,1
sync
until scancode()<>0
delete object 1
backdrop off
endif
return
video:
if file exist(name$)
load animation name$,1
makewindow(animation width(1)+10,animation height(1)+10,320,240,quickrgb1(color2),quickrgb2(color3))
play animation 1,320-(animation width(1)/2),240-(animation height(1)/2)
loop animation 1
repeat
sync
until scancode()<>0
delete animation 1
endif
delete sprite 54
return
sound:
if file exist(name$)
if sound exist(1)
if sound playing(1)
stop sound 1
endif
delete sound 1
endif
load sound name$,1
play sound 1
loop sound 1
endif
return
music:
if file exist(name$)
if music exist(1)
if music playing(1)
stop music 1
endif
delete music 1
endif
load music name$,1
play music 1
loop music 1
endif
return
exe:
if file exist(name$)
execute file name$,"",""
endif
return
`---------------------------------------------------
handletext:
if file exist(name$)
open to read 1,name$
create bitmap 3,1000,50000
set text font "Arial",1
set text size 14
repeat
repeat
`80
read byte 1,letter
if letter<>10 and flag=1 then flag=0
line$=line$+chr$(letter)
inc count
total=total+1
if letter=13
flag=1
endif
until count=79 or (flag=1 and letter=10)
count=0
flag=0
x=file size(name$)
text 0,lines*text height("|"),line$
line$=""
inc lines
until (total=x)
`----------------------------------------------------------------------------------------------
get image 50,0,0,1000,lines*text height("|")
delete bitmap 3
sprite 50,0,4000,50
repeat
set current bitmap 0
ink 0,0
box 125,80,639,479
ink rgb(255,255,255),0
paste sprite 50,125-offsetx,83-offsety
gosub makeui
if upkey()=1 then dec offsety,100
if downkey()=1 then inc offsety,100
if offsety<0 then offsety=0
` if rightkey()=1 then inc offsetx,5
` if leftkey()=1 then dec offsetx,5
if offsetx<0 then offsetx=0
sync
cls
until returnkey()=1
close file 1
cls
endif
return
makeui:
`c:
sprite 3,150,5,8
`d:
sprite 4,250,5,9
`a:
sprite 5,350,5,10
`e:
sprite 6,450,5,11
i=100
`My Comp
sprite 7,1,110+i,14
`MY DOCUMENTS
sprite 8,1,140+i,15
`CONTROL PANEL
sprite 9,1,170+i,16
`DESKTOP
sprite 10,1,200+i,17
`back arrow
sprite 101,600,71,18
`up arrow
sprite 102,628,71,19
`down arrow
sprite 103,628,468,20
`options
sprite 51,560,50,51
paste sprite 1000,0,0
return
mycomputer:
dim drive$(5,5)
x=50
y=0
x2=1
y2=1
count=0
ink 0,0
set current bitmap 1
cls
ink rgb(255,255,255),0
sprite 105,640,480,48
if count=5
y=y+80
count=0
x=50
x2=0
inc y2
endif
paste sprite 105,x,y
inc count
center text x+sprite width(105)/2,y+sprite height(105),"A:"
inc x,100
drive$(x2,y2)=chr$(i)+":"
inc x2
for i=98 to 123
if path exist(chr$(i)+":")
sprite 8+i,640,480,48
if count=5
y=y+80
count=0
x=50
x2=0
inc y2
endif
paste sprite 8+i,x,y
inc count
center text x+sprite width(8+i)/2,y+sprite height(8+i),upper$(chr$(i))+":"
inc x,100
drive$(x2,y2)=chr$(i)+":"
inc x2
endif
next i
get image 1000,0,0,550,4000
set current bitmap 0
gosub mycomploop
return
mycomploop:
sprite 1,1000,0,1000
set current bitmap 0
repeat
ink 0,0
box 100,83,639,479
ink rgb(255,255,255),0
paste sprite 1,125,83
gosub makeui
if mouseclick()=1
if hotspots(mousex(),mousey())<>0
hotspot=hotspots(mousex(),mousey())
cy=(hotspot/10)
cx=hotspot-10*(cy)
if path exist(drive$(cx,cy))
cd drive$(cx,cy)
exitflag=1
endif
endif
endif
sync
until exitflag=1
exitflag=0
cls
gosub assemblefiles
return
options:
makewindow(166,166,320,240,quickrgb1(color2),quickrgb2(color3))
ink rgb(5,5,5),0
text 245,163,"Primary Color"
text 245,203,"Button Color 1"
text 245,243,"Button Color 2"
text 245,283,"Background Color"
ink rgb(5,5,5),0
for x=0 to 3
ink 0,0
box 265+30*x,178,285+30*x,198
box 265+30*x,218,285+30*x,238
box 265+30*x,258,285+30*x,278
box 265+30*x,298,285+30*x,318
ink maincolor(x+1),0
box 267+30*x,180,283+30*x,196
ink quickrgb1(x+1),0
box 267+30*x,220,283+30*x,236
ink quickrgb2(x+1),0
box 267+30*x,260,283+30*x,276
ink background(x+1),0
box 267+30*x,300,283+30*x,316
next x
if bitmap exist(3)<>1 then create bitmap 3,640,480
set current bitmap 3
cls
set text font "Arial",1
set text size 24
ink rgb(5,5,5),0
center text 320,240,"X"
get image 82,310,230,340,260
delete bitmap 3
sync
gosub optionsloop
return
optionsloop:
set current bitmap 0
repeat
if mouseclick()=1
repeat
sync
until mouseclick()=0
color=point(mousex(),mousey())
`Changes the main color
if 198>=mousey() and mousey()>=178
select color
case maincolor(1) : color1=1 : endcase
case maincolor(2) : color1=2 : endcase
case maincolor(3) : color1=3 : endcase
case maincolor(4) : color1=4 : endcase
endselect
endif
`Changes Quickrgb1
if 236>=mousey() and mousey()>=220
select color
case quickrgb1(1) : color2=1 : endcase
case quickrgb1(2) : color2=2 : endcase
case quickrgb1(3) : color2=3 : endcase
case quickrgb1(4) : color2=4 : endcase
endselect
endif
`Changes Quickrgb2
if 276>=mousey() and mousey()>=260
select color
case quickrgb2(1) : color3=1 : endcase
case quickrgb2(2) : color3=2 : endcase
case quickrgb2(3) : color3=3 : endcase
case quickrgb2(4) : color3=4 : endcase
endselect
endif
endif
ink rgb(255,255,255),0
text 600,500,str$(color)
sprite 82,235+30*color1,167,82
sprite 83,235+30*color2,207,82
sprite 84,235+30*color3,247,82
sync
until returnkey()=1
cls
delete sprite 54
delete sprite 82
delete sprite 83
delete sprite 84
gosub generategui
gosub makebuttons
return
makebuttons:
`FOLDER BUTTON
ink rgb(227,217,91),0
box 320,240,380,285
box 320,225,350,285
fill(320,225,380,285,350,240,16,rgb(227,217,91))
get image 7,320,225,380,285
cls
`PICTURE BUTTON
ink rgb(127,127,127),0
box 320,240,380,300
ink rgb(227,217,91),0
box 325,245,375,295
set text size 45
ink rgb(5,5,5),0
text 337,247,"P"
get image 2,320,240,380,300
cls
`TEXT BUTTON
ink rgb(127,127,127),0
box 320,240,380,300
ink rgb(230,230,255),0
box 330,245,370,295
ink rgb(5,5,5),0
line 335,255,365,255
line 335,270,365,270
line 335,285,365,285
get image 3,320,240,380,300
cls
`OBJECT BUTTON
ink rgb(127,127,127),0
box 320,240,380,300
ink rgb(227,217,91),0
box 325,245,375,295
set text size 45
ink rgb(5,5,5),0
text 337,247,"O"
get image 4,320,240,380,300
cls
`SOUND BUTTON
ink rgb(127,127,127),0
box 320,240,380,300
ink rgb(5,5,5),0
box 325,245,375,295
ink rgb(230,230,255),0
x=325
x2=325
y2#=270
for i=1 to 50
y#=sin(20*i)*20+270
line x,y#,x2,y2#
x2=x
y2#=y#
inc x,1
next x
get image 5,320,240,380,300
cls
`VIDEO BUTTON
ink rgb(127,127,127),0
box 320,240,380,300
ink rgb(227,217,91),0
box 325,245,375,295
set text size 45
ink rgb(5,5,5),0
text 337,247,"V"
get image 6,320,240,380,300
cls
`DRIVE BUTTONS
ink quickrgb1(color2),0
box 100,100,400,166
ink quickrgb2(color3),0
box 105,105,195,128
box 205,105,295,128
box 305,105,395,128
box 105,138,195,161
box 205,138,295,161
box 305,138,395,161
ink rgb(5,5,5),0
set text size 24
center text 150,108,"C:"
center text 250,108,"D:"
center text 350,108,"A:"
center text 150,141,"E:"
center text 250,141,"F:"
center text 350,141,"G:"
get image 8,100,100,200,133
get image 9,200,100,300,133
get image 10,300,100,400,133
get image 11,100,133,200,166
get image 12,200,133,300,166
get image 13,300,133,400,166
cls
`QUICK BUTTONS
ink quickrgb1(color2),0
box 100,40,200,160
ink quickrgb2(color3),0
box 100,42,200,68
box 100,72,200,98
box 100,102,200,128
box 100,132,200,158
set text size 16
ink rgb(5,5,5),0
center text 150,45,"My Computer"
center text 150,75,"My Documents"
center text 150,105,"Control Panel"
center text 150,135,"Desktop"
get image 14,100,40,200,70
get image 15,100,70,200,100
get image 16,100,100,200,130
get image 17,100,130,200,160
cls
`OPTIONS BUTTON
set text font "Arial",1
set text size 12
ink quickrgb1(color2),0
box 0,0,51,15
ink quickrgb2(color3),0
box 2,2,48,12
ink rgb(5,5,5),0
center text 25,2,"Options"
get image 51,0,0,51,15
`----------------------------------------------------------------------------------------------
`<- BUTTON
set text font "arial",2
ink rgb(100,100,100),0
box 320,240,332,252
ink rgb(127,127,127),0
box 322,242,330,250
set text size 12
set text to bold
ink rgb(0,127,0),0
Center Text 326,241,chr$(215)
get image 18,320,240,332,252
cls
`/ Button
ink rgb(100,100,100),0
box 320,240,332,252
ink rgb(127,127,127),0
box 322,242,330,250
set text size 12
`set text to bold
ink rgb(5,5,5),0
Center Text 327,241,chr$(217)
get image 19,320,240,332,252
cls
`/ BUTTON
ink rgb(100,100,100),0
box 320,240,332,252
ink rgb(127,127,127),0
box 322,242,330,250
set text size 12
set text font "Arial",2
ink rgb(5,5,5),0
Center Text 327,241,chr$(218)
get image 20,320,240,332,252
cls
`EXE BUTTON
set text font "Arial",2
ink rgb(127,127,127),0
box 320,240,380,300
ink rgb(5,5,255),0
box 325,245,375,295
set text size 45
ink rgb(5,255,5),0
text 337,247,chr$(216)
get image 49,320,240,380,300
cls
`-------------------------------------------------------------------------------------------------------------------
`DRIVE ICON
ink rgb(127,127,127),0
box 320,240,380,300
ink rgb(255,255,255),0
box 325,245,375,295
set text font "Arial",2
set text size 72
ink 0,0
text 322,225,chr$(59)
get image 48,320,240,380,320
cls
`---------------------------------------------------------------------------------------------------------
`Button Highlights
create bitmap 1,640,4000
ink 0,rgb(255,255,255)
cls
ink 0,0
level#=250
count#=480*640*(level#/100)
for i=1 to count#
dot rnd(640),rnd(480)
next i
`quick drive highlights
get image 21,0,0,100,33
`quick button highlights
get image 22,320,240,420,270
`icon highlights
get image 23,40,60,100,120
`small highlights
get image 24,10,38,22,50
cls
set current bitmap 0
`MOUSE COLLISION BOX
ink 0,rgb(11,11,11)
cls
get image 25,320,240,322,242
ink rgb(255,255,255),0
set text size 12
return
function distance#(x,y,cx,cy)
r#=sqrt(abs(((cx-x)*(cx-x)+(cy-y)*(cy-y))))
endfunction r#
function fill(startx,starty,endx,endy,cx,cy,r,color)
ink color,0
for y=starty to endy
for x=startx to endx
if distance#(x,y,cx,cy)<=r
dot x,y
endif
next x
next y
endfunction
`CREATED BY: MadrMan March 5,2006
function getreg$(path$,key$,drive$)
c=0
a=0
d=0
aa=0
string$=""
stringb$=""
param$=""
if file exist(drive$+":reg.reg") then delete file drive$+":reg.reg"
reg$="/e "+drive$+":reg.reg "+chr$(34)+path$+chr$(34)
execute file "regedit.exe",reg$,""
repeat : a=a+1 : until file open(a)=0
length=len(chr$(34)+key$+chr$(34))
`----------------------------------------------------------------------------
repeat : c=c+1 : until file exist(drive$+":reg.reg")=1 or c=1000
if c=1000 then exitfunction
set dir drive$+":"
open to read a,"reg.reg"
repeat
read string a,string$
if mid$(string$,1)=mid$(key$,1)
repeat
read string 1,stringb$
string$=string$+stringb$
d=d+1
until d>length or string$=key$ or mid$(key$,d)<>mid$(string$,d)
d=0
if key$=string$
repeat
read string a,string$
if aa=2 and string$<>chr$(34) then param$=param$+string$
` if string$=chr$(34) then a=1
if string$=chr$(34) then aa=aa+1
until aa=4
endif
endif
until file end(a)=1 or lower$(left$(string$,length))=lower$(chr$(34)+key$+chr$(34)) or param$<>""
close file a
`para$=right$(string$,len(string$)-length)
if file exist(drive$+":reg.reg")
delete file drive$+":reg.reg"
endif
endfunction param$
function typehandler(file$)
remstart
pics
bmp
png
jpg
text
txt
doc
object
3ds
x
sound
xm
wma
wav
mp3
video
avi
wmv
mpg
mpeg
remend
dim extension$(20)
`1
extension$(1)=".bmp"
extension$(2)=".png"
extension$(3)=".jpg"
`2
extension$(0)=".dba"
extension$(4)=".txt"
extension$(5)=".doc"
extension$(19)=".ini"
`3
extension$(6)=".3ds"
extension$(7)=".x"
`4
extension$(8)=".xm"
extension$(9)=".wma"
extension$(10)=".wav"
extension$(11)=".mp3"
`5
extension$(12)=".avi"
extension$(13)=".wmv"
extension$(14)=".mpg"
extension$(15)="mpeg"
`7
extension$(16)=".mid"
`8
extension$(17)=".exe"
`9
extension$(18)=".lnk"
ext$=right$(file$,4)
select lower$(ext$)
case extension$(0) : type=2 : endcase
case extension$(1) : type=1 : endcase
case extension$(2) : type=1 : endcase
case extension$(3) : type=1 : endcase
case extension$(4) : type=2 : endcase
case extension$(5) : type=8 : endcase
case extension$(6) : type=3 : endcase
case extension$(9) : type=4 : endcase
case extension$(10) : type=4 : endcase
case extension$(11) : type=4 : endcase
case extension$(12) : type=5 : endcase
case extension$(13) : type=5 : endcase
case extension$(14) : type=5 : endcase
case extension$(15) : type=5 : endcase
case extension$(16) : type=7 : endcase
case extension$(17) : type=8 : endcase
case extension$(18) : type=8 : endcase
case extension$(19) : type=2 : endcase
case default : type=0 : endcase
endselect
if lower$(right$(ext$,2))=extension$(7) then type=3
if lower$(right$(ext$,3))=extension$(8) then type=7
if type=0
find first
while get file name$()<>file$ and get file type()>-1
find next
endwhile
if get file type()<>-1
if get file type()=1
type=6
endif
endif
endif
if type=0 then type=8
endfunction type
function makewindow(width,height,x,y,color1,color2)
create bitmap 31,width+1,height+1
ink color1,color2
cls
box 3,3,width-3,height-3
get image 54,0,0,width,height
set current bitmap 0
sprite 54,1000,0,54
paste sprite 54,x-(width/2),y-(height/2)
delete bitmap 31
endfunction
function backspacekey()
endfunction keystate(14)
function wrap(number,start,end)
repeat
if number>end then dec number,end
if number<start then inc number,end
until number<=end and number>=start
endfunction number
function calcday$()
dday=3
day=val(left$(right$(get date$(),5),2))
month=val(left$(get date$(),2))
year=val(right$(get date$(),2))
dim monthdata(12,2)
if int(year/4)=year/4
monthdata(1)=4
monthdata(2)=1
else
monthdata(1)=3
monthdata(2)=0
endif
monthdata(3)=0
monthdata(4)=4
monthdata(5)=9
monthdata(6)=6
monthdata(7)=11
monthdata(8)=8
monthdata(9)=5
monthdata(10)=10
monthdata(11)=7
monthdata(12)=12
year#=year
q#=int(year#/12)
r=((year#/12)-q)*12
r#=r
s=r#/4
t=q+r+s
`Figures out what day of the week dday is
dday=wrap(dday+t,1,7)
day=day-monthdata(month)
day#=day
x#=int(day#/7)
diff1#=day#-x#*7
diff1=diff1#
wkday=wrap(diff1+dday,1,7)
select wkday
case 1: wkday$="Sunday" : endcase
case 2: wkday$="Monday" : endcase
case 3: wkday$="Tuesday" : endcase
case 4: wkday$="Wednesday" : endcase
case 5: wkday$="Thursday" : endcase
case 6: wkday$="Friday" : endcase
case 7: wkday$="Saturday" : endcase
endselect
undim monthdata(12)
endfunction wkday$
@Nano
It seems to work, only getting 8 fps though. Also, the parent button seems to skip levels sometimes. Essentially, sometimes when I click it, it will do nothing then I click it again it goes up 2 levels. Couldn't access C: because of it. Other times, though, it seemed to work fine.
Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?