sounds a bit for baby programmers
umm and here is my contribution to it
rem these fuinctions do basic file i/o
rem use them as you please
rem for the read_file you must ahve txt declared global
rem made by free-space.myftp.org
rem this is a bit of an old file
rem made by Jordan E.
function file_saveas(what$,name$)
if name$=""
ret:
print "so what do you want to save this file as"
input file$
if file exist(file$)=1
print "that file exist's already do you want to over write y/n"
input temp$
if temp$="y"
delete file file$
else
goto ret
endif
endif
print "saving file"
open to write 1,file$
write string 1,what$
cls
else
if file exist(name$)=1 then delete file name$
print "saving file"
if file exist(name$)=1 then delete file name$
open to write 1,name$
write string 1,what$
cls
endif
if file open(1)=1 then close file 1
print "done"
endfunction
function read_file(num,fname$)
if fname$=""
ret2:
print "what file do you want to open"
input flname$
if file exist(flname$)=0
print "file does not exist"
goto ret2
endif
open to read 2,flname$
for i=1 to num+1
read string 2,temp$
if i=num-1 then read string 2,txt$
next i
else
if file exist(fname$)=0
print "error file don't exist"
print "please report this to the maker of this program"
txt$="error the file was not found"
exitfunction
else
open to read 2,fname$
for i=1 to num+1
read string 2,temp$
if i=num-1 then read string 2,txt$
next i
endif
endif
if file open(2)=1 then close file 2
endfunction
rem here are even more from a different source file
rem included in mplayer v3.1a beta
function remove_quotes(name$)
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
rem function to get the path of a file such as turn this:
rem C:folderfile.file to this C:folder
function get_path(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
rem these are some functions that could easily be adaptable for a game
rem client or even a game server
rem included as a core object in x-explorer 0.6 beta-depricated
REM *** Include File: user control.dba ***
REM Created: 1/22/2005 5:03:43 PM
REM
REM Included in Project: I:ProjectsMineX-ExplorerX-Explorer.dbpro
REM
function edit_users(name$)
admin=1
if special$(3)="administrator type 1"=0
admin=0
if name$=special$(0)=0
exitfunction 2
endif
endif
print "what type of user do you want this to be: "
print "currently is a "+special$(3)
if admin=1 then input "1 for an admin 2 for a limited user(blank or anythign else for unchanged): ",typee else print "you are not an admin so u can not change this"
input "what password do you want for this user(blank for unchanged): ",pass$
print "current user name is: "+name$
input "what user name do u want for this user(blank for unchanged): ",username$
open to read 3,start_path$+"users.lst"
dim tmp1$(256)
dim tmp3$(256)
dim tmp2$(256)
for i=1 to 256
read string 3,tmp1$(i)
read string 3,tmp2$(i)
read string 3,tmp3$(i)
if file end(3)=1 then tmp=i : exit
next i
for i=1 to 256
if encrypt(name$)=tmp1$(i)
tmp2=i
tmp3=1
exit
endif
next i
if tmp3=0 then exitfunction 3
close file 3
delete file start_path$+"users.lst"
open to write 3,start_path$+"users.lst"
if username$=""=0 then tmp1$(tmp2)=encrypt(username$)
if pass$=""=0 then tmp2$(tmp2)=encrypt(pass$)
if typee=0=0
if typee=1 then tmp3$(tmp2)="administrator type 1"
if typee=2 then tmp3$(tmp2)="limited user type 1"
endif
`remake this code when i get a rename directory dll
`using bat files
`add checking for user already existing
for i=1 to 256
if i=tmp2 then i=i+1
write string 3,tmp1$(i)
write string 3,tmp2$(i)
write string 3,tmp3$(i)
if i=tmp then exit
next i
close file 3
endfunction error
function delete_users(name$)
if special$(3)="administrator type 1"=0
`print "you are not an admin. exiting...."
exitfunction 2
endif
open to read 3,start_path$+"users.lst"
dim tmp1$(256)
dim tmp3$(256)
dim tmp2$(256)
for i=1 to 256
read string 3,tmp1$(i)
read string 3,tmp2$(i)
read string 3,tmp3$(i)
if file end(3)=1 then tmp=i : exit
next i
for i=1 to 256
if encrypt(name$)=tmp1$(i)
tmp2=i
tmp3=1
exit
endif
next i
if tmp3=0 then exitfunction 3
close file 3
delete file start_path$+"users.lst"
open to write 3,start_path$+"users.lst"
for i=1 to 256
if i=tmp2 then i=i+1
write string 3,tmp1$(i)
write string 3,tmp2$(i)
write string 3,tmp3$(i)
if i=tmp then exit
next i
close file 3
delete directory start_path$+"users"+encrypt(name$)
endfunction error
function logout()
if file exist(start_path$+""+special$(2)+"logout.script")=1
xscript(start_path$+""+special$(2)+"logout.script","")
print ""
print ""
goto logon
else
print "logout script missing error 1025"
print "making a new one"
make file start_path$+""+special$(2)+"logout.script"
print ""
print ""
goto logon
endif
endfunction
function make_users(name$,pass$,typee$) ` START HERE PRIORITY 1
`print "You must have administrative privledges to use this tool."
if special$(3)="administrator type 1"=0
`print "you are not an admin. exiting...."
exitfunction 2
endif
temp_oldpath$=get dir$()
cd start_path$+"users"
if path exist(start_path$+"users"+encrypt(name$))=1
exitfunction 3
endif
make directory start_path$+"users"+encrypt(name$)
cd start_path$+"users"+encrypt(name$)
make directory start_path$+"users"+encrypt(name$)+""+"apps"
make directory start_path$+"users"+encrypt(name$)+""+"docs"
make directory start_path$+"users"+encrypt(name$)+""+"starter"
make directory start_path$+"users"+encrypt(name$)+""+"settings"
make file start_path$+"users"+encrypt(name$)+""+"login.scrpt"
make file start_path$+"users"+encrypt(name$)+""+"logout.script"
cd start_path$
open to read 1,"users.lst"
dim temp$(1024)
do
tmp1=tmp1+1
`if temp$(tmp1)="" then exit
read string 1,temp$(tmp1)
if file end(1)=1 then exit
loop
close file 1
delete file "users.lst"
open to write 1,"users.lst"
tmp=0
do
tmp=tmp+1
if temp$(tmp)="" then exit
write string 1,temp$(tmp)
if tmp=tmp1
exit
endif
loop
`print name$
`print encrypt(name$)
write string 1,encrypt(name$)
write string 1,encrypt(pass$)
write string 1,encrypt(typee$)
close file 1
undim temp$()
ENDFUNCTION 0
function login(user$,password$,safemode)
dim tmp_lst$(256)
dim tmp_lst2$(256)
dim tmp_lst3$(256)
open to read 1,"users.lst"
for i=1 to 256
read string 1,tmp_lst$(i)
tmp_lst$(i)=decrypt(tmp_lst$(i))
read string 1,tmp_lst2$(i)
tmp_lst2$(i)=decrypt(tmp_lst2$(i))
read string 1,tmp_lst3$(i)
tmp_lst3$(i)=decrypt(tmp_lst3$(i))
if file end(1)=1 then exit
next i
for i=1 to 256
if user$=tmp_lst$(i)
if password$=tmp_lst2$(i)
special$(3)=tmp_lst3$(i)
correct=1
exit
endif
endif
`if file end(1)=1 then exit
next i
close file 1
if correct=0 then exitfunction 2
if path exist("users"+encrypt(user$))=0 then exitfunction 4
cd "users"+encrypt(user$)
special$(0)=user$
special$(1)=typee$
special$(2)="users"+encrypt(user$)
if file exist("login.scrpt")=0
print "non fatal error"
print "error #035"
print "login.scrpt was missing"
print "creating new login.scrpt"
make file "login.scrpt"
endif
xscript("login.scrpt",user$)
error=0
undim tmp_lst()
undim tmp_lst2()
undim tmp_lst3()
endfunction error
function encrypt(strin$)
strin$=lower$(strin$)
enstring as string
dim temp$(256)
dim done$(256)
num=len(strin$)
for i=1 to num
temp$(i)=mid$(strin$,i)
if temp$(i)="a" then done$(i)="b1"
if temp$(i)="b" then done$(i)="c2"
if temp$(i)="c" then done$(i)="d5"
if temp$(i)="d" then done$(i)="ea"
if temp$(i)="e" then done$(i)="a0"
if temp$(i)="f" then done$(i)="gz"
if temp$(i)="g" then done$(i)="7a"
if temp$(i)="h" then done$(i)="y9"
if temp$(i)="i" then done$(i)="p4"
if temp$(i)="j" then done$(i)="oo"
if temp$(i)="k" then done$(i)="7t"
if temp$(i)="l" then done$(i)="fd"
if temp$(i)="m" then done$(i)="a1"
if temp$(i)="n" then done$(i)="tt"
if temp$(i)="o" then done$(i)="yk"
if temp$(i)="p" then done$(i)="po"
if temp$(i)="q" then done$(i)="xz"
if temp$(i)="r" then done$(i)="lh"
if temp$(i)="s" then done$(i)="aq"
if temp$(i)="t" then done$(i)="qw"
if temp$(i)="u" then done$(i)="ec"
if temp$(i)="v" then done$(i)="g5"
if temp$(i)="w" then done$(i)="z2"
if temp$(i)="x" then done$(i)="t6"
if temp$(i)="y" then done$(i)="mn"
if temp$(i)="z" then done$(i)="n8"
if temp$(i)="1" then done$(i)="a2"
if temp$(i)="2" then done$(i)="0l"
if temp$(i)="3" then done$(i)="]["
if temp$(i)="4" then done$(i)="/."
if temp$(i)="5" then done$(i)=",a"
if temp$(i)="6" then done$(i)="`~"
if temp$(i)="7" then done$(i)="df"
if temp$(i)="8" then done$(i)="cs"
if temp$(i)="9" then done$(i)="er"
if temp$(i)="0" then done$(i)="n-"
if temp$(i)=" " then done$(i)="=-"
next i
for i=1 to num
enstring=enstring+done$(i)
next i
undim temp$()
undim done$()
endfunction enstring
function decrypt(strin$)
strin$=lower$(strin$)
enstring as string
dim temp$(256)
dim done$(256)
num=len(strin$)
numd=num/2
for i=1 to num
temp$(i)=mid$(strin$,i)
temp$(i)=temp$(i)+mid$(strin$,i+1) `debug with reading 2 letters not 1
if temp$(i)="b1" then done$(i)="a"
if temp$(i)="c2" then done$(i)="b"
if temp$(i)="d5" then done$(i)="c"
if temp$(i)="ea" then done$(i)="d"
if temp$(i)="a0" then done$(i)="e"
if temp$(i)="gz" then done$(i)="f"
if temp$(i)="7a" then done$(i)="g"
if temp$(i)="y9" then done$(i)="h"
if temp$(i)="p4" then done$(i)="i"
if temp$(i)="oo" then done$(i)="j"
if temp$(i)="7t" then done$(i)="k"
if temp$(i)="fd" then done$(i)="l"
if temp$(i)="a1" then done$(i)="m"
if temp$(i)="tt" then done$(i)="n"
if temp$(i)="yk" then done$(i)="o"
if temp$(i)="po" then done$(i)="p"
if temp$(i)="xz" then done$(i)="q"
if temp$(i)="lh" then done$(i)="r"
if temp$(i)="aq" then done$(i)="s"
if temp$(i)="qw" then done$(i)="t"
if temp$(i)="ec" then done$(i)="u"
if temp$(i)="g5" then done$(i)="v"
if temp$(i)="z2" then done$(i)="w"
if temp$(i)="t6" then done$(i)="x"
if temp$(i)="mn" then done$(i)="y"
if temp$(i)="n8" then done$(i)="z"
if temp$(i)="a2" then done$(i)="1"
if temp$(i)="0l" then done$(i)="2"
if temp$(i)="][" then done$(i)="3"
if temp$(i)="/." then done$(i)="4"
if temp$(i)=",a" then done$(i)="5"
if temp$(i)="`~" then done$(i)="6"
if temp$(i)="df" then done$(i)="7"
if temp$(i)="cs" then done$(i)="8"
if temp$(i)="er" then done$(i)="9"
if temp$(i)="n-" then done$(i)="0"
if temp$(i)="=-" then done$(i)=" "
i=i+1
next i
for i=1 to num
enstring=enstring+done$(i)
i=i+1
next i
undim temp$()
undim done$()
endfunction enstring
rem this is a simple "not finished and never will be" scripting language i titled x-bin or antibin(i never decided the name)
REM *** Include File: anitbin scripting.dba ***
REM Created: 1/9/2005 9:42:38 PM
REM
REM Included in Project: I:ProjectsMineX-ExplorerX-Explorer.dbpro
REM
function xscript(file$,arg$)
`declare globals
global xscript_ver# as float
open to read 32,file$
dim ext$(1024)
dim strings$(99) as string
dim ints(99)
dim floats#(99) as float
dim lables(99)
strings$(99)=arg$
for i=1 to 1024
read string 32,ext$(i)
tmp$=""
tmp$=tmp$+mid$(ext$(i),1)
tmp$=tmp$+mid$(ext$(i),2)
tmp$=tmp$+mid$(ext$(i),3)
tmp$=tmp$+mid$(ext$(i),4)
if tmp$="labl"
temp$=mid$(ext$(i),5)+mid$(ext$(i),6)
tmp=val(temp$)
lables(tmp)=i
endif
if file end(32)=1
lines=i
exit
endif
next i
close file 32
for i=1 to 1024
if ext$(i)="preint" and i=1 then gosub _preint
`print i
`if looping=1 and i=loopto+1 `ANOTHER PROBLEM(NOT SURE WHICH PART HAS THE PROBLEM
`i=linenum
`endif
`clear tmp variables
tmp$=""
temp$=""
tmp=0
trash$=""
tmp2$=""
if ext$(i)="lop " and loping2=1 then i=linnum
if ext$(i)="watk" then wait key
tmp$=tmp$+mid$(ext$(i),1)
tmp$=tmp$+mid$(ext$(i),2)
tmp$=tmp$+mid$(ext$(i),3)
tmp$=tmp$+mid$(ext$(i),4)
if tmp$="cls " then cls
if escapekey()=1 then exit
if tmp$="goto"
ifing=0
temp$=mid$(ext$(i),5)+mid$(ext$(i),6)
tmp=val(temp$)
i=lables(tmp)
endif
REM LOOPING IS A VARIABLE THAT CAN ENTERFER WITH THE EXIT COMMAND
if tmp$="do " and loping2=0
print "looped"
linnum=i+1
loping2=1
z=0
a=0
_tmp001:
z=z+1
a=i+z
`wait key
`print lines
`print ext$(t)
print a
if ext$(a)="lop"
print "line 59"
goto _tmp002
`EXIT HAS A BUG IN IT HERE
`endif
goto _tmp001
endif
_tmp002:
endif
if tmp$="endd" then goto ended2
if ifing=1 and tmp$="ndif"
ifing=0
endif
if tmp$="echo"
if mid$(ext$(i),5)="!"
for t=6 to len(ext$(i))
temp$=temp$+mid$(ext$(i),t)
next t
print temp$
endif
if mid$(ext$(i),5)="$"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
print strings$(tmp)
endif
if mid$(ext$(i),5)="#"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
print ints(tmp)
endif
if mid$(ext$(i),5)="%"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
print floats#(tmp)
endif
endif
if tmp$="inpt"
if mid$(ext$(i),5)="$"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
input strings$(tmp)
tmp=0
tmp2$=""
endif
if mid$(ext$(i),5)="#"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
input ints(tmp)
tmp=0
tmp2$=""
endif
if mid$(ext$(i),5)="%"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
input floats#(tmp)
tmp=0
tmp2$=""
endif
endif
if tmp$="if "
if mid$(ext$(i),5)="$"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
tmp3$=mid$(ext$(i),9)+mid$(ext$(i),10)
tmp2=val(tmp3$)
if strings$(tmp)=strings$(tmp2)
ifing=1
else
n=i
do
tmp$=""
`read string 32,tmp$
`if file end(32)=1 then exit
n=n+1
if ext$(n)="ndif"
exit
endif
loop
endif
endif
if mid$(ext$(i),5)="#"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
tmp3$=mid$(ext$(i),9)+mid$(ext$(i),10)
tmp2=val(tmp3$)
if ints(tmp)=ints(tmp2)
ifing=1
else
n=i
do
tmp$=""
`read string 32,tmp$
`if file end(32)=1 then exit
n=n+1
if ext$(n)="ndif"
i=n
exit
endif
loop
endif
endif
if mid$(ext$(i),5)="%"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
tmp3$=mid$(ext$(i),9)+mid$(ext$(i),10)
tmp2=val(tmp3$)
if floats#(tmp)=floats#(tmp2)
ifing=1
else
n=i
do
tmp$=""
`read string 32,tmp$
`if file end(32)=1 then exit
n=n+1
if ext$(n)="ndif"
exit
endif
loop
endif
endif
endif
`i=i+1
if tmp$="ifnt"
if mid$(ext$(i),5)="$"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
tmp3$=mid$(ext$(i),9)+mid$(ext$(i),10)
tmp2=val(tmp3$)
if strings$(tmp)=strings$(tmp2)
n=i
do
tmp$=""
`read string 32,tmp$
`if file end(32)=1 then exit
n=n+1
if ext$(n)="ndif"
exit
endif
loop
else
ifing=1
endif
endif
if mid$(ext$(i),5)="%"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
tmp3$=mid$(ext$(i),9)+mid$(ext$(i),10)
tmp2=val(tmp3$)
if floats#(tmp)=floats#(tmp2)
n=i
do
tmp$=""
`read string 32,tmp$
`if file end(32)=1 then exit
n=n+1
if ext$(n)="ndif"
exit
endif
loop
else
ifing=1
endif
endif
if mid$(ext$(i),5)="#"
tmp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp2$)
tmp3$=mid$(ext$(i),9)+mid$(ext$(i),10)
tmp2=val(tmp3$)
if ints(tmp)=ints(tmp2)
n=i
do
tmp$=""
`read string 32,tmp$
`if file end(32)=1 then exit
n=n+1
if ext$(n)="ndif"
exit
endif
loop
else
ifing=1
endif
endif
endif
if tmp$="eqal" `FINALLY THE CONVERT/EQUAL FUNCTION IS COMPLETE
if mid$(ext$(i),5)="$" and mid$(ext$(i),9)="!"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
temp$=""
for t=10 to len(ext$(i))
temp$=temp$+mid$(ext$(i),t)
next t
strings$(tmp)=temp$
endif
if mid$(ext$(i),5)="#" and mid$(ext$(i),9)="!"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
temp$=""
for t=10 to len(ext$(i))
temp$=temp$+mid$(ext$(i),t)
next t
tmp2=val(temp$)
ints(tmp)=tmp2
endif
if mid$(ext$(i),5)="%" and mid$(ext$(i),9)="!"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
temp$=""
for t=10 to len(ext$(i))
temp$=temp$+mid$(ext$(i),t)
next t
tmp2#=val(temp$)
floats#(tmp)=tmp2#
endif
if mid$(ext$(i),5)="$" and mid$(ext$(i),9)="$"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(tmp3$)
tmp2=val(temp$)
strings$(tmp)=strings$(tmp2)
endif
if mid$(ext$(i),5)="#" and mid$(ext$(i),9)="#"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(tmp3$)
tmp2=val(temp$)
ints(tmp)=ints(tmp2)
endif
if mid$(ext$(i),5)="%" and mid$(ext$(i),9)="%"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(tmp3$)
tmp2=val(temp$)
floats#(tmp)=floats#(tmp2)
endif
if mid$(ext$(i),5)="$" and mid$(ext$(i),9)="%"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(tmp3$)
tmp2=val(temp$)
strings$(tmp)=str$(floats#(tmp2))
endif
if mid$(ext$(i),5)="$" and mid$(ext$(i),9)="#"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(tmp3$)
tmp2=val(temp$)
strings$(tmp)=str$(ints(tmp2))
endif
if mid$(ext$(i),5)="#" and mid$(ext$(i),9)="$"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(tmp3$)
tmp2=val(temp$)
ints(tmp)=val(strings$(tmp2))
endif
if mid$(ext$(i),5)="#" and mid$(ext$(i),9)="%"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(tmp3$)
tmp2=val(temp$)
tmp3$=str$(floats#(tmp2))
ints(tmp)=val(tmp3$)
endif
if mid$(ext$(i),5)="%" and mid$(ext$(i),9)="#"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(tmp3$)
tmp2=val(temp$)
tmp3$=str$(ints(tmp2))
floats#(tmp)=val(tmp3$)
endif
if mid$(ext$(i),5)="%" and mid$(ext$(i),9)="$"
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(tmp3$)
tmp3$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(tmp3$)
tmp2=val(temp$)
floats#(tmp)=val(strings$(tmp2))
endif
endif
`NON CORE ADDONS
if dll_loader1=1 then gosub _dll_loader1
if music_lib=1 then gosub _music_lib
netx:
sync
if error=1 then exit
if i=lines+1 then exit
next i
goto ended2
`GOSUBS ENABLED THRU PREINT DIRECTIVES
_preint: `pre interpret reader
for t=2 to 64
if ext$(t)="end_preint" then exit
tmp$=""
tmp$=tmp$+mid$(ext$(t),1)
tmp$=tmp$+mid$(ext$(t),2)
tmp$=tmp$+mid$(ext$(t),3)
tmp$=tmp$+mid$(ext$(t),4)
if tmp$="ilib"
temp$=""
for z=6 to len(ext$(t))
temp$=temp$+mid$(ext$(t),z)
next z
if temp$="maths1" then maths1=1
if temp$="control1" then control1=1
if temp$="memory" then memory=1`BETA TESTIGN NOT CURRENTLY SUPPORTED
if temp$="dll_loader1" then dll_loader1=1
if temp$="text_cmds" then text_cmds=1
if temp$="input_lib1" then input_lib1=1
if temp$="input_lib2" then input_lib2=1
if temp$="system_lib1" then system_lib1=1
if temp$="file_lib1" then file_lib1=1
if temp$="file_lib2" then file_lib2=1
if temp$="basic2d" then basic2d=1
if temp$="bitmap" then bitmap=1
if temp$="basic_sound" then basic_sound=1
if temp$="extra_sound_lib" then extra_sound_lib=1
if temp$="music_lib" then music_lib=1
if temp$="sprites_lib" then sprites_lib=1
if temp$="images_lib" then images_lib=1
if temp$="animation_lib1" then animation_lib1=1
if temp$="lights_lib" then lights_lib=1
if temp$="camera_lib" then camera_lib=1
if temp$="basic3d_beta" then basic3d_beta=1`BETA TESTING NOT CURRENTLY SUPPORTED
if temp$="matrix_lib" then matrix_lib=1
if temp$="world_lib" then world_lib=1
if temp$="terrain_lib" then terrain_lib=1
if temp$="particle_lib" then particle_lib=1
if temp$="maths3d_beta" then maths3d_beta=1`BETA TESTIGN NOT CURRENTLY SUPPORTED
if temp$="memblock_main" then memblock_main=1
if temp$="memblock_conversion" then memblock_conversion=1
if temp$="directplay_lib" then directplay_lib=1
if temp$="checklist_lib" then checklist_lib=1
if temp$="other_lib1" then other_lib1=1
if temp$="nbif_lib" then nbif_lib=1
if temp$="xexplorer_api1" then xexplorer_api1=1
if temp$="var_control" then var_control=1
if temp$="constants_lib1" then constants_lib1=1
endif
next t
return
`library gosubs:
_maths1:
return
_dll_loader1:
if tmp$="dllo"
if mid$(ext$(i),5)="!"
temp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
temp2=val(temp2$)
endif
if mid$(ext$(i),5)="#"
temp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
temp3=val(temp2$)
temp2=ints(temp3)
endif
if mid$(ext$(i),9)="!"
temp4$=""
for t=10 to len(ext$(i))
temp4$=temp4$+mid$(ext$(i),t)
next i
endif
if mid$(ext$(i),5)="$"
temp2$=mid$(ext$(i),10)+mid$(ext$(i),11)
temp3=val(temp2$)
temp4$=strings$(temp3)
endif
if file exist(temp4$)=0
print "001; DLL file does not exist; line: "+str$(i) `template of error handling
error=1
exit
endif
load dll temp4$,temp2
endif
return
_music_lib:
if tmp$="delm"
if mid$(ext$(i),5)="!"
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(temp$)
else
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(temp$)
tmp=ints(tmp2)
endif
delete music tmp
endif
if tmp$="paum"
if mid$(ext$(i),5)="!"
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(temp$)
else
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(temp$)
tmp=ints(tmp2)
endif
pause music tmp
endif
if tmp$="stpm"
if mid$(ext$(i),5)="!"
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(temp$)
else
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(temp$)
tmp=ints(tmp2)
endif
stop music tmp
endif
if tmp$="resm"
if mid$(ext$(i),5)="!"
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(temp$)
else
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(temp$)
tmp=ints(tmp2)
endif
resume music tmp
endif
if tmp$="lmus"
if mid$(ext$(i),5)="!"
temp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
temp2=val(temp2$)
endif
if mid$(ext$(i),5)="#"
temp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
temp3=val(temp2$)
temp2=ints(temp3)
endif
if mid$(ext$(i),9)="!"
temp4$=""
for t=10 to len(ext$(i))
temp4$=temp4$+mid$(ext$(i),t)
next i
endif
if mid$(ext$(i),9)="$"
temp2$=mid$(ext$(i),10)+mid$(ext$(i),11)
temp3=val(temp2$)
temp4$=strings$(temp3)
endif
if file exist(temp4$)=0
print "002; Music file does not exist; line: "+str$(i) `template of error handling
error=1
goto netx
endif
load music temp4$,temp2
endif
if tmp$="plym"
if mid$(ext$(i),5)="!"
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(temp$)
else
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(temp$)
tmp=ints(tmp2)
endif
play music tmp
endif
if tmp$="muse"
if mid$(ext$(i),5)="!"
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp=val(temp$)
else
temp$=mid$(ext$(i),6)+mid$(ext$(i),7)
tmp2=val(temp$)
tmp=ints(tmp2)
endif
temp$=mid$(ext$(i),9)+mid$(ext$(i),10)
tmp2=val(temp$)
ints(tmp2)=music exist(tmp)
endif
if tmp$="stmv"
if mid$(ext$(i),5)="!"
temp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
temp4=val(temp2$)
endif
if mid$(ext$(i),5)="#"
temp2$=mid$(ext$(i),6)+mid$(ext$(i),7)
temp3=val(temp2$)
temp4=ints(temp3)
endif
if mid$(ext$(i),9)="!"
temp2$=mid$(ext$(i),10)+mid$(ext$(i),11)+mid$(ext$(i),12)
temp2=val(temp2$)
endif
if mid$(ext$(i),9)="#"
temp2$=mid$(ext$(i),10)+mid$(ext$(i),11)
temp3=val(temp2$)
temp2=ints(temp3)
endif
if music exist(temp4)=0
print "002; Music number does not exist; line: "+str$(i) `template of error handling
error=1
goto netx
endif
set music volume temp4,temp2
endif
return
ended2:
`print tmp$
endfunction
rem gosub for the logon gosub using login function and demonstrating error values
logon:
tmpn=tmpn+1
if tmpn=6
print "locked"
disable systemkeys
disable escapekey
wait 120000
end
endif
print "You must login to use this computer"
input "username: ",user$
input "password: ",pass$
stat=login(user$,pass$,safemode)
if stat=2
print "error #2"
print "wrong user or password"
print "please retry"
goto logon
endif
if stat=4
print ">>PANIC<< core has caused error"
print "error #4 result=panic"
print "invalid path name"
print "report this to your system administrator"
print "bug info=path for user is invalid user= "+encrypt(user$)
wait key
shutdown(safemode)
endif
if stat=0
print "user successfully logged on"
print "enjoy your session"
tmpn=0
cd start_path$
endif
return
rem this will get the ending such as C:foldertest.txt it will return .txt
now that is a lot of code
soon to come is my assorted.dll with functions including midi and registry
and all free and maybe even opensource
X-Patch x-patch.exe(gui):75% make.exe:5% x-patch.dll(runtime dll):0% developed on win xp home sp2