|
Author
|
|
Thread
|
|
|
|
|
|
03-06-2004 00:22
Posted by:
puffin

|
can you share arrays between procedures?
i would have assumed yes since you can share strings, but when i do i get an error that highlights the size of the array and says "expected a variable"
am i doing somthing wrong?
|
|
03-06-2004 00:59
Posted by:
DanLurie
Location:
Earth>USA>New Jersey>Clifton>My Chair

|
What's your code look like?
|
|
03-06-2004 01:07
Posted by:
puffin

|
the offending part goes somthing like this:
shared int maxShots
shared int shots[maxShots]
two errors are returned the first saying maxShots isn't a variable the other saying the closing square bracket is a syntax error. i tried dimensioning the array in an initialization procedure but i still get the same problem
here is the actual procedure:
procedure testForCollisions()
'shared variables
shared int ballSprite, batSprite
shared int nMobileBlocks, maxAmmo, maxShots
shared int blockSprite[nMobileBlocks]
shared int ammoSprite[maxAmmo]
shared int shotSprite[maxShots]
shared float ballX, ballY
'local variables
int i
.
.
.
end proc
i get six errors from this.
|
|
03-06-2004 03:44
Posted by:
eekaydee
Location:
CA, USA

|
All you have to do is leave the brackets empty in the shared int line; the dimensions are retained in the array variable:
int array[10]
procedure ShareArray()
shared int array[]
end proc
|
|
03-06-2004 03:54
Posted by:
puffin

|
oh, cool. thanks
|
|
All times are GMT
|
|
|
|
|