Skip to content
梁瀚文 edited this page Sep 22, 2022 · 1 revision

Welcome to the VB6Extend wiki!

一、 ZLCustomExtend 2
1、背景 2
2.、接口列表 2
2.1、Windows 2
2.3、String 4
2.4、Log 17
2.5、Oracle 19
2.6、XML 24
2.7、Date 30
2.8、Http 30
2.9、Array 32

一、 ZLCustomExtend
1、背景
VB6.0经过长期开发本身有很多公共方法,短期内废弃vb6还存在困难,因为本身就可以做一定封装,减少代码在版本拷贝之间造成错误。后续需要增加的公共方法支持大家陆续可以提出来,研发部进行维护和版本发布,直接维护起来,后面不断完善, 更多的去思考业务。

2.、接口列表
2.1、Windows
主要涉及**.ini的配置文件读取和写入 和 电脑信息
2.1.1、INI_GetValue
Function INI_GetValue(ByVal filename As String, ByVal AppName As String, ByVal KeyName As String) As String
说明
Windows的各种*.ini配置文件获取数据值
入参 Filename:文件绝对路径 AppName:标头 KeyName:关键字
出参 String: 设置的参数值
示例 ZLCE.INI_GetValue(filename,AppName,KeyName)
2.1.2、INI_SetValue
Public Function INI_SetValue(ByVal filename As String, ByVal AppName As String, ByVal KeyName As String, ByVal Entry As String) As Boolean
说明
Windows的各种*.ini配置文件设置数据值
入参 Filename:文件绝对路径 AppName:标头 KeyName:关键字 Entry:写入数据
出参 Boolean
示例 ZLCE.INI_SetValue(filename,AppName,KeyName, Entry)
 True
2.1.3、GetComputerIP
Public Function GetComputerIP() As String
说明
WindowsIP
入参
出参 String
示例 ZLCE.GetComputerIP
=>"192.168.36.69"
2.1.4、GetComputerName
Public Function GetComputerName() As String
说明
Windows名称
入参
出参 String
示例 ZLCE.GetComputerName
=>"信息科-主任电脑"

2.1.5、SysName
说明 主要用于MessageBox的各种系统弹框

2.3、String
2.3.0、Split
Public Function Split(mStr As String, splitChar As String, Index As Integer) As String
说明
根据特定字符切割字符串, 下标从0开始
入参 String, String, Integer
出参 String
示例 ZLCE.Split(“1-2-3”, “-”, 1) => “2”
2.3.1、SplitIndex
Public Function SplitIndex(ByVal str As String, ByVal splitStr As String, ByVal index As Integer) As String
说明
以字符串切割,获取指定位置的数据,直接截取更加高效
入参 String, String, Integer
出参 String
示例 ZLCE.Split(“1-2-3”, “-”, 1) => “2”

