ArrayAppend Function

Hi All,I have the following code :

Dim empNbr As Variant

Dim authrsEmpNbr As Variant,rdrsEmpNbr As Variant

empNbr = 16

authrsEmpNbr = Arrayappend(authrsEmpNbr,empNbr )

I would like to know what is the error here.The authrsEmpNbr doesn’t have any values at all at when the ArrayAppend is initiated.Should the Variant be declared as arrays and may be Redimed later?I would appreciate any ideas.

Thanks,

Sreeni.

Subject: Try this instead…

You are not appending an ARRAY…

Dim authrsEmpNbr(0), rdrsEmpNbr(0), empNbr(0)

empNbr(0) = 16

authrsEmpNbr = Arrayappend(authrsEmpNbr,empNbr )

Make sure you are actually dealing with arrays when using this function.

Subject: or this…

Hmm, the code above doesn’t work for me…-> Illegal reference to array ←

But this works equal:

Dim empNbr(0) As Integer

Dim authrsEmpNbr(0)

empNbr(0) = 16

NewArray = Arrayappend(authrsEmpNbr,empNbr )

Subject: That will give you a 2 element array w/ the first uninitialized…

Try this way.Dim empNbr(0) As Integer

Dim authrsEmpNbr()

empNbr(0) = 16

NewArray = Arrayappend(authrsEmpNbr,empNbr )