InputMode
Sets or Retrieves the property indicating the InputMode
Available at design time and runtime.
MSComm32 and Comm32 have Compatible behavior. (See remarks below)
 |
| |
Syntax |
object.InputMode = value |
| |
|
|
| |
object |
Name of the communications control. |
| |
value |
A numerical expression being one of the following values.
0 = comInputModeText
1 = comInputModeBinary |
| |
|
|
| |
Examples |
object.InputMode = 0 |
'// Set the value (Text mode) |
| |
|
|
|
| |
|
if object.InputMode = 0 then
MsgBox("Mode is Text")
Else
MsgBox("Mode is Binary")
End If |
'// retrieve the current setting |
| |
|
|
|
|
 |
Remarks:
Difference in functionality between MSComm and Comm32
MSComm32
The documentation for MSComm32 suggests that setting this property to comInputModeText should only be used for receiving true alphanumeric characters. If non-alphanumeric data, control codes etc. is to be received then a setting of comInputModeBinary should be used.
Comm32
In our tests we have found that MSComm32 and Comm32 are in fact identical. We believe that the names of the constants used by the MSComm32 control and its documentation is misleading. In our tests we have found the following to be true for both MSComm32 and for Comm32 :-
comInputModeText Data is retrieved as a standard 'String'. Individual elements of the string may contain any ascii/byte value including control codes etc.
comInputModeBinary Data is retrieved as an Array of Bytes. |