Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mscomm32 problems
Message
From
26/09/2001 07:28:27
 
 
To
26/09/2001 03:42:45
Alina Panaghiu
Smart Computers
Arad, Romania
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00560849
Message ID:
00560872
Views:
18
>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
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform