标题:新人求帮助!Array()函数问题
取消只看楼主
suzhanpeng82
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2016-9-28
结帖率:0
已结贴  问题点数:20 回复次数:1 
新人求帮助!Array()函数问题
config.ini文件内容
[Form2]
CaiLiao="默认", "焊接件", "装配件", "45", "Q235A", "65Mn", "40Cr", "ZQA19-4", "ZQSn10-1", "QT600-3", "HT300"

程序如下 想在comcobox中下拉列表中显示
Dim F As String, nStr As String, nSize As Long, S As Long
   F = App.Path & "\config.ini"
   nSize = 255: nStr = String(nSize, 0)
   d = GetPrivateProfileString("Form2", "CaiLiao", vbNullString, nStr, nSize, F)
   S = InStr(nStr, Chr(0))
   If S > 0 Then
   nStr = Left(nStr, S)
   End If
Dim c As Variant
Dim i As Integer
       c = Array(nStr)
        For i = 0 To UBound(c)
           Combo2.AddItem c(i)
        Next
其结果是内容没有分开,求说明错误原因。

[此贴子已经被作者于2016-9-28 15:59编辑过]

2016-09-28 15:47
suzhanpeng82
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2016-9-28
得分:0 
没人知道原因吗!
只好用split()函数了
2016-09-28 16:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-469291-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.254116 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved