gpt4 book ai didi

vb6 - VB6变量声明中的星号

转载 作者:行者123 更新时间:2023-12-04 14:10:26 25 4
gpt4 key购买 nike

变量声明后的星号 (*) 和数字是什么意思?如 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.

关于vb6 - VB6变量声明中的星号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7293436/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com