Sys(1011)
This function has actually been around for a while, but it's finally documented (albeit in not much detail) in the VFP 7 help file. It tells you how many memory handles are in use.
Usage |
nHandles = SYS( 1011 ) |
SYS(1011) doesn't appear in the list of SYS() functions that IntelliSense displays when you type the opening parenthesis following "SYS". |
Example |
? SYS(1011) && Displays 1298, 1302, 1308, and 1316 on consecutive runs oTest1 = CREATEOBJECT('Test') ? SYS(1011) && Displays 1300, 1303, 1311, 1319 oTest2 = CREATEOBJECT('Test') ? SYS(1011) && Displays 1303, 1306, 1314, 1322 oTest1.oRef = oTest2 * Comment out the next line and run again to see the memory * leak disappear. oTest2.oRef = oTest1 ? SYS(1011) && displays 1305, 1308, 1316, 1324 DEFINE CLASS Test AS CUSTOM oRef = .NULL. ENDDEFINE |
See Also |