Edson, I don't have a copy of VB with me here at work, so I can't test these suggestions out. It's also been a while since I used VB, but I'll give it a shot. The variant type is designed to represent a number of different types. One of these types is an "OLE SafeArray," which is an (possibly multidimensional) array type that can contain instances of other types (including variants). You can see the type that the MSComm control is using by putting the following statement in your code: Debug.Print TypeName(myVariant) (I am assuming that myVariant is the name of the variant that your MSComm control is using.) This should print out a string that looks something like "Byte()", with the parentheses indicating that the type is an array. (As I said, I'm guessing what the result would be, but the docs for the InputMode property indicate that an array of bytes is used.) If that is the case, you can access the array elements using the standard VB array notation: Dim myByte as Byte myByte = myVariant(1) Note that you can determine the "bounds" of the array using the LBound and UBound functions. (To find out if the array is 0-based or 1-based.) Dim lBound as Long Dum uBound as Long lBound = LBound(myVariant) uBound = UBound(myVariant) Dim i as Long For i = lBound to uBound myByte = myVariant(i) ... Next i If one of the statements above fails, feel free to repost or contact me directly via email. I am sure we can work through it. Jeremy Furtek mailto:jfurtek@agames.com ----- Original Message ----- From: "Edson Brusque" To: Sent: Monday, April 29, 2002 10:37 AM Subject: [OT]: VisualBasic: How to retrieve an array on a variant? > The MSComm control have the option to put the received bytes as text on > a string variable (comInputModeText)or as binary data on a variant variable > (comInputModeBinary). > > When using comInputModeBinary how can I retrieve the array of data > (integers) received? > > Thanks, > > Brusque > ----------------------------------------------------------------- > Edson Brusque C.I.Tronics Lighting Designers Ltda > Researcher and Developer Blumenau - SC - Brazil > Say NO to HTML mail www.citronics.com.br > ----------------------------------------------------------------- -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.