Subscript must be Integer or DWORD when referencing an array at line 67.
Rem Project: Dark Basic Pro Project
Rem Created: Monday, September 12, 2011
Rem ***** Main Source File *****
` Make background text color show
set text opaque
` Create the UDT for colors
type Col
Fore as dword
Back as dword
endtype
` Dimensionalize the array
dim Color(19) as Col
` Define all background colors
for t=0 to 19
Color(t).Back=rgb(0,0,150)
next t
` Define the colors
Color(0).Fore=rgb(80,80,80) ` Debug Text Color
Color(1).Fore=rgb(0,0,0) ` Status Line Foreground Color
Color(1).Back=rgb(150,150,150) ` Status Line Background Color
Color(2).Fore=rgb(255,255,255) ` Begining Text Color
Color(3).Fore=rgb(0,255,0) ` Room Name Color
Color(4).Fore=rgb(255,255,255) ` Room Description Color
Color(5).Fore=rgb(45,132,238) ` Item Color
Color(6).Fore=rgb(192,102,203) ` Inventory Color
Color(7).Fore=rgb(255,255,0) ` Get Text Symbol >
Color(8).Fore=rgb(255,0,255) ` Command Color
Color(9).Fore=rgb(0,255,0) ` Get Text Prompt \|/
Color(10).Fore=rgb(150,150,150) ` Normal Text Color
Color(11).Fore=rgb(100,100,0) ` Color of ()'s for producing light
Color(12).Fore=rgb(255,255,0) ` Color of producing light ()'s in item list
Color(13).Fore=rgb(93,47,3) ` Color of ()'s for producing light
Color(14).Fore=rgb(157,77,5) ` Color of open and close in item list
Color(15).Fore=rgb(255,128,64) ` Color of L and D in Loading Data...
Color(16).Fore=rgb(213,69,0) ` Color of oading in Loading Data...
Color(17).Fore=rgb(80,80,80) ` Color of ... in Loading Data...
cls Color(0).Back
ColorText(0,0,"|03|Library")
ColorText(0,15,"|04|It's an amazingly |10|large |04|room with countless shelves full of books in every")
ColorText(0,30,"|04|subject known to Earthlings.")
ColorText(0,45,"|05|On the floor is a Diga-mark.")
ColorText(0,75,"|07|> |08|TAKE ALL")
ColorText(0,90,"|10|Diga-mark: Taken")
ColorText(0,120,"|07|> ")
wait key
end
` Function to Color Text ColorText(x coordinate, y coordinate, Text to color)
function ColorText(x,y,Tex$)
for t=1 to len(Tex$)
` Get the character
a$=mid$(Tex$,t)
` Check for color marker
if a$="|"
` Grab the color (two digits) (IanM's MID$() command)
Color=val(Mids$(Tex$,t+1,t+2))
` Change the color
ink Color(Color).Fore,Color(Color).Back
` Advance t so it skips over the |xx|
inc t,3
else
` Show the character
text x,y,a$
` Move x over for the next character
inc x,text width(a$)
endif
next t
` Reset the color
ink Color(2).Fore,Color(2).Back
endfunction
` True basic mid$ command
function Mids(t$,a,b)
a$=left$(right$(t$,len(t$)-a+1),b)
endfunction a$
CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !