Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - -s<n> set stack size in main module http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 -S<n>               Set stack size in main module
------------------------------------------------------------------------------
 Syntax
   -S<stacksize>

 Arguments
   <stacksize> is the size of the stack for the application in bytes. Its
   value must be between 128 and 65535.

 Default
   16384 bytes.

 Description
   The -S switch sets the stack size for the application. By default,
   Force defines a memory size of 16 K for the stack, which is appropriate
   for most types of applications.

   If a particular application makes extensive use of local variables
   (especially character variables) or deeply nested function and
   procedure calls, the default stack size might be too small. In such
   cases, a "Stack overflow" run-time error is likely to occur, provided
   stack checking was not turned off using the -Gs compiler option.
   In such cases the stack size must be increased using the -S option.

   On the other hand, if an application does not make extensive use of
   stack memory, the stack size may be reduced to lessen the load image
   size of the application, and free up memory for other purposes.

   The -S option only has an effect on the stack size if applied to the
   application's main module (the one containing the main() function). In
   the case of other modules, it is simply ignored by the compiler.

   The stack size of the program can be also set at link-time, e.g. using
   the -S option of FLink.

 Example
   . Set stack size to the default value of 16384 bytes.
   
     force.exe test.prg
   
   . Set stack size to 512 bytes (optimization for a small program that
     uses very little stack space).
   
     force.exe -S512 test.prg
   
   . Set stack size to 40000 bytes for a large program that uses much stack
     space (recursive calls, big local arrays, etc.).
   
     force.exe -S40000 test.prg

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson