最新消息:关注【已取消】微信公众号,可以获取全套资料,【全套Java基础27天】【JavaEE就业视频4个月】【Android就业视频4个月】

VB.NET结构体的定义方法

C#/VB.NET 太平洋学习网 0浏览 评论

在VB.NET中定义结构体就用Structure关键字,那么该如何使用Structure定义VB结构体呢,请看如下代码,成员属性要用Dim来修饰:

Public Structure INITTBL
    Dim speed As Long
    Dim length As Long
    Dim parity As Long
    Dim sbit As Long
    Dim ptout As Long
    Dim ctout As Long
    Dim stopkey1 As Long
    Dim stopkey2 As Long
    Dim cretry As Long
End Structure

如何使用VB.NET结构体呢?只要在需要使用的地方如下定义并初始化即可,如下:

Dim tab As INITTBL
tab.speed = 4
tab.length = 0
tab.parity = 0
tab.sbit = 1
tab.ptout = 100
tab.ctout = 1000
tab.stopkey1 = 0
tab.stopkey2 = 0
tab.cretry = 99

VB结构体很常用,所以必须得知道怎么使用它。

来源网站:太平洋学习网,转载请注明出处:http://www.tpyyes.com/a/csharp/698.html
"文章很值,打赏犒劳作者一下"
微信号: Javaweb_engineer

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

与本文相关的文章

发表我的评论
取消评论

表情

您的回复是我们的动力!

  • 昵称 (必填)

网友最新评论