广告广告
  加入我的最爱 设为首页 风格修改
首页 首尾
 手机版   订阅   地图  繁体 
您是第 11312 个阅读者
 
发表文章 发表投票 回覆文章
  可列印版   加为IE收藏   收藏主题   上一主题 | 下一主题   
ziele 手机
个人文章 个人相簿 个人日记 个人地图
初露锋芒
级别: 初露锋芒 该用户目前不上站
推文 x1 鲜花 x32
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片
推文 x0
[.Net][求助] 从vb6到vb.net type (Structure)要如何写??
想要把vb6写的程式改到vb.net 可是会出错下面的错误

Public Const c1 = 255
Public Const c2 = 255
Public Const c3 = 15

Public sss(0 To c1) As sta

Structure ppp
Dim X As Integer
Dim Y As Integer
Dim Alarm As String
Dim Gif As String
End Structure

Structure hhh
Dim H_Addr As String
Dim H_Name As String
Dim H_Memo As String
Dim H_Pic As String
Dim H_Mobile As String
Dim H_Mail As String
<VBFixedArray(c3)> Dim Point() As ppp

Public Sub Initialize()
R ..

访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容




献花 x0 回到顶端 [楼 主] From:台湾台北市 | Posted:2009-02-26 21:56 |
Lenki
数位造型
个人文章 个人相簿 个人日记 个人地图
小人物
级别: 小人物 该用户目前不上站
推文 x0 鲜花 x10
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

在 VB.NET 里的 Structure 并没有办法使用 Initialize() 来初始设定,
若一定要使用类似 Initialize的方式,请宣告成类别。

使用Structure则可以如下面的方式初始阵列:
Public Const c1 = 255
Public Const c2 = 255
Public Const c3 = 15

Structure ppp
  记得将 dim 改public
  public X As Integer
End Structure

Structure hhh
  public Point() As ppp
End Structure

Structure sta
  Public Home() As hhh
End Structure

  Public Sub InitRegData()
  初始化阵列大小
  dim sss(c1) as sta
  for i as integer=0 to c1
    redim sss(i).Home(c2)
    for j as integer=0 to c2
    redim sss(i).Home(j).Point(c3)
    next
  next
  初始化阵列大小完成
  下面再接你要处理、执行的程式码……
  ……
  ……

  End Sub


献花 x0 回到顶端 [1 楼] From:台湾中华 | Posted:2009-03-29 02:14 |

首页  发表文章 发表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.019607 second(s),query:16 Gzip disabled
本站由 瀛睿律师事务所 担任常年法律顾问 | 免责声明 | 本网站已依台湾网站内容分级规定处理 | 连络我们 | 访客留言