Qbasicnews.com
May 26, 2020, 06:10:12 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: commons, chains, types... you know ;)  (Read 3194 times)
Anonymous
Guest
« on: January 10, 2004, 09:32:01 PM »

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 Smiley
Logged
Sterling Christensen
Na_th_an
*****
Posts: 1328


« Reply #1 on: January 10, 2004, 11:07:49 PM »

Just put the TYPE block and any COMMON statements in an include file, and '$INCLUDE it in all the bas files.
Logged
Anonymous
Guest
« Reply #2 on: January 10, 2004, 11:23:41 PM »

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
Logged
Sterling Christensen
Na_th_an
*****
Posts: 1328


« Reply #3 on: January 11, 2004, 12:34:53 AM »

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.
Logged
Anonymous
Guest
« Reply #4 on: January 11, 2004, 09:28:43 AM »

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 Smiley
Logged
adosorken
*/-\*
*****
Posts: 3655



WWW
« Reply #5 on: January 11, 2004, 05:18:14 PM »

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.
Logged

I'd knock on wood, but my desk is particle board.
Anonymous
Guest
« Reply #6 on: January 11, 2004, 07:30:59 PM »

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 ;(
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #7 on: January 11, 2004, 07:51:37 PM »

Quote from: "Cha0s"
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.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Anonymous
Guest
« Reply #8 on: January 11, 2004, 07:58:53 PM »

hehehe well, obviously, otherwise youd get a 'common and declare must precede executable statements' error ;p
Logged
Rhiannon
Been there, done that
*****
Posts: 1031



WWW
« Reply #9 on: January 11, 2004, 08:00:38 PM »

why are you using mulitple exe's when you should be using multiple modules in the same exe?
Logged

igitalblackie.com - Done! Smiley Ask about our hosting Wink

-Goddess of the of the No More Religion Threads movement Smiley
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #10 on: January 11, 2004, 08:11:10 PM »

Quote from: "Cha0s"
hehehe well, obviously, otherwise youd get a 'common and declare must precede executable statements' error ;p


Not so obvious. You said:

Quote
its dim shared, so i cant common share it.


So make up your mind before posting "obviously".

Anyhow, if you are using multiple EXEs, dump all your data to a temp file, and open it in the next EXE to be executed.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Anonymous
Guest
« Reply #11 on: January 11, 2004, 08:17:52 PM »

yayyyyyyy im the only stupid a-hole that thought different modules were seperate exes ;p *crawls away to noobie hideout*


btw rhia you are a goddess Cheesy
Logged
Rhiannon
Been there, done that
*****
Posts: 1031



WWW
« Reply #12 on: January 11, 2004, 10:05:43 PM »

Quote from: "Cha0s"
yayyyyyyy im the only stupid a-hole that thought different modules were seperate exes ;p *crawls away to noobie hideout*


btw rhia you are a goddess Cheesy


lol *takes a bow*
Logged

igitalblackie.com - Done! Smiley Ask about our hosting Wink

-Goddess of the of the No More Religion Threads movement Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!