A Binary Data Type Question 
Author Message
 A Binary Data Type Question

1. In a VB4.0 application, I read status data from a machine. A
(third party) control (called WinSECS from FastTech) is used to read
the status. As far as I can tell, the variable is typed as binary. [I
don't understand the details of this control well. It is possible
that I could be wrong on this.]

2. The application has the following statement:

If (gwsSecsTransaction.Secondary.Item("EAC") = 0) Then

3. When I run with a simulator, the data byte for EAC has 32 as the
value. (The simulator sends this value.) This does NOT cause the above
statement any problems.

4. When I run with the actual machine, the data byte for EAC has 02 as
the value. I get a Type Mismatch in the above statement.

5. I am wondering whether someone can explain what is going on. I
noticed that binary values are stored as Byte data type. Why should
Case (a) have a problem but not Case (b) (below) ?

(a) Comparing Hex 02 with 0

(b) Comparing Hex 32 with 0

6. Is the constant 0 in the If statement binary, integer, or string ?

7. The following test segement does not get a Type Mismatch error:

  Dim bytTest as Byte
  bytTest = 2
  If (bytTest = 2) Then
  End If

8. I do realize that the following conversion functions are available:


9. If possible, please e-mail copies of replies to

10. Thanks.

comparing Hex 02 with 0 cause a problem but not

Sun, 25 Jul 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Binary Data Types

2. Is there a Binary data type ?

3. Binary data types

4. Data Type Conversion Error with Long Binary Field -PLEASE HELP

5. binary files and user defined data types

6. Binary data types

7. Help with Binary data types using VB

8. Binary data type in VB4???

9. Binary data types in VB?

10. Crystal and SQL Binary Data Type

11. Querying binary data types

12. Saving Binary files on the Client to the Image data type in SQL Server


Powered by phpBB® Forum Software