vbdpss.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Article Q40188, Example 1
                                                 Contents  Index  Back
─────────────────────────────────────────────────────────────────────────────
                           Knowledge Base Contents  Knowledge Base Index
 
 FRE(-2) Returns Fixed Lowest Value Even After Stack Shrinks, Example 1
 
 Example 1
 ---------
 
 The following code example demonstrates a case in which FRE(-2) goes
 down and stays down:
 
 ' To try this example in VBDOS.EXE:
 ' 1. From the File menu, choose New Project.
 ' 2. Copy the code example to the Code window.
 ' 3. Press F5 to run the program.
 
    DECLARE SUB test (num)
    CLS
    PRINT "Before any calls, FRE(-2):"; FRE(-2)
    CALL test(0)
    END
    SUB test (num)
      PRINT "Call number"; num; "on the way DOWN, FRE(-2):"; FRE(-2)
      IF num < 9 THEN
        CALL test(num + 1)
      ELSE
        PRINT "Bottom of recursion reached."
      END IF
      PRINT "Call number"; num; "on the way UP, FRE(-2):"; FRE(-2)
    END SUB