ToString (objectlist)
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: