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.

Newcomers DBPro Corner / Hate to ask, but...

Author
Message
CrayZXP
17
Years of Service
User Offline
Joined: 1st Dec 2006
Location: Obviously not behind you...
Posted: 4th Sep 2007 19:40
How exactly does a script work? How is one loaded in DBP? Does anyone have any small examples? I've used the search option BTW.
I'm confused... please help...

No Common Sense for the Common Things!!!
dark donkey
18
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 4th Sep 2007 20:04
Say i have two files one is empty and one has the fuction:

Print "Example"

And i call that fuction EXAMPLE()

Now in the empty one write
#Include "Were ever the other file is"

EXAMPLE()

now you will see the program is using the fuction from the other code file.

Hope this helped
CrayZXP
17
Years of Service
User Offline
Joined: 1st Dec 2006
Location: Obviously not behind you...
Posted: 4th Sep 2007 20:17 Edited at: 4th Sep 2007 20:18
Just saw an example that explains what I'm talking about.


Does this involve a lot of "READ" commands?

Edit:
BTW it's an external file...

No Common Sense for the Common Things!!!
dark donkey
18
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 4th Sep 2007 20:36
I dont realy get you again. I think you mean how do i load a variable into my program. Im no expert with this bit i can tell you this:

Using open to write and open to read you can open a file to write or to open. I think tehre is another comand to get a variable out of the comand but im not sure.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Sep 2007 22:54
That looks like Lua. It's not made in DBP, so you dont have to worry about how it works really. But basically, it involves reading it all line by line, splitting it up into little chunks, called "tokens", that being compiled to very simplified code called "bytecode", and that code being interpreted by a "virtual machine".

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
CrayZXP
17
Years of Service
User Offline
Joined: 1st Dec 2006
Location: Obviously not behind you...
Posted: 4th Sep 2007 23:30
Should I get Unity? I'm guessing that I could run my programs faster with it.

No Common Sense for the Common Things!!!
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Sep 2007 23:43
Get Unity, or Barnski's, which is free. Either-or.

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers

Login to post a reply

Server time is: 2024-09-27 05:07:36
Your offset time is: 2024-09-27 05:07:36