Posts: 9
Threads: 5
Joined: Nov 2003
Hello everyone, i have a real quick question, i'm trying to make a game that needs seperate subs. And my question is this how do i program them in to get them to work togethor?, is there a certain Declare function i need to use or is there something else? :???:
Posts: 3,368
Threads: 195
Joined: Jan 2003
Edit: New sub/function, or just type in sub/function (name) and it will make a that new sub/function for you.
Then you want to just call a sub/function like this as an example:
Code:
DECLARE SUB blah(a%, b$)
DECLARE FUNCTION blah2%(a%, b$)
n$ = "hi"
n2$ = "bye"
blah 5, n$, (n2$)
PRINT n$; n2$
PRINT
c% = blah2%(234, "h")
PRINT c%
PRINT blah2%(234, "y")
SYSTEM
SUB blah(a%, b$, c$)
print a%, b%, b$, c$
b$ = ""
c$ = ""
END SUB
FUNCTION blah2%(a%, b$)
blah2% = a% + ASC(b$)
END FUNCTION
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Or read Vic Luce's tutorial on SUBs and functions.
...You can get them on Qbasicnews.com.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 9
Threads: 5
Joined: Nov 2003
thanks for the code example