all these were taken from other projects
these are jsut a few useful functions and i decided to give them to others
function get_ending(file$) `gets the file ending of the file(dont work with a path only local files)
ending as string
for z=1 to len(file$)
tmp$=mid$(file$,z)
if tmp$="."
dim temp$(32)
for i=1 to len(file$)-z
temp$(i)=mid$(file$,z+i)
next i
for i=1 to len(file$)-z
ending=ending+temp$(i)
next i
endif
next i
undim temp$()
endfunction ending
function get_path(file$) 'gets the onyl the path of a file
path as string
for i=len(file$) to 1 step -1
if mid$(file$,i)="\"
num=i
exit
endif
next i
if num=0 then exitfunction get dir$()
dim tmp$(num)
for i=1 to num
tmp$(i)=mid$(file$,i)
next i
file$=""
for i=1 to num-1
file$=file$+tmp$(i)
next i
undim tmp$()
path=file$
endfunction path
function remove_quotes(name$) `removes quotes ;useful for cl$()
strng as string
dim tmp$(1024)
for i=2 to len(name$)-1
tmp$(i)=mid$(name$,i)
next i
for i=2 to len(name$)-1
strng=strng+tmp$(i)
next i
endfunction strng