Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with Subs
#1
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? :???:
Reply
#2
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.
Reply
#3
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.
Reply
#4
thanks for the code example
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)