Iamlaosong
1. Question proposal
When a problem is found in programming, the system always prompts a compilation error. The byref parameter type does not match,
But there is no problem with Parameter definition. Why?
2. Problem Environment
Assume that the function is defined as follows:
Function get_kind (ADDR as string) as integer
......
End Function
Call process:
Sub check_address ()
Dim ADDR, new_addr (10000) as string
......
ADDR = new_addr (I)
......
Kk = get_kind (ADDR)
......
End sub
3. Cause
The type after ADDR value assignment is incorrect. Although the values are strings, array variables are different from individual variables, and the compilation system reports an error.
It is easy to solve the problem by finding the cause:
Method 1: forced conversion, using CSTR (ADDR)
Method 2: Change the variable and assign the value myaddr = ADDR before callingKk = get_kind (myaddr)
4. Problem Expansion
Other types of arrays have the same problem. Isn't this a bug?