ToString (objectlist)

De Wiki1000
Version du 25 février 2020 à 14:47 par Syfre (discuter | contributions)
(diff) ← Version précédente | Voir la version courante (diff) | Version suivante → (diff)
function ToString(iIndex:Integer; iCount:Integer; iPropName:string; iDoubleQuote:boolean):string

Cette méthode retourne une chaîne liste de valeurs.

iIndex Index de départ
iCount Nombre max a retourner
iPropName Nom de l'attribut à sérialiser
iDoubleQuote Ajouter des quotes aux valeurs retourner


Pseudo code équivalent:

function ToString(iIndex:Integer; aCount:Integer; iPropName:string; iDoubleQuote:boolean; const iSep:String=','):String;
var indx:Integer; AStr,stag:string; isOID:boolean;
begin
  isOID := SameText(iPropName,'oid') or SameText(iPropname,'InstanceOID');
  //
  Result := ''; stag := '';
  indx := iIndex;
  if ACount=-1 then ACount := Count;
  while (indx<Count) and (ACount>0) do
    begin
      if isOID
        then AStr := OIDs[indx]
        else AStr := SafeVarToStr(Refs[indx].GetPropAsVariant(iPropName));
 
      if iDoubleQuote then AStr := Doublequote(AStr);
 
      Result := Result+stag+AStr;
      stag := iSep;
      Inc(indx);
      dec(ACount);
    end;
end;

Voir aussi:

Listes d'objets (tech)Développement DSM





Whos here now:   Members 0   Guests 1   Bots & Crawlers 0
 
Outils personnels