For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Syntax > November 2005 > Passing subset of arrays to sub/functions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Passing subset of arrays to sub/functions
StoneAgeProgrammer

2005-11-09, 7:02 pm

Can anybody assist me in how I can call sub/functions with subset of (one
dimensional) arrays ? I am converting from Fortran with extensive use of this
functionality.
In the receiving array index (0) shall refer to first element of subset in
call.
When I try I get type mismatch (array vs. singel variable even when passing
ByRef).

Bob Butler

2005-11-09, 7:02 pm

"StoneAgeProgrammer" <StoneAgeProgrammer@discussions.microsoft.com> wrote in
message news:0AD7D5CA-1E4B-4FC9-A41C-2B7D38924B7B@microsoft.com
> Can anybody assist me in how I can call sub/functions with subset of
> (one dimensional) arrays ? I am converting from Fortran with
> extensive use of this functionality.
> In the receiving array index (0) shall refer to first element of
> subset in call.
> When I try I get type mismatch (array vs. singel variable even when
> passing ByRef).


VB doesn't support that; you're best bet may be to pass in the array and the
desired lower and/or upper bounds for the subroutine to use.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."

Duane Bozarth

2005-11-09, 7:02 pm

StoneAgeProgrammer wrote:
>
> Can anybody assist me in how I can call sub/functions with subset of (one
> dimensional) arrays ? I am converting from Fortran with extensive use of this
> functionality.
> In the receiving array index (0) shall refer to first element of subset in
> call.
> When I try I get type mismatch (array vs. singel variable even when passing
> ByRef).


As Bob B notes, VB doesn't support the form. What about leaving it in
Fortran and turning it into a DLL? (My primary use of VB is as the
front end UI for Fortran calculational engines.)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com