>I try to programatically change the commport used by the mscomm32.ocx control.
>
>the code looks like this:
>
>if formobject.mscommobject.portopen=.t.
> formobject.mscommobject.portopen=.f.
>endif
>formobject.mscommobject.commport=newport
>if formobject.mscommobject.portopen=.f.
> formobject.mscommobject.portopen=.t. /here the problems apears
>endif
>
PortOpen performs the opening and closing of the port - it does not simply test the status. Your inclusion of the = sign in the comparison will be parsed as an assignment operation rather than as a test - to check if a port is open, it's preferable to code:
if formobject.mscommobject.portopen
or
if ! formobject.mscommobject.portopen