public string[] SelectFirst(string[] FieldNames, string WhereWhat, string EqualsValue) { string[] sarrReturn=null; if (FieldNames!=null&&FieldNames.Length>0) { int[] iarrFieldAbs=new int[FieldNames.Length]; sarrReturn=new string[FieldNames.Length]; for (int iFieldRel=0; iFieldRel<FieldNames.Length; iFieldRel++) { try { iarrFieldAbs[iFieldRel]=this.InternalColumnIndexOf(FieldNames[iFieldRel]); } catch (Exception exn) { RReporting.ShowExn(exn,"getting column index and finding row","rtable SelectFirst(...){FieldNames["+iFieldRel.ToString()+"]:\""+RReporting.SafeIndex(FieldNames,iFieldRel,"FieldNames")+"\"}"); } } int iWhat=this.InternalColumnIndexOf(WhereWhat); int iRow=-1; if (iWhat>-1) { iRow=this.InternalRowIndexOfFieldValue(iWhat,EqualsValue); if (iRow>-1) { for (int iFieldRel=0; iFieldRel<FieldNames.Length; iFieldRel++) { sarrReturn[iFieldRel]=this.tearr[iRow].Field(iarrFieldAbs[iFieldRel]); if (sarrReturn[iFieldRel]==null) RReporting.ShowErr("Getting row "+iRow+" failed.","selecting database row","string array SelectFirst(...)"); } } else RReporting.Warning("Nothing to Select","selecting fields from table by value","rtable SelectFirst(FieldNames,WhereWhat=\""+RReporting.StringMessage(WhereWhat,true)+"\",EqualsValue=\""+RReporting.StringMessage(EqualsValue,true)+"\")"); } else RReporting.ShowErr("Cannot find column \""+RReporting.StringMessage(WhereWhat,true)+"\"","selecting fields from table by value","rtable SelectFirst"); } else RReporting.ShowErr((FieldNames==null)?"null":"zero-length"+" FieldNames--can't select.","selecting fields from table","rtable Select(FieldNames,WhereWhat=\""+RReporting.StringMessage(WhereWhat,true)+"\",EqualsValue=\""+RReporting.StringMessage(EqualsValue,true)+"\")"); return sarrReturn; }//end SelectFirst