Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing sprites and arrays through subs
#1
Alright. I know I've been asking a lot of questions but this is my last one and I've got a project due next week.

How do you pass sprites and arrays through subs? I can do it with simple types such as integers, Strings, and doubles. But that's about it. Any help?
Reply
#2
Just declare the array as a parameter, and then pass it as a normal parameter, with nothing between the ()s.

Code:
DECLARE SUB mySub (myArray () AS INTEGER)

DIM array (7) AS INTEGER

mySub array ()

SUB mySub (myArray () AS INTEGER)
   ' code and suff ...
END SUB
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
Hey wow! That's really simple. so the parameters for the sub recieving values are simply written as declarations... and the sub that passes to the recieving sub writes simply the values for those declared variables to be initialized to.

Cool :cool2:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)