数组 – 如何获取const数组的类型和值?
发布时间:2020-12-15 04:08:49 所属栏目:大数据 来源:网络整理
导读:在我的Delphi开发中, 我想将一个“const数组”(也可以包含类)传递给一个过程,并在过程循环中传递元素并检测元素的类型如下所示. Procedure Test(const Args : array of const);beginend;and in my code call it with some variablesProcedure Test();begin c
在我的Delphi开发中,
我想将一个“const数组”(也可以包含类)传递给一个过程,并在过程循环中传递元素并检测元素的类型如下所示. Procedure Test(const Args : array of const); begin end; and in my code call it with some variables Procedure Test(); begin cls := TMyObject.create; i := 123; j := 'book'; l := False; Test([i,j,l,cls,37.8]) end; 如何循环发送的数组元素并检测它的类型? 解决方法for I := Low(Args) to High(Args) do case TVarRec(Args[I]).VType of vtInteger: ... end; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |