Any ideas why the red line below produces a syntax error at '('
nEmployeeMax := 33
nEmployeeCount := 0
nPageE := int(nEmployees/nEmployeeMax) + if(nEmployees % nEmployeeMax > 0, 1, 0 )
nPageC := 0
Fivewin 13.04 / Harbour 3.2.0 (rev 18881)
Thanks for any help.
Toyet
Immediate IF() syntax error
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Immediate IF() syntax error
If you are meaning "syntax error" while compiling, there is no such error. The statement is compiling fine for me.
If you are meaning runtime error ( i don't think that is what you meant) then please check nEmployees in already initialized with a numeric value.
Finally, the statement
can be simplified as
If you are meaning runtime error ( i don't think that is what you meant) then please check nEmployees in already initialized with a numeric value.
Finally, the statement
Code: Select all
nPageE := int(nEmployees/nEmployeeMax) + if(nEmployees % nEmployeeMax > 0, 1, 0 )
Code: Select all
nPageE := Ceiling(nEmployees/nEmployeeMax)
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Immediate IF() syntax error
GN Rao,
I tried the Ceiling() function and it seems to go fine. Thank you for it.
Maybe the '%' operator for modulus division is the culprit for the error?
Toyet
I tried the Ceiling() function and it seems to go fine. Thank you for it.
Maybe the '%' operator for modulus division is the culprit for the error?
Toyet
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Immediate IF() syntax error
% operator works well with both Harbour and xHarbour with all recent versions I remember.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India