msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing an array

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise
Author Message
berick



Joined: 04 Oct 2007
Posts: 2

PostPosted: Thu Jul 05, 2007 3:30 pm    Post subject: Passing an array Reply with quote

New to this, I used to pass an array like this

function BytesToString(byref myarray() as byte, somethingelse as long) as long



and
m = BytesToString(fooBar(), bluenose)

This would send the descriptor or pointer to the array to the function

The acual code is
dim myarray() as byte = My.computer.filesystem.ReadAllBytes(infile)
res = BytesToString(myarray(),1,4)) 'read first 4 bytes only

And the function is as above.

I get a "number of indices is less than the number of dimentions in the
indexed array"

I just do not understand this.. if I put the first element of the array in
there, I get other errors.

This file is one that I have to read Bytes and words from, so I need access
to each and every byte. ALso, the files can be over a gig, so I really do not
want readallbytes, as that can cause problems on some pc's this is to run on,
but fileget isn't working.. which I will post in another question.



(I realy want to use fileget, but that is in another question).

Archived from group: microsoft>public>vb>enterprise
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1081

PostPosted: Thu Jul 05, 2007 3:43 pm    Post subject: Re: Passing an array Reply with quote

"berick" wrote in message @microsoft.com...
> New to this, I used to pass an array like this


--
You need to ask in a newsgroup with "dotnet" in the name. This group is for
VB 6.0 and earlier and does not include VB.Net or VB 200x.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group