Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having a program in a program?
#1
Hey guys, I was wondering if it would be possible to have a program within a program... or something. Now, understand, I know what a SUB is. I am running into problems with space in my RPG and there are repetitive processes that have to be... well, repeated. I was wondering if it is possible to have all this repetitive code in a notepad file or something along those lines and when the QB program needs the information it can just read it off the notepad? Any help on this problem would be greatly appreciated. Thanks!

-Nova
ovaProgramming.

One night I had a dream where I was breaking balls. The next morning, BALLSBREAKER was born.

Quote: Excellent. Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Reply
#2
To do that you'll have to have a very advanced file parser which would take up more space than the code most likely.
am an asshole. Get used to it.
Reply
#3
just try to use subs as much as possible......
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#4
you mean like a module? yeah.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#5
Quote:To do that you'll have to have a very advanced file parser which would take up more space than the code most likely.

. well I don't axactly know how to do it in qb,. there is a way
but it requiers you to understand ASM and be able to create
your own files-> binary executables.
after all that its pretty simple,
*allocate some ram
*load file into the allocated space
*get pointer to the beginning of the ram space or the place you want to execute from
*jump to that address ,
remeber that you will have to somehow recalculate every position of your labels.
You can probably just add the pointer of the ram space to each jump address.
This is very important if you have loops or sertain jumps
in your "stripped-out" code

but by closer thought he is probably referring to modules Tongue

Scorp.
Reply
#6
Nova, send me an email at jasmydae@hotmail.com and I'll help you out on your RPG. I can almost guarantee that you're doing pretty much the same exact things as I did when I was writing my BBS door game. Also, get your source code online somewhere that I could d/l it.

(or just attach it to the email)

*peace*

Meg.
Reply
#7
Okay, essentially all that I want to be able to do is have all this stuff in a notepad file. When inside the QB module, I want to be able to open that and use it inside qbasic, but it won't take up space in the main module. I am running into walls because I am taking up too much space with my programs......
ovaProgramming.

One night I had a dream where I was breaking balls. The next morning, BALLSBREAKER was born.

Quote: Excellent. Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Reply
#8
Notepad just edits text files. The file itself doesn't have any relationship to notepad. But if you're trying to store executable code in a file, notepad might not be the right utility to create that file. But even if you figure out a way to do what you seem to be saying you want to do, you aren't going to be saving yourself any memory. You seem to be wanting to do what SHELL already does. The memory and data spaces used by your "parent program" are still going to be unavailable to your "child process."
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#9
there are better ways to cut back on the space/memory your program is using. zip an email over to me with your program and i'll help you out. the offer still stands Smile

*peace*

Meg.
Reply
#10
Quote:Okay, essentially all that I want to be able to do is have all this stuff in a notepad file. When inside the QB module, I want to be able to open that and use it inside qbasic, but it won't take up space in the main module. I am running into walls because I am taking up too much space with my programs......

Naaaaah, just learn to split your code into several modules and your "too much space with my programs" problem will dilute as salt in water.

Refer to Nate's Tutorial Pushing the Limits of QB for some insightful words. [Image: naughty.gif]
img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)