Array to Variant and Variant to array problem 
Author Message
 Array to Variant and Variant to array problem

I am having real headaches with this one !  I am writing a winsock
application and want to send an integer array to the remote computer.
I've set my code as follows:

Dim TableData(26) as integer

Dim DataToSend as Variant

DataToSend = TableData <-------  this seems to work fine
DataToSend = "D" & DataToSend
Call Send_Data(DataToSend)

On the receiving end........

Dim DataTable(26) as Integer
Dim DataReceived as Variant
Dim DataIn as Variant

If mid(DataReceived, 1, 1) = "D" then
        DataIn = mid(DataReceived, 2, (BytesTotal -1))
        DataTable = DataIn

This is where everything seems to go wrong.  When I compile the
application I get an error message of "Can't assign to a non-byte
array".  What does this mean ?  Does anybody have a way to send an
entire array of integers as one peice of data and have it arrive on
the receiving end as an entire array of integers ?   Or do I have to
create another table of strings = Str$(integer) and send that way and
then Val(string) = Integer on the receiving end ?  

Thanks for your time,

Wed, 07 Oct 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Problem passing a variant array out of VBasic object to ASP

2. Dynamic Variant Array Problem

3. String array in variant problem

4. String array in variant problem

5. array of variants vs. a variant array for marshalling

6. Variant array vs. array of variant.

7. Coercing A Variant Array of Variants into an integer array.

8. Variant Array --> ByteArray() --> Variant Array

9. Array of Boolean as Variant ?

10. variant containing an array

11. VB6 Variant Arrays in DOTNET C#/VB

12. Variant Arrays


Powered by phpBB® Forum Software