On May 16, 2007, at 15:39 UTC, Todd Fantz wrote:

> Hi, I have an application that uses serial ports. I create a popup by
> looping through system.serial(i) and then I open the port based on  
> the chosen index. On a Mac it works fine, on the PC it is choosing  
> the port one "before" the chosen index.
> 
> I.E. if I say myserialobj.port=2   it is picking the second serial  
> port, not the third, as it does on a mac.

Don't do that.  Do myserialobj.SerialPort = System.Serial(i) instead. 
Or better yet, when loading your popup menu, store the ports in the row
tag:

  for i As Integer = 0 to System.SerialPortCount - 1
    me.AddRow System.SerialPort(i).Name
    me.RowTag( i ) = System.SerialPort(i)
  next

And then, simply use that in the Change event:

  Ser.SerialPort = me.RowTag( me.ListIndex )
  OpenPort
 
> 2007r2, there is no "port" entry in the serial docs, but I assumed  
> the index was 0 based, or at least should be consistent across  
> platforms?

I'm pretty sure that property has been deprecated for a while, which is
probably why it's not documented.  Work with objects instead of
integers, and you should be fine.

Cheers,
- Joe

--
Joe Strout -- [EMAIL PROTECTED]
Strout Custom Solutions


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to