addFull method

TFieldDef addFull(
  1. String aName,
  2. TFieldType aDataType,
  3. int aSize,
  4. int aPrecision,
  5. bool aRequired,
  6. bool aReadOnly,
  7. int aFieldNo,
  8. TSystemCodePage aCodePage,
)

Implementation

TFieldDef addFull(String aName, TFieldType aDataType, int aSize,
    int aPrecision, bool aRequired, bool aReadOnly, int aFieldNo,
    TSystemCodePage aCodePage) {
  final result = fieldDefClass(this, makeNameUnique(aName), aDataType,
      aSize, aRequired, aFieldNo, aCodePage);
  switch (aDataType) {
    case TFieldType.ftBCD:
    case TFieldType.ftFMTBcd:
      result.precision = aPrecision;
      break;
    default:
      break;
  }
  if (aReadOnly) {
    result.attributes = {...result.attributes, TFieldAttribute.faReadonly};
  }
  return result;
}