Caché5的类较Caché4增加了一些新特性,所以要把Caché5的类导入到Caché4中需要注意以下的内容:
(以下内容来自Caché的帮助文件)
原文:
Exporting Class Definitions for Version 4.x
There are a number of new features in the version 5 object model that are not present in version 4. If you export a CDL file from version 5, by default it may not load on a version 4 system.
If you need to use classes defined on version 5 on version 4, use the $System.OBJ.ExportCDL method (see the %SYSTEM.OBJ class) from the Caché command line and specify a “4” option in the list of flags. If the “4” flag is present then the CDL will not contain any syntax incompatible with a version 4.x system.
Note:
ExportCDL adds comments to the exported CDL file if any incompatible features (such as PROCEDUREBLOCK/WEBMETHOD) are present in the exported classes. ExportCDL does not check for super classes or types not present on a 4.x system nor does it check for LANGUAGE values.
翻译:
导出类定义为Caché4.x版本
Caché5的对象模型增加了一些Caché4中没有的新特性,如果使用缺省设置导出Caché5的类,是不能被导入到Caché4中的。
如果需要在Caché4中使用由Caché5定义的类,在Terminal下使用$System.OBJ.ExportCDL命令(在$System.OBJ类中),并指定标志为4,导出的CDL文件会去除所有与Caché4不兼容的语法内容。
注意:
在上述导出的CDL文件中,ExportCDL命令会加上注释;ExportCDL命令不会检查在Caché4.x这没有的父类或者父类型,也不会检查LANGUAGE的值(这个不知道指的是什么)。
注释示例:
// WARNING! Cache Version 4 CDL doesn't support procedureblock. Please review
例子:w $System.OBJ.ExportCDL("FullClassName","d:/class.cdl","4")
(注意:在4中,必须把CDL文件放在数据库本地才能导入)