define class 定义类 ?
个性太多,无法显示
CLEAR ALL CLEAR DECLARE GetSystemInfo IN WIN32API String @ cBuffer = SPACE(40) GetSystemInfo(@cBuffer) SystemInfo = CREATEOBJECT("_SystemInfo", @cBuffer) ? "处理器类型: " + TRANSFORM(SystemInfo.ProcessorType) ? "处理器个数: " + TRANSFORM(SystemInfo.NumberOfProcessors) ? "处理器架构: " + SystemInfo.ProcessorArchitecture ? "内存页大小: " + TRANSFORM(SystemInfo.PageSize) ? "可用内存起始地址: " + TRANSFORM(SystemInfo.MinimumApplicationAddress) ? "可用内存结束地址: " + TRANSFORM(SystemInfo.MaximumApplicationAddress) RETURN DEFINE CLASS _SystemInfo AS Custom OemID = SPACE(4) ProcessorArchitecture = "" PageSize = 0 MinimumApplicationAddress = 0 MaximumApplicationAddress = 0 ActiveProcessorMask = SPACE(4) NumberOfProcessors = 0 ProcessorType = 0 AllocationGranularity = SPACE(4) ProcessorLevel = SPACE(2) ProcessorRevision = SPACE(2) PROCEDURE Init(tcString) WITH This .NumberOfProcessors = CTOBIN(SUBSTR(tcString, 21, 4), "4RS") .ProcessorType = CTOBIN(SUBSTR(tcString, 25, 4), "4RS") LOCAL lnTemp lnTemp = CTOBIN(SUBSTR(tcString, 7, 2), "2RS") DO CASE CASE lnTemp == 0 .ProcessorArchitecture = "INTEL" CASE lnTemp == 6 .ProcessorArchitecture == "IA64" CASE lnTemp == 9 .ProcessorArchitecture = "AMD64" otherwise .ProcessorArchitecture = "UNKNOWN" ENDCASE .PageSize = CTOBIN(SUBSTR(tcString, 9, 4), "4RS") .MinimumApplicationAddress = CTOBIN(SUBSTR(tcString, 13, 4), "4RS") .MaximumApplicationAddress = CTOBIN(SUBSTR(tcString, 17, 4), "4RS") ENDWITH ENDPROC ENDDEFINE