以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://weistock.com/bbs/list.asp?boardid=2)
----  VBA使用问题  (http://weistock.com/bbs/dispbbs.asp?boardid=2&id=87740)

--  作者:fengxiaoyong
--  发布时间:2015/11/26 0:36:39
--  VBA使用问题
 Sub Test()

Dim d \'创建一个变量
\'创建Mpp外部对象,将对象实例置变量d中
Set d = CreateObject("Stock.MapValue")

\'创建完Map对象后往其内部插入3个数据
call d.SetKey("1",123.5)
call d.SetKey("3","你好")
call d.SetKey("2",1000)

\'依次遍历键数据并打印下来
Dim KeyVal
Dim DataVal
For I = 0 to d.Count-1
Result = d.GetAt(i,KeyVal,DataVal)
If result = 1 Then
Application.MsgOut KeyVal&":"&DataVal
End IF
Next

set d = nothing
End Sub
直接使用该代码进行测试,执行完毕后,金字塔就异常退出
--  作者:马良
--  发布时间:2015/11/26 8:11:09
--  
哪个版本金字塔?32位还是64位