home *** CD-ROM | disk | FTP | other *** search
- @1
- C O D E C l i n i c
- @3 Hosted by the code king, Lee Bamber
- -----------------------------------
- (Don't you just hate this guy?)
- @1
- CC> Righty, last month was rather challenging, so what's wrong this issue?
- @2
- PP> The thing is, I want to run another program from a program using the
- RUN 'filename' command. I have a main program which has the run command
- in, to run the other program, however when this program is executed I
- get a OUT OF MEMORY error statement. So how can I get it so when I run
- my main program and that then gets to the RUN 'filename' command the
- program that is called to RUN, how can I get that program to replace my
- main program thus saving memory!! PLEASE HELP ME !!!!!!!!!!!!!!!!!!!!!!
- @3
- AA> Er, in a sentence. You want to execute a second program at some point
- in the first program, using the RUN command. The problem is when you
- get to the RUN command, it says 'OUT OF MEMORY'.
-
- I don't have much to go on, do I. According to form, you shouldn't have
- a problem. This method of 'chaining' is very common practice in Amos
- and any errors would occur due to something other than the RUN command
- itself. If your dealing with uncompiled source, your programs should
- both be .AMOS files. It is important to remember all the banks and
- screen data are retained for the new program.
-
- When you RUN the second program, the first program is automatically
- erased to make space for the second. Admittedly, a small amount of
- extra memory will be required for the transfer of code, but not enough
- to prompt an OUT OF MEMORY error.
-
- Without knowing what computer you have, how much memory you have and
- what version of Amos you own, the task of solving your problem is not
- easy. But that's half the fun, from my side of things.
-
- Have tried an example program to see what happens in regard to your
- problem, and found the program that is RUN sets the text buffer to its
- own size. Subsequently, each RUN command creates just enough space
- and saves memory. This too, is automatic.
-
- I can't simulate an OUT OF MEMORY error on my system, and I therefore
- cannot recommend a solution. What I can do is ask you to check your
- programs for high memory use, for this is the typical problem for the
- OUT OF MEMORY error. Just in case you are doing something fundamentally
- wrong, I've supplied a simple program which runs a second program. If
- you supply me with more information, I might be able to assist, where
- as it stands, your problem is, for the moment, a code clinic mystery.
- @1
- CC> Well, I'm done here. Any other problems can be sent to my address below
- and I'll answer them in these pages. Further, anyone who gets their
- problem directed to me via one of the AZ editors, will also suffer the
- agony of my correspondence.
-
- To increase the chances of a detailed and satisfactory solution, please
- state MACHINE TYPE eg. A500, A1200, etc
- PERIPHERALS eg. PRORAM, PC1208, (any extra ram), etc
- AMOS VERSION eg. Amos Classic, Amos Pro, Easy Amos, etc
-
- ADDRESS: Lee Bamber,
- Dept. AZCC.
- 'Rockville',
- Warrington Road,
- Lower Ince,
- Wigan,
- Lancashire,
- WN3 4QG.
-
- As per usual, any correspondence will be replied to and I'll even put
- in one of my prized Info Sheets! Now how's that for nicey-ness-ness?
-