syntax error

boolean chkdate()
{
Custinvoicetable cust;
int i=0;
;

if (custTable.PaymTermId)
{
while select InvoiceDate from cust order by cust.InvoiceDate desc where cust.OrderAccount == custTable.AccountNum
{
if (cust)
{
a=cust.InvoiceDate;
info(strfmt("%1",a));
b=today();
info(strfmt("%1",b));
c=b-a;
info(strfmt("%1",c));
day=PaymTerm::find(custTable.PaymTermId).NumOfDays;
// info(strfmt("%1 day",day));
if(c < day)
return false;
else
return true;
}
}
else
{
return true;
}
} got syntax error… wht s the pblm in this code