Jump to content

RayTmsk

Members
  • Content Count

    6
  • Joined

  • Last visited

Everything posted by RayTmsk

  1. Hi all! I need to set object from several types of arrays: procedure SetAsGuidArray(SourceItems: TArray<TGuid>); procedure SetAsIntArray(SourceItems: TArray<integer>); procedure SetAsStringArray(SourceItems: TArray<string>); and so on... What is modern way for do this without many code? procedure SetAsAnyArray(SourceItems: TArray<??>); will be good but impossible... may be interesting way exist for such constructions ?
  2. Yes, I want to do copies. As stupid decision planning to create several internal array for hold data: FDataArrayGuids, FDataArrayStrings, FDataArrayIntegers... I find good method as sample unit System.Generics.Collections; class function TArray.ToString<T>
  3. Hmm... but how to detect real type of T ? in first iterations I need for int, guid, string, float. Any reference to vcl source or article, please... 🙂
  4. Yes, you are right. But.. What about topic question?
  5. Not tested now but... I'd like to think it works the same way as the strings. Reference at first assign and hard copy while changing.
  6. procedure TDataField.SetAsGuidArray(SourceItems: TArray<TGuid>); begin DataType := ftArray; FArrayItemType := ftGuid; FDataArrayGuids := SourceItems; end;
×