Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Operator/operand type mismatch 1

Status
Not open for further replies.

bebbo

Programmer
Dec 5, 2000
621
GB
The error messages below are two examples where I get the above error. Both these errors occur on a similar line of code (i.e. if sys_msr = TRUE). I have a .h with #define TRUE 1 in it. This .h file is included in the both forms. IF sys_msr = TRUE is used in a number of different lines. This error does not always occur. Indeed if it did the program would fail to function. Also the line of code recorded in the error is wrong on both occasions. Line of code is as reported above, if sys_msr = TRUE. Sys_msr is a global variable.


03/12/2002 13:40:44 Error number: 107
Error message: Operator/operand type mismatch.
Line of code with error: POSID=Setup.POSID
Line number of error: 1
Program with error: CLIENTFORMSET.CLIENTS.PGCARDSWIPE.DESTROY

02/12/2002 13:58:21 Error number: 107
Error message: Operator/operand type mismatch.
Line of code with error: DO c:\3100\clubmaster.exe
Line number of error: 3
Program with error: POSFORMSET1.POSFORM.PGENQFRAME.PGENQ.TXTSWIPE_ON.SETFOCUS
 
Hi

sys_msr = 1 is a numeric variable. How is it defined as Boolean.
That holds the key for your error. :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
How is it defined as Boolean.

Sorry don't understand the above "Boolean"
 
Hi
define it as .t. or .f.
:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
OK, I'll do that. However I don't understand why I can't have a TRUE AND FALSE definition as 1 and 2. Therefore having code as below
IF SYS_MSR = TRUE &&1
MESSAGEBOX("SYS_REF = true")
ENDIF

I've got loads of these throughout my program (sys_prt, sys_msr, sys_beep etc...). My initial program sets up their values (i.e TRUE or FALSE). Do you recommend that I use .t. / .f. instead? Has iot got to be :

IF SYS_MSR = .T.
MESSAGEBOX("SYS_REF = true")
ENDIF
 

#DEFINE LTRUE .F.

IF LTRUE
WAIT WINDOW "TRUE"
ELSE
WAIT WINDOW "FALSE"
ENDIF

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top