共用方式為


SYS(3065) - Internal Program Cache

Returns the current internal program cache (PROGCACHE) setting. This setting determines the amount of memory available to run programs.

SYS(3065 [, 1])

Parameters

  • 1
    Returns the total memory of all loaded programs.

Returns

Numeric. Returns the current PROGCACHE setting specified in the configuration file. If no setting is specified, the default is returned (-2 for MTDLL, otherwise 144).

Sample

The following sample shows how you can exceed the default Visual FoxPro program cache and cause an Error 1202 to occur. If you specify a PROGCACHE=0 setting in your config.fpw file, no error occurs.

CLEAR ALL
LOCAL lcBigStr,lcSafe
ON KEY LABEL F5 ? SYS(3065)+" "+SYS(3065,1)
? SYS(3065)+" "+SYS(3065,1)
SET TEXTMERGE ON NOSHOW
SET TEXTMERGE TO MEMVAR lcBigStr
      FOR i = 1 TO 39000
\           x="<<REPLICATE('a ',120)>>"
      ENDFOR     
SET TEXTMERGE to
? LEN(lcBigStr)
lcSafe=SET("Safety")
SET SAFETY OFF
STRTOFILE(lcBigStr,"bigprg.prg")
SET SAFETY &lcSafe
COMPILE bigprg
DO bigprg
? SYS(3065)+" "+SYS(3065,1)
ON KEY LABEL F5

See Also

Reference

Special Terms for Configuration Files
Program is too large (Error 1202)