Problems with common share arrays, spries?
Problems with common share arrays, spries?
(OP)
hello. I am making a prog with modules. I am using a library to make this prog.(Rellib) anyways i am having problems common sharing arrays, and sprites and stuff. My pc always restarts when i load a sub that is not in the main module. does anyone know how to remedy this problem.
RE: Problems with common share arrays, spries?
RE: Problems with common share arrays, spries?
----start here------
declare Sub Sub1 ()
declare Sub Sub2 ()
MainModule
DEFINT A-Z
'$STATIC
'$DYNAMIC
'$INCLUDE: 'RelLib.Bi'
common shared BUFFER(31999) AS INTEGER, layer AS INTEGER
layer = VARSEG(BUFFER(0))
common shared sprite(202)
screen 13
RelinitVGA13
(lets say i got my 20x20 sprites)
Relget layer,x1,x2,y1,y2,varseg(sprite(i*202)),varptr(sprite(i*202))
(my code and subs)
bleh
call Sub1
bleh
bleh
call Sub2
sub sub1 ()
some code
end sub
Module2
Sub2
SubModule1
Declare sub sub2
DEFINT A-Z
'$STATIC
'$DYNAMIC
'$INCLUDE: 'RelLib.Bi'
common shared BUFFER(31999) AS INTEGER, layer AS INTEGER
layer = VARSEG(BUFFER(0))
common shared sprite(202)
screen 13
RelinitVGA13
sub sub2()
more code
end sub
The common shared parts would give me a common shared error and sometimes the array, or when it does compile and work the pc restarts when i hit the sub2 bit of the prog.
RE: Problems with common share arrays, spries?
RelSprite layer, 0,0,varseg(sprite(0)),varptr(sprite(0))
relpcopy video, layer 'shows the stuff.
RE: Problems with common share arrays, spries?
common shared BUFFER(31999) AS INTEGER, layer AS INTEGER
layer = VARSEG(BUFFER(0))
common shared sprite(202)
I think it should be...
common shared BUFFER(31999) AS INTEGER, layer AS INTEGER
common shared sprite(202)
layer = VARSEG(BUFFER(0))
As far as I remember... All definitions with the exception of REDIM should apear before any commands are executed...
Good Luck...
Have Fun, Be Young... Code BASIC

-Josh
http://cubee.topcities.com
RE: Problems with common share arrays, spries?
so I'm not sure... but it is worth a try...
Have Fun, Be Young... Code BASIC

-Josh
http://cubee.topcities.com
RE: Problems with common share arrays, spries?
Ill try some suggestions.