No announcement yet.

SHELL commands

  • Filter
  • Time
  • Show
Clear All
new posts

  • SHELL commands

    Since SHELL loads a second copy of the Dos command processor
    temporarily to execute a command/program from Dos, and then
    return to the program that contained the SHELL command, I am
    beginning to be concerned my programs will run out of memory
    before finishing.

    I write tiny program (easier to debug, and usually less than
    35K), some of my "main" programs will have 100s of SHELL
    commands. Is there a more efficient way to do this? I have not
    found a method to determine how much memory my programs
    eventually need.

    Thank you.

    Robert Carneal


  • #2
    Originally posted by Robert Carneal:
    I have not found a method to determine how much memory my
    programs eventually need.
    FRE(-1) tells you how much memory you have available for data
    and other stuff. Example:

    row = csrlin : col = pos(0)
    locate 25,1
    locate row,col

    Check the help file for other uses of FRE().

    In as far as "100's" of shells, it all depends on the size of
    the files and how much data they generate. One possibility you
    may want to try: Instead of one big MAILFILE.EXE, try chopping
    it up and CHAIN each file on an as-needed basis.


    [This message has been edited by Mel Bishop (edited April 20, 2003).]
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.


    • #3
      Another solution would be to stick with the SHELL methodology, and use UltraShell from - you include a small INC file and after compiling to an EXE, run a utility that patches the executable. Once the app runs, the SHELL statement swaps out all but about 5kb of conventional memory to EMS/XMS or a disk file, leaving almost the entire conventional memory area available for the SHELLed app. On return, memory is reloaded, and the original app continues along where it left of.

      Very smooth. It would have to be the best library/utility I ever invested in for PB/DOS development.

      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      mailto:[email protected]