Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
commons, chains, types... you know ;)
#1
ok. i have a zelda like pxp scroller with enemies, weapons, animated tiles, etc.

now, i recently revamped the engine to take up less space (using pointers), but realistically, there is no way ill ever fit all the data i need into one module. my question: how do you pass type data structures in between modules? i tried using chains, and commoning the types, but you cant do that. my plan is to build a seperate module to load all relevant data to whichever map or whatever youre on. well, i have it already, but... i just cant pass the type data back once i fill it... what gives? your help is GREATLY appreciated Smile
Reply
#2
Just put the TYPE block and any COMMON statements in an include file, and '$INCLUDE it in all the bas files.
Reply
#3
no that doesnt work ;p thats how a lot of my code is already. its still accumulaing the total code amount, because its written in when its run.. thanx tho Wink
Reply
#4
Can you clarify your question?

TYPEs cannot be passed as parameters like variables, however variables DIMmed as user defined TYPEs can be passed as parameters and shared between modules just like any other variable.
Reply
#5
I could see how my ? might be confusing... Yes, I'm trying to pass variables DIMmed as my own usertypes. When i try to set them up with a COMMON statement, I get a 'Duplicate Definiton' error. When I *don't* set them up with a common, when i come back to my program, I get a 'Subscript Out Of Range' error as soon as I try to put something in one of the user defined variable types. I absolutely cannot figure this one out ;p... crap. thanks for being patient so far with my confusing questions :bounce:

perhaps the only way to relay is thru writing to a file... well ima start that and if somethin else comes up then yeah Smile
Reply
#6
You can use COMMON SHARED and then DIM SHARED in the main module, then COMMON SHARED in each subsequent module (without the DIM SHARED, since it only needs to be done once) and you should be fine.
I'd knock on wood, but my desk is particle board.
Reply
#7
hmmm so youre saying, create the variables, switch to the othe prog, fill em, aand switch back and it should be fine??? neato!!! ill try it at once!

edit: no... still acting like the var that has the type dimmed into it doesnt exist. sigh

nuther edit: i put in some code to see if *any* arrays had vars in em. ixnay. its not passing any of my stuff. its dim shared, so i cant common share it. i dont get how to do it ;(
Reply
#8
Quote:its dim shared, so i cant common share it. i dont get how to do it ;(

First you common share, then you dim. You are doing it in the wrong order.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#9
hehehe well, obviously, otherwise youd get a 'common and declare must precede executable statements' error ;p
Reply
#10
why are you using mulitple exe's when you should be using multiple modules in the same exe?
igitalblackie.com - Done! Smile Ask about our hosting Wink

-Goddess of the of the No More Religion Threads movement Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)