Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Ligh
20
Years of Service
User Offline
Joined: 16th Nov 2003
Location:
Posted: 17th Nov 2003 06:55
what am i doing wrong here, i get a no such array error
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 17th Nov 2003 07:37
nothink is wrong you need to close the space in function MakeSpher()


ObjectCount = 0

print MakeSphere(1000)

end

function MakeSphere(radius)
ObjectCount = ObjectCount + 1
MAKE OBJECT SPHERE ObjectCount, radius
endfunction ObjectCount

function MakeCube(size)
ObjectCount = ObjectCount + 1
MAKE OBJECT CUBE ObjectCount, size
endfunction ObjectCount

You can do it if you try
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 17th Nov 2003 08:28
ObjectCount needs to be Global
GLOBAL OBJECTCOUNT AS INTEGER

Print Makesphere? - that shouldn't work. What are you trying to print? MakeSphere is the func name, not the return. In vb I'd say ok but in dbp I am not sure

-RUST-
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Nov 2003 09:07
Are you using DBC or DBPro?

This works with Pro ... further changes are required for DBC

Ligh
20
Years of Service
User Offline
Joined: 16th Nov 2003
Location:
Posted: 17th Nov 2003 22:01
im using dbc, i closed the space between MakeSphere and (radius) now it works, but the MakeCube doesnt, I think its cuz the ObjectCount in both functions are being local, is there a way to do GLobal variables in dbc?
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 17th Nov 2003 22:30 Edited at: 17th Nov 2003 22:30
There are no global variables in DBC. You need to use an array. Arrays are always global.




Me, I'll sit and write this love song as I all too seldom do
build a little fire this midnight. It's good to be back home with you.

Login to post a reply

Server time is: 2024-09-21 09:40:20
Your offset time is: 2024-09-21 09:40:20