1) Can arrays hold strings? It does not work for me do I neeed a $ after the name? That does not work either.
2) If not, can you write ints to .txt files? All it does for me is make a square thing.
3) If not, can you write more than one thing on the same line to a file? I cannot figure out how.
Any help would be appreciated, I am using DBC.
Here is the code for the project I am using it with. It is a Matrix Editor. It contains no media and I have been building it from scratch.
sync on
for g = 1 to 100
ink rgb(0,rnd(255),0),0
box rnd(25),rnd(25),rnd(25),rnd(25)
next g
get image 1,0,0,25,25
make matrix 1,100.0,100.0,10,10
prepare matrix texture 1,1,1,1
position camera 50,20,50
autocam off
make object sphere 1,5
press = 0
x=0
z=0
h = 0
do
ay# = camera angle y()
ax# = camera angle x()
if upkey()=1 and press = 0 and z < 10 then move object 1,10 ; press = 1 ; z = z + 1 ; h = get matrix height(1,x,z)
if rightkey()=1 and press = 0 and x < 10 then yrotate object 1,90 ; move object 1,10 ; press = 1 ; yrotate object 1,0 ; x = x + 1 ; h = get matrix height(1,x,z)
if leftkey()=1 and press = 0 and x > 0 then yrotate object 1,270 ; move object 1,10 ; press = 1 ; yrotate object 1,0 ; x = x - 1 ; h = get matrix height(1,x,z)
if downkey()=1 and press = 0 and z > 0 then move object 1,-10 ; press = 1 ; z = z - 1 ; h = get matrix height(1,x,z)
if spacekey()=1 and press = 0 then gosub savematrix
if inkey$()="a" then h = h + 1 ; set matrix height 1,x,z,h
if inkey$()="z" then h = h - 1 ; set matrix height 1,x,z,h
if mousex()>320 then yrotate camera wrapvalue(ay#+(mousex()-320)/50)
if mousex()<320 then yrotate camera wrapvalue(ay#-(320-mousex())/50)
if mousey()>240 then xrotate camera wrapvalue(ax#+(mousey()-320)/50)
if mousey()<240 then xrotate camera wrapvalue(ax#-(320-mousey())/50)
if mouseclick()=1 then move camera 1
if mouseclick()=2 then move camera -1
position object 1,x*10,get matrix height(1,x,z),z*10
text 0,0,str$(x)
text 0,20,str$(z)
text 0,40,str$(h)
if scancode()=0 then press = 0
update matrix 1
sync
loop
savematrix:
print "Please wait"
dim ha(10,10)
for x=0 to 10
for z=0 to 10
h = get matrix height(1,x,z)
ha(x,z) = h
next z
next x
if file exist("Matrix.txt")=1 then delete file "Matrix.txt"
open to write 1,"Matrix.txt"
for x = 0 to 10
write string 1,ha(x,0) + ha(x,1) + ha(x,2) + ha(x,3) + ha(x,4) + ha(x,5) + ha(x,6) + ha(x,7) + ha(x,8) + ha(x,9) + ha(x,10)
next x
end
return
I am trying to make the output like:
3,2,1,4
2,3,2,2
1,2,1,2
1,2,3,4
Instead of:
1,
2,
3,
6,
etc.
Once again, any help would be appreciated.
Thanks.
"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949