[Mono-list] how to use 'Conversions.ToInteger' in mono?

Josh Hammond jhammond at external.fwmail.org
Sun Jun 22 10:43:48 EDT 2008


On Sun, June 22, 2008 2:19 pm, Andy Hume wrote:
>
>
> Josh Hammond wrote:
>>
>> On Sat, June 21, 2008 12:45 pm, Lauri Kotilainen wrote:
>>> Can't you substitute Convert.ToInt32 for Conversions.ToInteger?
>>>
>> That works, but then I have the same issue for Strings.Right()
>>
>
> Well, System.String itself has lots of useful methods quite like the ones
> duplicated from VB.  The following is equivalent to your line:
>    strBin = strBin.SubString(1)
>

Yep, that's what I ended up doing. The library compiled flawlessly and so
did the main executable.
Unfortunately I seem to be having some troubles accessing the serial port
and I am getting tons of run-time errors.
I read the basic communication example
(http://www.mono-project.com/HowToSystemIOPorts) but at no avail:

Unhandled Exception: System.IO.IOException: I/O Error
  at System.IO.Ports.SerialPortStream..ctor (System.String portName, Int32
baudRate, Int32 dataBits, Parity parity, StopBits stopBits, Boolean
dtrEnable, Boolean rtsEnable, Handshake handshake, Int32 readTimeout,
Int32 writeTimeout, Int32 readBufferSize, Int32 writeBufferSize)
[0x00000]
  at (wrapper remoting-invoke-with-check)
System.IO.Ports.SerialPortStream:.ctor
(string,int,int,System.IO.Ports.Parity,System.IO.Ports.StopBits,bool,bool,System.IO.Ports.Handshake,int,int,int,int)
  at System.IO.Ports.SerialPort.Open () [0x00000]
  at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPort:Open ()
  at TEMPer.Communication.TEMPerInterface.Init () [0x00000]
  at TEMPer.Communication.TEMPerInterface..ctor (System.String COMPort)
[0x00000]
  at TEMPerDemo.Program.Main (System.String[] args) [0x00000]


Josh



More information about the Mono-list mailing list