|
-
Apr 11th, 2007, 06:58 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Make a function return a array
Hi. I want my function to return a array.
I got this error: Compile error: Type Mismatch.
This is my code:
Code:
Public Function RegistaNBCobranca(Entidade As Integer, ContaBancaria As String, TipoDoc As String, Serie As String, NumDoc As Long, Prestacao As Integer, Valor As Double, DataDoc As String) As String
Dim Recibo As GcpBEDocumentoLiq
Dim Retorna(1 To 2) As String
With Recibo
'....
'....
Retorna(1) = .NumDoc
End With
Retorna(2) = Recibo.Serie
RegistaNBCobranca = Retorna()
End Function
What's wrong with my code?
-
Apr 11th, 2007, 07:01 AM
#2
Re: Make a function return a array
What is GcpBEDocumentoLiq?
How do you call your function?
What line causes the error?
-
Apr 11th, 2007, 07:03 AM
#3
Re: Make a function return a array
Modify this as
Code:
Public Function RegistaNBCobranca(Entidade As Integer, ContaBancaria As String, TipoDoc As String, Serie As String, NumDoc As Long, Prestacao As Integer, Valor As Double, DataDoc As String) As String
'--Add this
Public Function RegistaNBCobranca(Entidade As Integer, ContaBancaria As String, TipoDoc As String, Serie As String, NumDoc As Long, Prestacao As Integer, Valor As Double, DataDoc As String) As String()
Dim Recibo As GcpBEDocumentoLiq
Dim Retorna(1 To 2) As String
With Recibo
'....
'....
Retorna(1) = .NumDoc
End With
Retorna(2) = Recibo.Serie
'--RegistaNBCobranca = Retorna()
'--Add this
RegistaNBCobranca = Retorna
End Function
-
Apr 11th, 2007, 07:03 AM
#4
Re: Make a function return a array
Public Function RegistaNBCobranca(Entidade As Integer, ContaBancaria ...., DataDoc As String) As String()
End Function
 why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
for every question you ask provide an answer on another thread.
-
Apr 11th, 2007, 07:04 AM
#5
Thread Starter
Hyperactive Member
Re: Make a function return a array
Hi. 1st: GcpBEDocumentoLiq is a type of data.
2nd: I got the error in the line last line:
Code:
RegistaNBCobranca = Retorna()
3rd: When i try to compile (it's a dll) i got that error of type mismatch.
Thanks.
-
Apr 11th, 2007, 07:07 AM
#6
Thread Starter
Hyperactive Member
Re: Make a function return a array
Ok. Thats resolved. It was the lack of ().
Thank you all for your quick replyzz.
-
Apr 11th, 2007, 07:11 AM
#7
Re: Make a function return a array
The easiest and best way to mark a thread resolved is to pull down the Thread Tools menu and click the Mark Thread Resolved menu item.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|