我正在尝试拥有一个包含数组并在某些 COM 调用中使用该类的类(我使用 C# 制作)。
所以,我有这样的课程:
DEFINE CLASS Logistics_Columns AS Session OLEPUBLIC
DIMENSION COLUMNS_ARRAY[1]
DIMENSION COLUMNS_ARRAY_COMATTRIB(4)
COLUMNS_ARRAY_COMATTRIB(1) = 0
COLUMNS_ARRAY_COMATTRIB(2) = "COLUMNS_ARRAY"
COLUMNS_ARRAY_COMATTRIB(3) = "COLUMNS_ARRAY"
COLUMNS_ARRAY_COMATTRIB(4) = "Array"
ENDDEFINE
DEFINE CLASS Logistics_Column AS Session OLEPUBLIC
COLUMN_NAME = .NULL.
DIMENSION COLUMN_NAME_COMATTRIB(4)
COLUMN_NAME_COMATTRIB(1) = 0
COLUMN_NAME_COMATTRIB(2) = "COLUMN_NAME"
COLUMN_NAME_COMATTRIB(3) = "COLUMN_NAME"
COLUMN_NAME_COMATTRIB(4) = "Character"
COLUMN_TYPE = .NULL.
DIMENSION COLUMN_TYPE_COMATTRIB(4)
COLUMN_TYPE_COMATTRIB(1) = 0
COLUMN_TYPE_COMATTRIB(2) = "COLUMN_TYPE"
COLUMN_TYPE_COMATTRIB(3) = "COLUMN_TYPE"
COLUMN_TYPE_COMATTRIB(4) = "Character"
COLUMN_WIDTH = .NULL.
DIMENSION COLUMN_WIDTH_COMATTRIB(4)
COLUMN_WIDTH_COMATTRIB(1) = 0
COLUMN_WIDTH_COMATTRIB(2) = "COLUMN_WIDTH"
COLUMN_WIDTH_COMATTRIB(3) = "COLUMN_WIDTH"
COLUMN_WIDTH_COMATTRIB(4) = "Integer"
COLUMN_PRECISION = .NULL.
DIMENSION COLUMN_PRECISION_COMATTRIB(4)
COLUMN_PRECISION_COMATTRIB(1) = 0
COLUMN_PRECISION_COMATTRIB(2) = "COLUMN_PRECISION"
COLUMN_PRECISION_COMATTRIB(3) = "COLUMN_PRECISION"
COLUMN_PRECISION_COMATTRIB(4) = "Integer"
ENDDEFINE
在 Logistics_Column 类的 C# 中, COLUMNS_ARRAY 不被视为数组。
然而,或者 Logistics_Column 类的所有 4 个属性都被正确地视为字符串或整数。
我猜“数组”(COLUMNS_ARRAY_COMATTRIB(4) = "Array"
)不是指示数组的正确文字值。
但是,那是什么?