execute method

void execute()

Implementation

void execute() {
  _aborted = false;
  _line = 0;
  final full = _script.text;
  final statements = full.split(terminator);
  for (final raw in statements) {
    final stmt = raw.trim();
    if (stmt.isEmpty) continue;
    _line++;
    final stop = TBoolRef(false);
    if (useCommit && stmt.toUpperCase() == 'COMMIT') {
      executeCommit();
    } else {
      final sl = TStringList();
      sl.text = stmt;
      executeStatement(sl, stop);
    }
    if (stop.value) {
      _aborted = true;
      break;
    }
    if (autoCommit) {
      executeCommit();
    }
  }
}