P
Pablo Cardellino
Hi,
I'm getting a compile error, array or custom type expected, at this sub:
---------------------------------------
Private Sub ignorarSempre_Click() ' this line appears highlighted and the
sub doesn't run
Dim arg(3) As Variant
arg(0) = termo.Text
arg(1) = "IGNORADO PERMANENTEMENTE"
arg(2) = "-1"
arg(3) = "1"
adDic (arg) ' this "arg" become selected when the error happens, so I
assume that here is the error
localizarTermo
completarForm
End Sub
---------------------------------------
This is the adDic function declaration, which is invoked at the error line:
---------------------------------------
Public Function adDic(args() As Variant) As Boolean
---------------------------------------
Note: the function IS working when invoked from another form. This is the
function (abbreviated, showing just the relevant lines):
---------------------------------------
Private Sub EditRegraProceder_Click()
Dim i As Integer
Dim regrasel As Boolean
Dim msg As VbMsgBoxResult
Dim gravacao As Boolean
Dim arg(3) As Variant
Dim regs() As Integer
' several lines supressed here
If regrasel = True Then
arg(0) = EditRegraAntiga
arg(1) = EditRegraNova
' lines supressed
If UBound(regs) = 0 Then
arg(2) = 0
ElseIf UBound(regs) = 1 Then
arg(2) = regs(0)
Else
arg(2) = ""
For i = 0 To UBound(regs)
If i < UBound(regs) Then arg(2) = arg(2) & regs(i)
If i < UBound(regs) - 1 Then arg(2) = arg(2) & "|"
Next i
End If
arg(3) = CInt(EditRegraExcecaoSim) * CInt(EditRegraExcecaoSim) '
isto tira o sinal de negativo
gravacao = nOrt.adDic(arg) ' this line is invoking the function, and
it runs OK
If gravacao Then Me.Hide Else MsgBox ("Houve um erro e não foi
possível gravar o termo no dicionário da aplicação")
End If
End Sub
I'm getting a compile error, array or custom type expected, at this sub:
---------------------------------------
Private Sub ignorarSempre_Click() ' this line appears highlighted and the
sub doesn't run
Dim arg(3) As Variant
arg(0) = termo.Text
arg(1) = "IGNORADO PERMANENTEMENTE"
arg(2) = "-1"
arg(3) = "1"
adDic (arg) ' this "arg" become selected when the error happens, so I
assume that here is the error
localizarTermo
completarForm
End Sub
---------------------------------------
This is the adDic function declaration, which is invoked at the error line:
---------------------------------------
Public Function adDic(args() As Variant) As Boolean
---------------------------------------
Note: the function IS working when invoked from another form. This is the
function (abbreviated, showing just the relevant lines):
---------------------------------------
Private Sub EditRegraProceder_Click()
Dim i As Integer
Dim regrasel As Boolean
Dim msg As VbMsgBoxResult
Dim gravacao As Boolean
Dim arg(3) As Variant
Dim regs() As Integer
' several lines supressed here
If regrasel = True Then
arg(0) = EditRegraAntiga
arg(1) = EditRegraNova
' lines supressed
If UBound(regs) = 0 Then
arg(2) = 0
ElseIf UBound(regs) = 1 Then
arg(2) = regs(0)
Else
arg(2) = ""
For i = 0 To UBound(regs)
If i < UBound(regs) Then arg(2) = arg(2) & regs(i)
If i < UBound(regs) - 1 Then arg(2) = arg(2) & "|"
Next i
End If
arg(3) = CInt(EditRegraExcecaoSim) * CInt(EditRegraExcecaoSim) '
isto tira o sinal de negativo
gravacao = nOrt.adDic(arg) ' this line is invoking the function, and
it runs OK
If gravacao Then Me.Hide Else MsgBox ("Houve um erro e não foi
possível gravar o termo no dicionário da aplicação")
End If
End Sub