[Gambas-user] Pass array to a Function or Sub.

Leo Barnhoorn leo.barnhoorn at ...246...
Sun Oct 31 03:10:57 CET 2004


Hello Benoit,

I have already found the problem.

Thanks anyway.

Regards,
Leo.

On Sunday 31 October 2004 02:41, Leo Barnhoorn wrote:
> Hello Benoit,
>
> I like to pass a array to a function or sub but it is not working any more.
>
> Below a example :
>
> The ByteArray is empty when i pass it to this function, except the first
> element of the array.
>
> PRIVATE FUNCTION ByteToBit(ByteArray AS Byte[]) AS String
> Array is empty. except first element.
> END
>
> This is the way i make the ByteArray.
>
> PRIVATE FUNCTION ReadHeader(sFileName AS String) AS Boolean
>    DIM ByteArray  AS NEW Byte[]
>
>    ByteArray.Resize(4)
>
>
> Filling the array.
>
>    SEEK #hFile, HeadStart
>    FOR z = 0 TO 3
>       READ #hFile, Bytes
>       ByteArray[z] = Bytes
>    NEXT
>
>  At this point the array is filled. Insite the function the array is empty
> except the first element of the array.
>
>    sBin = ByteToBit(ByteArray)
> END
>
> Regards,
> Leo.
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list