加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

VB6中变量声明中的星号

发布时间:2020-12-17 07:15:45 所属栏目:百科 来源:网络整理
导读:在变量声明之后,星号(*)和数字的含义是什么?如在WpName As String * 6中看到的那样 Public Type WayPoint WpIndex As Integer WpName As String * 6 WpLat As Double WpLon As Double WpLatDir As String * 1 WpLonDir As String * 1End Type 解决方法 星号
在变量声明之后,星号(*)和数字的含义是什么?如在WpName As String * 6中看到的那样

Public Type WayPoint

   WpIndex As Integer
   WpName As String * 6
   WpLat As Double
   WpLon As Double
   WpLatDir As String * 1
   WpLonDir As String * 1

End Type

解决方法

星号将变量声明为固定长度的字符串,其中数字表示字符串的长度:

http://www.1sayfa.com/1024/diger/vb/ch07.htm#Heading8

The declaration of a fixed-length string variable contains an asterisk (*) to tell Visual Basic that the string will be a fixed length. The final parameter,strlength,tells the program the number of characters that the variable can contain.

它们可能是API调用所必需的,请参阅此问题:

VB6 – Is there any performance benefit gained by using fixed-width strings in VB6?

The only time in VB6 or earlier that I had to use fixed length strings was with working with API calls.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读