title: Error in formule in crystal report
body: <p>I get the following error in crystal reports:</p>
  
  <blockquote>
    <p>the remaining text does not to be part of the formule</p>
  </blockquote>
  
  <p>The error points to the last line from my formula: <code>zone;</code></p>
  
  <p>What is wrong with the formula? Can it be done in an other way?</p>
  
  <pre><code>stringVar zone := '';
  if {?ParamPuntenboek} = 'Begin schooljaar' then
          (if {LEERLING_LEERLING.LEERJAAR} = '4'then
              select(toNumber({@4BTOT}))
                  case '99': zone := 'A'
                  case '97': zone := 'A'
                  case '95': zone := 'A'
                  case '93': zone := 'A'
                  case '90': zone := 'A'
                  case '85': zone := 'A'
                  case '80': zone := 'A'
                  case '75': zone := 'A'
                  case '70': zone := 'B'
                  case '65': zone := 'B'
                  case '60': zone := 'B'
                  case '55': zone := 'B'
                  case '50': zone := 'B'
                  case '45': zone := 'C'
                  case '40': zone := 'C'
                  case '35': zone := 'C'
                  case '30': zone := 'C'
                  case '25': zone := 'C'
                  case '20': zone := 'D'
                  case '15': zone := 'D'
                  case '10': zone := 'E'
                  case '7': zone := 'E'
                  case '5': zone := 'E'
                  case '3': zone := 'E'
                  case '1': zone := 'E'
                  case '0': zone := 'E'
                  default: zone := '';
          if {LEERLING_LEERLING.LEERJAAR} = '5'then
              select(toNumber({@5BTOT}))
                  case '99': zone := 'A'
                  case '97': zone := 'A'
                  case '95': zone := 'A'
                  case '93': zone := 'A'
                  case '90': zone := 'A'
                  case '85': zone := 'A'
                  case '80': zone := 'A'
                  case '75': zone := 'A'
                  case '70': zone := 'B'
                  case '65': zone := 'B'
                  case '60': zone := 'B'
                  case '55': zone := 'B'
                  case '50': zone := 'B'
                  case '45': zone := 'C'
                  case '40': zone := 'C'
                  case '35': zone := 'C'
                  case '30': zone := 'C'
                  case '25': zone := 'C'
                  case '20': zone := 'D'
                  case '15': zone := 'D'
                  case '10': zone := 'E'
                  case '7': zone := 'E'
                  case '5': zone := 'E'
                  case '3': zone := 'E'
                  case '1': zone := 'E'
                  case '0': zone := 'E'
                  default: zone := '';
          if {LEERLING_LEERLING.LEERJAAR} = '6'then
              select(toNumber({@6BTOT}))
                  case '99': zone := 'A'
                  case '97': zone := 'A'
                  case '95': zone := 'A'
                  case '93': zone := 'A'
                  case '90': zone := 'A'
                  case '85': zone := 'A'
                  case '80': zone := 'A'
                  case '75': zone := 'A'
                  case '70': zone := 'B'
                  case '65': zone := 'B'
                  case '60': zone := 'B'
                  case '55': zone := 'B'
                  case '50': zone := 'B'
                  case '45': zone := 'C'
                  case '40': zone := 'C'
                  case '35': zone := 'C'
                  case '30': zone := 'C'
                  case '25': zone := 'C'
                  case '20': zone := 'D'
                  case '15': zone := 'D'
                  case '10': zone := 'E'
                  case '7': zone := 'E'
                  case '5': zone := 'E'
                  case '3': zone := 'E'
                  case '1': zone := 'E'
                  case '0': zone := 'E'
                  default: zone := '';)
  else
      (if {?ParamPuntenboek} = 'Midden schooljaar' then
              (if {LEERLING_LEERLING.LEERJAAR} = '3'then
                  select({@3MTOT})
                      case '99': zone := 'A'
                      case '97': zone := 'A'
                      case '95': zone := 'A'
                      case '93': zone := 'A'
                      case '90': zone := 'A'
                      case '85': zone := 'A'
                      case '80': zone := 'A'
                      case '75': zone := 'A'
                      case '70': zone := 'B'
                      case '65': zone := 'B'
                      case '60': zone := 'B'
                      case '55': zone := 'B'
                      case '50': zone := 'B'
                      case '45': zone := 'C'
                      case '40': zone := 'C'
                      case '35': zone := 'C'
                      case '30': zone := 'C'
                      case '25': zone := 'C'
                      case '20': zone := 'D'
                      case '15': zone := 'D'
                      case '10': zone := 'E'
                      case '7': zone := 'E'
                      case '5': zone := 'E'
                      case '3': zone := 'E'
                      case '1': zone := 'E'
                      case '0': zone := 'E'
                      default: zone := '';
              if {LEERLING_LEERLING.LEERJAAR} = '4'then
                  select(toNumber({@4MTOT}))
                      case '99': zone := 'A'
                      case '97': zone := 'A'
                      case '95': zone := 'A'
                      case '93': zone := 'A'
                      case '90': zone := 'A'
                      case '85': zone := 'A'
                      case '80': zone := 'A'
                      case '75': zone := 'A'
                      case '70': zone := 'B'
                      case '65': zone := 'B'
                      case '60': zone := 'B'
                      case '55': zone := 'B'
                      case '50': zone := 'B'
                      case '45': zone := 'C'
                      case '40': zone := 'C'
                      case '35': zone := 'C'
                      case '30': zone := 'C'
                      case '25': zone := 'C'
                      case '20': zone := 'D'
                      case '15': zone := 'D'
                      case '10': zone := 'E'
                      case '7': zone := 'E'
                      case '5': zone := 'E'
                      case '3': zone := 'E'
                      case '1': zone := 'E'
                      case '0': zone := 'E'
                      default: zone := '';
              if {LEERLING_LEERLING.LEERJAAR} = '5'then
                  select(toNumber({@5MTOT}))
                      case '99': zone := 'A'
                      case '97': zone := 'A'
                      case '95': zone := 'A'
                      case '93': zone := 'A'
                      case '90': zone := 'A'
                      case '85': zone := 'A'
                      case '80': zone := 'A'
                      case '75': zone := 'A'
                      case '70': zone := 'B'
                      case '65': zone := 'B'
                      case '60': zone := 'B'
                      case '55': zone := 'B'
                      case '50': zone := 'B'
                      case '45': zone := 'C'
                      case '40': zone := 'C'
                      case '35': zone := 'C'
                      case '30': zone := 'C'
                      case '25': zone := 'C'
                      case '20': zone := 'D'
                      case '15': zone := 'D'
                      case '10': zone := 'E'
                      case '7': zone := 'E'
                      case '5': zone := 'E'
                      case '3': zone := 'E'
                      case '1': zone := 'E'
                      case '0': zone := 'E'
                      default: zone := '';
              if {LEERLING_LEERLING.LEERJAAR} = '6'then
                  select(toNumber({@6MTOT}))
                      case '99': zone := 'A'
                      case '97': zone := 'A'
                      case '95': zone := 'A'
                      case '93': zone := 'A'
                      case '90': zone := 'A'
                      case '85': zone := 'A'
                      case '80': zone := 'A'
                      case '75': zone := 'A'
                      case '70': zone := 'B'
                      case '65': zone := 'B'
                      case '60': zone := 'B'
                      case '55': zone := 'B'
                      case '50': zone := 'B'
                      case '45': zone := 'C'
                      case '40': zone := 'C'
                      case '35': zone := 'C'
                      case '30': zone := 'C'
                      case '25': zone := 'C'
                      case '20': zone := 'D'
                      case '15': zone := 'D'
                      case '10': zone := 'E'
                      case '7': zone := 'E'
                      case '5': zone := 'E'
                      case '3': zone := 'E'
                      case '1': zone := 'E'
                      case '0': zone := 'E'
                      default: zone := '';)
      else
          if {?ParamPuntenboek} = 'Einde schooljaar' then
                  (if {LEERLING_LEERLING.LEERJAAR} = '3'then
                      select(toNumber({@3ETOT}))
                          case '99': zone := 'A'
                          case '97': zone := 'A'
                          case '95': zone := 'A'
                          case '93': zone := 'A'
                          case '90': zone := 'A'
                          case '85': zone := 'A'
                          case '80': zone := 'A'
                          case '75': zone := 'A'
                          case '70': zone := 'B'
                          case '65': zone := 'B'
                          case '60': zone := 'B'
                          case '55': zone := 'B'
                          case '50': zone := 'B'
                          case '45': zone := 'C'
                          case '40': zone := 'C'
                          case '35': zone := 'C'
                          case '30': zone := 'C'
                          case '25': zone := 'C'
                          case '20': zone := 'D'
                          case '15': zone := 'D'
                          case '10': zone := 'E'
                          case '7': zone := 'E'
                          case '5': zone := 'E'
                          case '3': zone := 'E'
                          case '1': zone := 'E'
                          case '0': zone := 'E'
                          default: zone := '';
                  if {LEERLING_LEERLING.LEERJAAR} = '4'then
                      select(toNumber({@4ETOT}))
                          case '99': zone := 'A'
                          case '97': zone := 'A'
                          case '95': zone := 'A'
                          case '93': zone := 'A'
                          case '90': zone := 'A'
                          case '85': zone := 'A'
                          case '80': zone := 'A'
                          case '75': zone := 'A'
                          case '70': zone := 'B'
                          case '65': zone := 'B'
                          case '60': zone := 'B'
                          case '55': zone := 'B'
                          case '50': zone := 'B'
                          case '45': zone := 'C'
                          case '40': zone := 'C'
                          case '35': zone := 'C'
                          case '30': zone := 'C'
                          case '25': zone := 'C'
                          case '20': zone := 'D'
                          case '15': zone := 'D'
                          case '10': zone := 'E'
                          case '7': zone := 'E'
                          case '5': zone := 'E'
                          case '3': zone := 'E'
                          case '1': zone := 'E'
                          case '0': zone := 'E'
                          default: zone := '';
                  if {LEERLING_LEERLING.LEERJAAR} = '5'then
                      select(toNumber({@5ETOT}))
                          case '99': zone := 'A'
                          case '97': zone := 'A'
                          case '95': zone := 'A'
                          case '93': zone := 'A'
                          case '90': zone := 'A'
                          case '85': zone := 'A'
                          case '80': zone := 'A'
                          case '75': zone := 'A'
                          case '70': zone := 'B'
                          case '65': zone := 'B'
                          case '60': zone := 'B'
                          case '55': zone := 'B'
                          case '50': zone := 'B'
                          case '45': zone := 'C'
                          case '40': zone := 'C'
                          case '35': zone := 'C'
                          case '30': zone := 'C'
                          case '25': zone := 'C'
                          case '20': zone := 'D'
                          case '15': zone := 'D'
                          case '10': zone := 'E'
                          case '7': zone := 'E'
                          case '5': zone := 'E'
                          case '3': zone := 'E'
                          case '1': zone := 'E'
                          case '0': zone := 'E'
                          default: zone := '';)
  )
  zone;
  </code></pre>