Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IF Statement Doesn't Seem to be Working
Message
From
06/08/1998 14:18:25
Monte Murdock
Universal American Mortgage Company
Clearwater, Florida, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00123956
Message ID:
00124563
Views:
15
>>>>IF Statement Doesn't Seem to be Working
>>>>
>>>>I have numeric fields in a table of employee absence data as follows ...
>>>>
>>>>Abs.late
>>>>Abs.absent
>>>>Abs.early
>>>>
>>>>I have written an error-checking IF statement that doesn't seem to be working, but yet, VFP does not generate an error on it either.
>>>>
>>>>
>>>>IF Abs.late=0 AND Abs.absent=0 AND Abs.early=0
>>>> MESSAGEBOX('You need to make a non-zero entry') + CHR(13) + ;
>>>> 'in either Late:, Absent:, or Early:', 0+48+0, 'Error')
>>>>
>>>>
>>>>Even if the fields Late, Absent, & Early contain zeros (0.00), this MESSAGEBOX never gets processed, the program just goes right on as if everything is fine.
>>>>
>>>>Need help. TIA, CH.
>>>
>>>0.0 and 0 is no difference at all.
>>>
>>>I suspect the pointer is not sitting on the desired record. However, try:
>>>
>>>
>>>
>>>IF Abs.late==0 AND Abs.absent==0 AND Abs.early==0
>>>     MESSAGEBOX('You need to make a non-zero entry') + CHR(13) + ;
>>>          'in either Late:, Absent:, or Early:', 0+48+0, 'Error')
>>>
>>
>>.NULL. value?
>>
>>IF (Abs.late==0 OR ISNULL(Abs.late)) AND ;
>>   (Abs.absent==0 OR ISNULL(Abs.absent)) AND ;
>>   (Abs.early==0 OR ISNULL(Abs.early))
>>     MESSAGEBOX('You need to make a non-zero entry') + CHR(13) + ;
>>          'in either Late:, Absent:, or Early:', 0+48+0, 'Error')
>>
>>ENDIF
>>
>>
>
>If not using .NULL. ?
>if empty(abs.late + abs.absent + abs.early)
> messagebox(...

Your statement:
IF Abs.late==0 AND Abs.absent==0 AND Abs.early==0
MESSAGEBOX('You need to make a non-zero entry') + CHR(13) + ;
'in either Late:, Absent:, or Early:', 0+48+0, 'Error')

I believe you closed the ")" to early try the following
IF Abs.late==0 AND Abs.absent==0 AND Abs.early==0
=MESSAGEBOX('You need to make a non-zero entry' + CHR(13) + ;
'in either Late:, Absent:, or Early:', 0+48+0, 'Error')
ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform