?? 1419.html
字號:
<html>
<head>
<title>變數宣告和函數(程序)引數的問題</title>
</head>
<BODY BACKGROUND="" BGCOLOR="white" TEXT="black" LINK="blue" VLINK="#808080" ALINK="red">
<center>
<h1>變數宣告和函數(程序)引數的問題</h1>
</center>
<HR><p>
Posted by <a href="mailto:lwg@ss20-1.tatung.com.tw">林文國</a> on November 27, 1997 at 19:32:48:<p>
If we define two variables in vb6.0 as follows<p>dim vara(),varb() as byte 'other types also introduce same problem<p>and there are one function or procedure which defined as<br>public sub sub_a(...,vara() as byte,varb() as byte,...)<br>end sub<p>My problem is that after i call the function or procedure (for example, call sub_a(...,vera,verb,...)) why the compiler tell me the error message, "type mismtach: array or user-defined type expected", in the location of vara(). But, the problem can be sloved by the following defintion<br>dim vara() as byte<br>dim varb() as byte<p>For one words,<br>1. dim vara(), varb() as byte<br>2. public sub sub_a(...,vera() as byte ,verb() as byte,...)<br>3. call sub_a(...,vera,verb,...)<br>will get an error message, but<br>1. dim vera() as byte: dim verb() as byte<br>2. public sub sub_a(...,vera() as byte ,verb() as byte,...)<br>3. call sub_a(...,vera,verb,...)<br>will work!!<p>Can anyone tell me why is the problem happened?<p>Thank you in advance<p>Wen-Gou Lin
<br>
<p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 1419-->
<!--top: 1420--><li><a href="1420.html"><b>宣告方式錯誤</b></a> 小吳 <i>20:18:12 11/27/97</i>
(<!--responses: 1420-->0)
<ul><!--insert: 1420-->
</ul><!--end: 1420-->
</ul><!--end: 1419-->
<br><HR><p>
</body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -