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.

DarkBASIC Discussion / Clearing World

Author
Message
white boy kyle
18
Years of Service
User Offline
Joined: 5th Feb 2007
Location:
Posted: 23rd Feb 2007 18:06
How do you clear the world? like when i do a GOTO command and go to the mainsection it says object still exist so how would i delete all the objects before i goto it..
THanks in Advanced..
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 24th Feb 2007 02:58 Edited at: 24th Feb 2007 03:03
The goto command is a throwback command from earlier basic languages.

It can cause problems with making your code harder to trace as your project grows unless you are taking extra special care with the problems layout by tracking it via a note pad or something.


The command object exist() is listed in the command index, it basically allows you to detect if an object has already been loaded or is currently active.

the if statement followed by the endif statement can be applied to this command with the delete object command

the foo variable represents your objects number




you can also apply another command to step through many models using a for/next statement




white boy kyle
18
Years of Service
User Offline
Joined: 5th Feb 2007
Location:
Posted: 26th Feb 2007 18:43
i got it to work i just used clearworld() lol
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 27th Feb 2007 00:49
clearworld()?????

What on earth are you talking about?

TDK_Man

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 27th Feb 2007 00:54
so you created a function called clearworld()?
Thats the only thing i can think of to allow that to happen.
In that function would be the aforementioned commands at least.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 27th Feb 2007 01:04
Quote: "so you created a function called clearworld()?"


Highly unlikely I think - otherwise he wouldn't have asked "How do you clear the world?" in the first post.

The chances are he's using someone else's code and can't figure out what it does.

Another example of someone jumping straight into 3D without learning the basics first. As a warning to others, this never works...

TDK_Man

Login to post a reply

Server time is: 2025-05-26 02:32:55
Your offset time is: 2025-05-26 02:32:55