操作没有问题
Option Explicit
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Dim F As Single
Dim A(3) As Bye
Private Sub Command1_Click()
A(0) = CLng("&H" & Text1.Text)
A(1) = CLng("&H" & Text2.Text)
A(2) = CLng("&H" & Text3.Text)
A(3) = CLng("&H" & Text4.Text)
CopyMemory F, A(0), 4
Text5.Text = F
End Sub
但是 我在变量声明里加了一句“dim b as string”问题来了
就会老是出现“Type Miss”、“类型不匹配”的系统错误提示
而且即使我把“dim b as string”这句删除,程序还是会一直报上面的错误,除非重启程序。
出错代码如下:
Option Explicit
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Dim F As Single
Dim A(3) As Bye
DIM B AS String
Private Sub Command1_Click()
A(0) = CLng("&H" & Text1.Text)
A(1) = CLng("&H" & Text2.Text)
A(2) = CLng("&H" & Text3.Text)
A(3) = CLng("&H" & Text4.Text)
CopyMemory F, A(0), 4
Text5.Text = F
End Sub
真的很奇怪,希望各位大哥、高手、老鸟、前辈指教!!!小弟先谢谢了!!!!
4 个解决方案
#1
楼主的代码让我范晕,这个代码能运行???
#3
Dim A(3) As Bye ---->Dim A(3) As By
te
#4
麻烦lz是否先确认下以下2个问题:
1、Dim A(3) As Bye 是不是类型声明有点问题
2、A(0) = CLng("&H" & Text1.Text) 转换的结果是Long类型
1、Dim A(3) As Bye 是不是类型声明有点问题
2、A(0) = CLng("&H" & Text1.Text) 转换的结果是Long类型
#1
楼主的代码让我范晕,这个代码能运行???
#2
#3
Dim A(3) As Bye ---->Dim A(3) As By
te
#4
麻烦lz是否先确认下以下2个问题:
1、Dim A(3) As Bye 是不是类型声明有点问题
2、A(0) = CLng("&H" & Text1.Text) 转换的结果是Long类型
1、Dim A(3) As Bye 是不是类型声明有点问题
2、A(0) = CLng("&H" & Text1.Text) 转换的结果是Long类型