2.3.2、Lpad
Public Function Lpad(ByVal strCode As String, lngLen As Long, Optional strChar As String = " “) As String
说明
根据特定字符对原有字符串左侧进行补全操作,默认补齐空格,可指定
入参 String, Long, String
出参 String
示例 ZLCE.Lpad(”123", 5, “0”) => “00123”

2.3.3、Rpad
Public Function Rpad(ByVal strCode As String, lngLen As Long, Optional strChar As String = " “) As String
说明
根据特定字符对原有字符串右侧进行补全操作,默认补齐空格,可指定
入参 String, Long, String
出参 String
示例 ZLCE.Rpad(”123", 5, “0”)=> “12300”

2.3.4、StrFitChar
Function StrFitChar(ByVal Str As String, ByVal IsLeft As Boolean, fixLen As Long, fixChar As String) As String
说明
根据特定字符对原有字符串进行补全操作,第二个参数进行左右补齐的控制,对Lpad Rpad 的等价方法
入参 String, Boolean, Long
出参 String
示例 ZLCE.StrFitChar(“123”, True, 5, “X”) => “XX123”
ZLCE.StrFitChar(“123”, False, 5, “X”) => “123XX”

2.3.5、Nvl
Public Function Nvl(ByVal varValue As Variant, Optional DefaultValue As Variant = "") As Variant
说明
Vb版本的Nvl
入参 Variant, Variant
出参 Variant
示例 ZLCE.Nvl(Null, “0”) => “0”

2.3.6、Trim
Public Function Trim(ByVal Str As String) As String
说明
清除两侧空格
入参 String
出参 String
示例 ZLCE.Trim(" 12 ") => “12”

2.3.7、TrimLeft
Public Function TrimLeft(ByVal mStr As String, Optional leftStr As String = " “) As String
说明
清除左侧指定字符串, 默认空格
入参 String, String
出参 String
示例 ZLCE.TrimLeft (”^12 “,”^")
 "12 "
2.3.8、TrimRight
Public Function TrimRight(ByVal mStr As String, Optional rightStr As String = " “) As String
说明
清除左侧指定字符串, 默认空格
入参 String, String
出参 String
示例 ZLCE.TrimRight(” 12^", “^”)
 " 12"
2.3.9、TrimEdge
Public Function TrimEdge(ByVal mStr As String, Optional sideStr As String = " “) As String
说明
清除两侧指定字符串, 默认空格
入参 String, String
出参 String
示例 ZLCE.TrimEdge(”^12^", “^”)
 “12”
2.3.10、Decode
Public Function Decode(ParamArray arrPar() As Variant) As Variant
说明
Vb版本的Decode
入参 Variant 奇数个数数组
出参 Variant
示例 ZLCE. Decode(Null, Null, “0”, “1”) => “0”

2.3.11、ToLower
Public Function ToLower(ByRef Expression) As String
说明
转小写
入参 Expression
出参 String
示例 ZLCE.ToLower(“Abc”) => “abc”

2.3.12、ToUpper
Public Function ToUpper(ByRef Expression) As String
说明
转大写
入参 Expression
出参 String
示例 ZLCE.ToUpper(“Abc”) => “ABC

2.3.13、ToStr
Public Function ToStr(ByRef Expression) As String
说明
表达式转字符串
入参 Expression
出参 String
示例 ZLCE.ToStr(9527) => “9527”

2.3.14、ToNum
Public Function ToNum(ByRef Expression) As Double Public Function ToNum(ByRef Expression) As Doub
说明
表达式转数字
入参 Expression
出参 Double
示例 ZLCE.ToNum(“123A”)=> 123

2.3.15、SubString
Public Function SubString(ByVal strInfor As String, ByVal lngStart As Long, ByVal lngLen As Long) As String
说明
表达式截取字符位置, 下标从0开始
入参 String, Long(下标从0开始), Long
出参 String
示例 ZLCE.SubString(“梁瀚文-HIS”, 0, 3) => “梁瀚文”

2.3.16、ReplaceParamString
Public Function ReplaceParamString(ByVal mainStr As String, ParamArray Items()) As String
说明
表达式根据1~~[N] 进行动态数组替换方法
入参 String, Items()
出参 String
示例 ZLCE.ReplaceParamString(“1-2-2-3”, “梁”, “瀚”, “文”)
 “梁-瀚-瀚-文”

2.3.17、GetXMLsByDictionary
Public Function GetXMLsByDictionary(ByVal dict As Dictionary, Optional ByVal show换行 As Boolean = True) As String
说明
根据Dictionary转为XML字符串
入参 Dictionary, Boolean
出参 String
示例 Dim dictArray1(0 To 1) As Dictionary
Dim dict_Data As New Dictionary
Dim dictArray(0 To 1) As Dictionary
Dim dict_Details As New Dictionary
Dim dict_Details_sub As New Dictionary
Dim dict_Item1 As New Dictionary
Dim dict_Item1_sub As New Dictionary
Dim dict_Item2 As New Dictionary
Dim dict_Item2_sub As New Dictionary

dict_Item1_sub.Add “ItemCode”, “9527” dict_Item1_sub.Add “ItemName”, “东坡肉” dict_Item1.Add “Item”, dict_Item1_sub dict_Item2_sub.Add “ItemCode”, “9528” dict_Item2_sub.Add “ItemName”, “西门吹雪” dict_Item2.Add “Item”, dict_Item2_sub Set dictArray(0) = dict_Item1 Set dictArray(1) = dict_Item2 dict_Details.Add “Details”, dictArray Set dictArray1(0) = dict_Details Set dictArray1(1) = dict_Details dict_Data.Add “data”, dictArray1 Dim strXML As String

strXML = GetXMLsByDictionary(dict_Data)
=>

2.3.18、GetJsonByDictionary
Public Function GetJsonByDictionary(ByVal dict As Dictionary) As String
说明
根据Dictionary转为Json字符串
入参 Dictionary
出参 String
示例 Dim arr(1 To 2) As Dictionary, arr1(1 To 1) As Dictionary, jsonStr As String
Dim dict As New Dictionary, dict1 As New Dictionary, dict2 As New Dictionary, dict3 As New Dictionary
dict3.Add “uniqueCode”, “E3”
dict3.Add “jfCode”, “j3”
dict3.Add “patientId”, 13
Set arr1(1) = dict3

dict1.Add “uniqueCode”, “E211610003001001” dict1.Add “jfCode”, “0103027601” dict1.Add “patientId”, 1021 dict2.Add “uniqueCode”, “E211610003001002” dict2.Add “jfCode”, “0103027602” dict2.Add “patientId”, arr1 Set arr(1) = dict1 Set arr(2) = dict2 dict.Add “name”, “测试” dict.Add “author”, “WSF” dict.Add “array”, arr

jsonStr = ZLCE.GetJsonByDictionary(dict)

=> jsonStr

2.3.19、GetJSONValue
Public Function GetJSONValue(ByVal JSONString As String, ByVal JSONPath As String) As Variant Public Function ToNum(ByRef Expression) As Doub
说明
获取json类型字符串的指定节点值
入参 String, String
出参 String
示例 ZLCE.GetJSONValue("{""YES"":1, ""RollBack"":""NO""}", “YES”)
=> “1”

2.3.20、strAppend
Public Function strAppend(ByRef mainStr As String, ByVal splitStr As String, ByVal appendStr As String, Optional ByVal IsCheckNull As Boolean = False, _
Optional ByVal IsTrim As Boolean = False, Optional ByVal IsSideAddSplitStr As Boolean = False, Optional ByVal checkSame As Boolean = False) As String Public Function ToNum(ByRef Expression) As Doub
说明
字符串拼接: 修改本身数据值, [原始字符串, 分隔字符串,追加字符串,检查空值,是否Trim, 是否两边增加分隔符]
入参 String,String,String, Boolean ,Boolean , Boolean ,Boolean
出参 String
示例 ZLCE.strAppend gstrIn, gSplit, CStr(Format(strSysdate, “YYYYMMDD”)), False, True
 gstrIn
2.3.21、StrContains
Public Function StrContains(mainStr As String, subStr As String, [SplitStr As String = “,”]) As Boolean Public Function ToNum(ByRef Expression) As Doub
说明
字符串是否包含另外一个字符串, 主要用于拼接的字符串是否包含另外一个字符串
入参 String,String,String
出参 Boolean
示例 ZLCE.StrContains(“123,456”, “123”, “,”)

2.4、Log
2.4.0、 Log_Set多级目录
Public Function Log_Set多级目录(str文件路径 As String) As Boolean Public Function ToNum(ByRef Expression) As Doub
说明
创建多层的文件夹目录, 需要在尾部增加\路径标识
入参 String
出参 Boolean
示例 ZLCE.Log_Set多级目录(“C:\ZLSoft\Apply\HeHe\HaHa\A123\”)

2.4.1、Log_AppendPath

Public Function Log_AppendPath(ByVal strPath As String, ByVal strAppend As String) As String Public Function ToNum(ByRef Expression) As Doub
说明
根据路径追加 节点路径,会适配前面路径的\
入参 String, String
出参 String
示例 ZLCE.Log_AppendPath(“F:\GitHub\1Study”,“数据处理平台”)
=> “F:\GitHub\1Study\数据处理平台\”

2.4.2、Log_ GetFullPath

Public Function Log_GetFullPath(ByVal strPath As String) As String Public Function ToNum(ByRef Expression) As Doub
说明
获取完整的Path路径, 适配最后的\
入参 String
出参 String
示例 ZLCE.Log_AppendPath(“F:\GitHub\1Study”)
=> “F:\GitHub\1Study\”

2.4.3、Log_Write

Public Function Log_Write(ByVal strLogPath As String, ByVal strFunc As String, Optional ByVal strInput As String = "", Optional ByVal strOutPut As String = "") As Boolean Public Function ToNum(ByRef Expression) As Doub
说明
写入日志方法, 包含路径, 方法, 入参 出参, 入参出参可选
入参 String, String, String ,String
出参 Boolean
示例 ZLCE.Log_Write(“F:\GitHub\1Study\Log\健康卡日志”,“建卡方法” , “入参XML”, “出参XML”)
 True

2.5、Oracle
2.5.1、ChkRsState

Function ChkRsState(rs As ADODB.Recordset) As Boolean Public Function ToNum(ByRef Expression) As Doub
说明
检测返回的结果集是否有效,有效为False
入参 ADODB.Recordset
出参 Boolean
示例 ZLCE.ChkRsState(rsTmp)
 True

2.5.2、CurrentDateTime

Public Function CurrentDateTime(Optional ByVal timeStyle As String = “yyyy-MM-dd HH:mm:ss”) As String Public Function ToNum(ByRef Expression) As Doub
说明
返回当前数据库的日期时间,有默认格式,可以修改
入参 String
出参 String
示例 ZLCE.CurrentDateTime
 2022-05-13 12:34:56

2.5.3、RsValue

Public Function RsValue(ByVal rs As ADODB.Recordset, field As String) As String Public Function ToNum(ByRef Expression) As Doub
说明
返回当前数据集的字段数据,为空则为空字符串函数不会报错
入参 Recordset, String
出参 String
示例 ZLCE.RsValue(RsTMP, “交易流水号”)
 “90f23f15-5680-43aa-8d6a-2b1613c58654”

2.5.4 、配置表

2.5.4.1、GetExecSQL

Public Function GetExecSQL(execKey As String, Optional fetchColumn As String = “内容”, Optional fetchTable As String = “ZLPLUGINSQL查询表”) As String Public Function ToNum(ByRef Expression) As Doub
说明
前提执行前面两个SQL, 根据ZLPluginSQL查询表的标识,获取配置的SQL内容
入参 String, String, String
出参 String
示例 ZLCE.GetExecSQL (“SPD-病人信息查询”)
 “Select 病人ID,姓名,性别,年龄,门诊号 From 病人信息 A Where A.病人ID = 1
2.5.4.2、GetPluginSetting

Public Function GetPluginSetting(ByVal execKey As String, Optional fetchColumn As String = “内容”, Optional fetchTable As String = “ZLPlugin配置表”) As String Public Function ToNum(ByRef Expression) As Doub
说明
前提执行前面两个SQL, 根据ZLPlugin配置表的标识,获取配置的内容
入参 String
出参 String
示例 ZLCE.GetExecSQL (“SPD-API-库存校验”)
 “SIP102”

2.5.5、GetCustomSetting
Public Function GetCustomSetting(ByVal tableName As String, ByVal whereColumnName As String, ByVal whereColumnValue As String, ByVal getColumn As String) As String Public Function ToNum(ByRef Expression) As Doub
说明
通过数据库的表和where条件获取字段相应的值
入参 String,String,String,String
出参 String
示例 ZLCE.GetCustomSetting(“医疗卡类别”, “ID”, CardTypeID, “是否强制退现”)
 “0”
2.5.6、Exec_DBAction
Public Function Exec_DBAction(
ByVal gcnObj As ADODB.Connection,
ByVal execPro_Name As String,
ByVal execPro_InName As String,
ByVal execPro_OutName As String,
ByVal XmlStr_In As String,
ByRef XmlStr_Out As String,
Optional execPro_OutCode As String= “Res/Code”,
Optional execPro_OutMsg As String = “Res/Msg”) As Boolean Public Function ToNum(ByRef Expression) As Doub
说明
通过数据库的过程包体 进行常规入参出参调用
入参 ADODB.Connection,String,String,String,String,ByRef String,Optional String, Optional String
出参 XmlStr_Out
示例 ZLCE.Exec_DBAction(gcnOracle, “ZLXA_银医通_Service.RetrunMoney”, “XmlStr_In”, “XmlStr_Out”, XmlStr_In, XmlStr_Out)
 True
 获取XmlStr_Out的数据
2.5.6、Exec_DBPro☑
Public Function Exec_DBPro(ByVal gcnObj As ADODB.Connection, ByVal proName As String, _
ByRef inputKeys() As String, ByRef inputValues() As String, _
ByVal outputKey As String, ByRef outputValue As String, _
Optional outCode As String = “Res/Code”, Optional outMsg As String = “Res/Msg”) As Boolean Public Function ToNum(ByRef Expression) As Doub
说明
目前最VB6.0最通用的调用存储过程的函数
入参 ADODB.Connection, proName, inputKeys(),inputValues(),outputKey , outputValue, outCode, outMsg
出参 Boolean
示例  ReturnMultiMoney = ZLCE.Exec_DBPro(gcnOracle, “ZLXA_银医通_Service.ReturnMultMoney”, proInputKeys, proInputValues, “XmlStr_Out”, XmlStr_Out) True
 获取XmlStr_Out的数据,并且返回是否成功
2.6、XML

2.6.0、XML示例
示例 Dim xmlStr As String, docXML As Object, xmlValue As String
xmlStr = “RUNOOBwww.runoob.com”
Set docXML = ZLCE.XML_GetLoadXMLObj(xmlStr)

xmlValue = ZLCE.XML_GetXMLNode(docXML, “name”) xmlValue = ZLCE.XML_GetXMLStrNode(xmlStr, “url”) xmlStr = “N1URL2” Set docXML = ZLCE.XML_GetLoadXMLObj(xmlStr) xmlValue = ZLCE.XML_GetXMLSingleNode(docXML, “root/name”) xmlValue = ZLCE.XML_GetXMLStrSingleNode(xmlStr, “root/url”)

2.6.1、XML_GetLoadXMLObj
Public Function XML_GetLoadXMLObj(ByVal strXML As String) As Object Public Function ToNum(ByRef Expression) As Doub
说明
获取DOMDocument对象,XML异常会报错
入参 String
出参 Object
示例
2.6.2、XML_GetXMLNode
Public Function XML_GetXMLNode(ByVal doc As Object, ByVal key As String) As String Public Function ToNum(ByRef Expression) As Doub
说明
根据DOMDocument对象,获取节点数据
入参 Object, String
出参 String
示例
2.6.3、XML_GetXMLSingleNode
Public Function XML_GetXMLSingleNode(ByVal xmlDoc As Object, ByVal keyPath As String) As String Public Function ToNum(ByRef Expression) As Doub
说明
根据DOMDocument对象,获取指定节点数据
入参 Object , String
出参 String
示例
2.6.4、XML_GetXMLStrNode
Public Function XML_GetXMLStrNode(ByVal strXML As String, ByVal key As String) As String Public Function ToNum(ByRef Expression) As Doub
说明
获取XML,获取指定节点数据,适合只做一个节点查询的情况
入参 String, String
出参 String
示例
2.6.5、XML_GetXMLStrSingleNode
Public Function XML_GetXMLStrSingleNode(ByVal strXML As String, ByVal keyPath As String) As String Public Function ToNum(ByRef Expression) As Doub
说明
获取XML,获取指定节点数据,适合只做指定一个节点查询的情况
入参 String, String
出参 String
示例
2.6.6、XML_SetKeyValue
Public Function XML_SetKeyValue(ByVal xmlStr As String, ByVal key As String, ByVal value As String, Optional index As Integer = 0) As String Public Function ToNum(ByRef Expression) As Doub
说明
Set XML,指定节点index数据
入参 String, String, String, Integer
出参 String
示例 strOutXml = ZLCE.XML_GetXMLNode(docXML, “HISOut”)
’修改退款交易流水号
strOutXml = ZLCE.XML_SetKeyValue(strOutXml, “TKLSH”, strSwapNo)
 返回XML 字符串数据
2.6.7、XML_GetElemnetValue
Public Function XML_GetElemnetValue(ByVal doc As Object, ByVal name As String, Optional ByVal itemIndex As Integer = 0, Optional ByVal IsOrion As Boolean = False) As String Public Function ToNum(ByRef Expression) As Doub
说明
Get XML,指定节点index数据 , 是否是原始key(否则全大写key获取)
入参 Object, String, Integer, Boolean
出参 String
2.6.8、XML_GetNodeByListIndex
Public Function XML_GetNodeByListIndex(ByVal doc As Object, ByVal ListKey As String, ByRef valueArray() As Variant, Optional subListKey As String = "", Optional idx As Integer = -1) As String Public Function ToNum(ByRef Expression) As Doub
说明
Get XML,指定节点列表下的index数据 ,获取LIST每个节点或者 子节点信息
入参 Object, String, Array, String ,Integer
出参 String
示例
Dim inputXML As String, gstrIn As String
inputXML = (“联迪扫码LDZZ0320220909101749865629705#220909110138844171#2325699_1_W0090207#3000.0#LDZZ03202209091017498656297300012236122522361225联迪扫码LDZZ03202209070810525990438” & _
“05#220907111738590867#2325699_1_W0089454#3000.0#LDZZ03202209070810525990438300012231348022313480联迪扫码LDZZ0220220905110409253316505#220905115838391657#2325699_1_W0088772#3000.0#LDZZ02202209051104092533165300012228101922281019联迪扫码LDZZ0320220902183948817959105#220902114638091159#2325699_1_W0087836#5000.0#LDZZ03202209021839488179591500012222493522224935<JS” & _
“>联迪扫码LDZZ0320220830081811458550205#220830117137648291#2325699_1_W0086208#30000.0#LDZZ0320220830081811458550219410.0312212812122128121”)
Dim xmlDoc As DOMDocument, JsArray() As Variant

Set xmlDoc = CreateObject(“MSXML2.DOMDocument”) xmlDoc.loadXML (inputXML) gstrIn = ZLCE_XMLGetXMLContentByIndex(xmlDoc, “JSLIST”, JsArray, “ZFJE”, -1)

REM 默认-1索引,不获取数据节点,只是返回数据组。如果subListKey 传空则标示,要获取每个字Node.xml数据
2.7、Date
2.7.0、DateGetUnixTimeStamp
Public Function DateGetUnixTimeStamp(ByVal strDate As String, Optional isMillis As Boolean=False) As String Public Function ToNum(ByRef Expression) As Doub
说明
获取时间戳, 不传时间或者为空,则获取当前机器时间(不推荐),建议传入, 是否是毫秒时间戳(默认秒)
入参 String, Boolean
出参 String
示例 ZLCE.DateGetUnixTimeStamp(“2022-08-31 12:34:56”, True)
 “1661920496481”

2.8、Http
2.8.0、HttpRequestType
Public Enum HttpRequestType
HttpRequestType_XML = 0
HttpRequestType_Text = 1
HttpRequestType_Body = 2
HttpRequestType_BodyText = 3
End Enum
‘网络请求方式

2.8.1、HttpRequest

Public Function HttpRequest(ByVal reqURL As String,
ByVal reqContent As String,
ByVal httpReqType As HttpRequestType,
Optional Method As String = “POST”,
Optional reqHeaderKeyValues As Dictionary = Nothing) As String Public Function ToNum(ByRef Expression) As Doub
说明
普通Http请求, URL, 请求内容, 请求获取结果方式, Method(默认POST), header的字典传参
入参 String,String, HttpRequestType, String , Dictionary
出参 String
示例 ZLCE.HttpRequest(url, “入参数据”, HttpRequestType_BodyText,”GET”,dict)
 “0调用成功”

2.9、Array
2.9.0、GetArrayByIndex

Public Function GetArrayByIndex(ByRef arr() As String, ByVal index As Integer) As String Public Function ToNum(ByRef Expression) As Doub
说明
根据index获取数组String元素数据,不会异常,只会返回空值
入参 arr() , Integer
出参 String
示例 ZLCE.GetArrayByIndex(O_Array, 8)
 “消费成功”

2.9.1、ArrayGetEntryByIndex

Public Function ArrayGetEntryByIndex(ByRef arr() As Variant, ByVal index As Integer) As Variant Public Function ToNum(ByRef Expression) As Doub
说明
根据index获取数组项目,不会异常,只会返回空值
入参 arr() , Integer
出参 Variant
示例 ZLCE. ArrayGetEntryByIndex (O_Array, 0)
 “A”

2.9.2、ArrayGetMinIndex

Public Function ArrayGetMinIndex(ByRef arr() As Variant) As Long Public Function ToNum(ByRef Expression) As Doub
说明
获取数组最小下标
入参 arr()
出参 Long
示例 ZLCE. ArrayGetMinIndex (O_Array)
 0

2.9.3、ArrayGetMaxIndex

Public Function ArrayGetMaxIndex(ByRef arr() As Variant) As Long Public Function ToNum(ByRef Expression) As Doub
说明
获取数组最大下标
入参 arr()
出参 Long
示例 ZLCE. ArrayGetMaxIndex (O_Array)
 99

2.9.4、ArrayGetCount

Public Function ArrayGetCount(ByRef arr() As Variant) As Long Public Function ToNum(ByRef Expression) As Doub
说明
获取数组元素数量
入参 arr()
出参 Long
示例 ZLCE.ArrayGetCount (O_Array)
 100

2.9.5、ArrayGetStrCount

Public Function ArrayGetStrCount(ByRef arr() As String) As Long Public Function ToNum(ByRef Expression) As Doub
说明
获取数组元素数量
入参 arr()
出参 Long
示例 ZLCE. ArrayGetStrCount(O_Array)
 100
2.9.6、ArrayInsertStrIndex

Public Function ArrayInsertStrIndex(ByRef arr() As String, ByVal str As String, Optional index As Integer = -1) As Boolean Public Function ToNum(ByRef Expression) As Doub
说明
Array 插入数据 index(不传则是放在最后, 可自定义位置)
入参 arr(), str , index
出参 Boolean
示例 Call ZLCE.ArrayInsertStrIndex(O_Array, “AA”,0)
Call ZLCE.ArrayInsertStrIndex(O_Array, “BB”,1)
 True
2.9.7、ArrayInsertIndex
Public Function ArrayInsertIndex(ByRef arr() As Variant, ByVal var As Variant, Optional index As Integer = -1) As Boolean Public Function ToNum(ByRef Expression) As Doub
说明
Array 插入数据 index(不传则是放在最后, 可自定义位置)
入参 arr(), str , index
出参 Boolean
示例 Call ZLCE.ArrayInsertIndex(v_Array, “aa”,0)
Call ZLCE. ArrayInsertIndex(v_Array, “bb”,1)
 True

2022-09-03
Version"1.0.8

Clone this wiki locally