int STRBLK::CompVal(PVAL vp, int n) { ChkIndx(n); ChkTyp(vp); if (vp->IsNull() || !Strp[n]) DBUG_ASSERT(false); return strcmp(vp->GetCharValue(), Strp[n]); } // end of CompVal
void STRBLK::SetValue(PVAL valp, int n) { ChkIndx(n); ChkTyp(valp); if (!valp->IsNull()) SetValue((PSZ)valp->GetCharValue(), n); else Strp[n] = NULL; } // end of SetValue
void CHRBLK::SetValue(PVAL valp, int n) { bool b; ChkIndx(n); ChkTyp(valp); if (!(b = valp->IsNull())) SetValue((PSZ)valp->GetCharValue(), n); else Reset(n); SetNull(n, b && Nullable); } // end of SetValue
void TYPBLK<TYPE>::SetValue(PVAL valp, int n) { bool b; ChkIndx(n); ChkTyp(valp); if (!(b = valp->IsNull())) Typp[n] = GetTypedValue(valp); else Reset(n); SetNull(n, b && Nullable); } // end of SetValue
int STRBLK::Find(PVAL vp) { int i; PSZ s; ChkTyp(vp); if (vp->IsNull()) return -1; else s = vp->GetCharValue(); for (i = 0; i < Nval; i++) if (Strp[i] && !strcmp(s, Strp[i])) break; return (i < Nval) ? i : (-1); } // end of Find
int CHRBLK::Find(PVAL vp) { ChkTyp(vp); int i; bool ci = Ci || vp->IsCi(); PSZ s = vp->GetCharValue(); if (vp->IsNull()) return -1; for (i = 0; i < Nval; i++) { if (IsNull(i)) continue; GetValPtrEx(i); // Get a zero ended string in Valp if (!((ci) ? strnicmp(s, Valp, Long) : strncmp(s, Valp, Long))) break; } // endfor i return (i < Nval) ? i : (-1); } // end of Find