Helmut_Meukel
2/14/2011 9:31:00 AM
Anita wrote:
> I work with a function, Function IsLogged(tagno).
>
> This function's argument is an integer, but it returns a Boolean value.
> It operates, but I believe its also creating an error with each access.
>
> Code is like:
> Function IsLogged(tagno)
> ' Do data stuff
> If tagno = logged Then
> IsLogged = False
> Else
> IsLogged = True
> End If
> End Function
>
> I haven't been able to find an example of this.
> Should this function's syntax be: Function(tagno) As Boolean ?
> Or Function(tagno as integer) As Boolean?
Hmm,
it should be:
Function(tagno as Integer) As Boolean
Written as 'Function IsLogged(tagno)' it returns a variant and tagno
is a variant.
If the value of tagno depends on your 'database acrobatics' it may
probably be NULL not an Integer, without throwing an error!
That behavior may be even desirable, but then you must test for NULL
before executing 'If tagno = logged Then'.
Helmut.