Einzelnen Beitrag anzeigen

michael.cohrs

Registriert seit: 11. Nov 2005
Ort: Hamburg
130 Beiträge
 
#27

AW: Objectlist sortieren

  Alt 11. Aug 2016, 15:50
Delphi-Quellcode:
procedure ReadGlobalInformations;
  Var
    j,z,k : Integer;
  Begin
    iCNT1 := 1;
    iPos1 := iGeneralPos[0];
    for k := 0 to sWriteDataSet.count -1 do
    Begin
      if k > 0 then
      Begin
        sGValueList.Clear;
        sGValueList.DelimitedText := StringReplace(sWriteDataSet[iCNT1],' ','_',[rfReplaceAll]);
        if sGValueList[iPosArt] <> 'then
        Begin
          for z := 1 to iPos1 - 1 do
          Begin
            if sGValueList[z] <> 'then
            Begin
              oArtValues := TArtValues.Create;
              oArtValues.iArtNr := StrToInt(sGValueList[iPosArt]);
              oArtValues.sArt := 'G';
              oArtValues.sDescription := ArtPropertyName[z];
              oArtValues.iColNr := z+1;


              sTemp0 := sGValueList[z];
              Delete(sTemp0,pos('\PIM_Webbilder\',sTemp0),Length('\PIM_Webbilder\'));
              oArtValues.sVal := StringReplace(sTemp0,'_',' ',[rfReplaceAll]);
              oArtValues.sVal255 := StringReplace(sTemp0,'_',' ',[rfReplaceAll]);
              FVArtValues.Add(oArtValues);
            end;
          end;
            INC(iCNT1);
        end
        else
          INC(iCNT1);
      end;
    end;
  end;

// General Informations
  procedure ReadGeneralInformations;
  Var
    z,k : Integer;
  Begin
    iCNT1 := 1;
    iPos1 := iGeneralPos[0];
    iPos2 := iGeneralPos[1];
    iPos3 := iGeneralPos[2];
    for k := 0 to sWriteDataSet.count -1 do
    Begin
      if k > 0 then
      Begin
        sGValueList.Clear;
        sGValueList.DelimitedText := StringReplace(sWriteDataSet[iCNT1],' ','_',[rfReplaceAll]);
        if sGValueList[iPosArt] <> 'then
        Begin
          for z := iPos1 to iPos2 - 1 do
          Begin
            if (sGValueList[iPos1] <> '') and (sGValueList[iPos2] <> '')then
            Begin
              oArtValues := TArtValues.Create;
              oArtValues.iArtNr := StrToInt(sGValueList[iPosArt]);
              oArtValues.sArt := 'A';
              oArtValues.sDescription := ArtPropertyName[iPos1];
              oArtValues.iColNr := iPos1+1;
              oArtValues.sVal := StringReplace(sGValueList[iPos1],'_',' ',[rfReplaceAll]);;
              oArtValues.sVal255 := sGValueList[iPos2];
              oArtValues._Unit := sGValueList[iPos3];
              FVArtValues.Add(oArtValues);
              INC(iPos1);
              INC(iPos2);
              INC(iPos3);
            end
            else
              Break;
          end;
          Begin
            INC(iCNT1);
         end;
        end
        else
          INC(iCNT1);
      end;
    end;
  end;

// Individually Informations
  procedure ReadIndividuallyInformations;
  Var
    z,k : Integer;
  Begin
    iCNT1 := 1;
    iPos4 := iIndividuallyPos[0];
    iPos5 := iIndividuallyPos[1];
    iPos6 := iIndividuallyPos[2];
    for k := 0 to sWriteDataSet.count -1 do
    Begin
      if k > 0 then
      Begin
        sGValueList.Clear;
        sGValueList.DelimitedText := StringReplace(sWriteDataSet[iCNT1],' ','_',[rfReplaceAll]);
        if sGValueList[iPosArt] <> 'then
        Begin
          for z := iPos4 to sGValueList.count{iPos5}- 1 do
          Begin
            sTemp0 :=sGValueList[iPos4];
            sTemp1 :=sGValueList[iPos5];
            sTEmp2 := IntToStr(z);
            if iPos6 < sGValueList.count - 1 then
            Begin
              if (sTemp0 <> '') and (sTemp1 <> '')then
              Begin
                oArtValues := TArtValues.Create;
                oArtValues.iArtNr := StrToInt(sGValueList[iPosArt]);
                oArtValues.sArt := 'I';
                oArtValues.sDescription := ArtPropertyName[iPos4];
                oArtValues.iColNr := iPos4+1;
                oArtValues.sVal := StringReplace(sGValueList[iPos4],'_',' ',[rfReplaceAll]);;
                oArtValues.sVal255 := sGValueList[iPos5];
                oArtValues._Unit := sGValueList[iPos6];
                FVArtValues.Add(oArtValues);
                INC(iPos4);
                INC(iPos5);
                INC(iPos6);
              end
              else
              Begin
                INC(iPos4);
                INC(iPos5);
                INC(iPos6);
              end;
            end
            else
              Break;

          end;
          Begin
            iPos4 := iIndividuallyPos[0];
            iPos5 := iIndividuallyPos[1];
            iPos6 := iIndividuallyPos[2];
            INC(iCNT1);
         end;
        end
        else
        INC(iCNT1);
      end;
    end;
  end;
Das sind die proceduren die die Daten lesen, auswerten und als Objekt in die Objektliste(FVArtValues) schreiben.

Die ArtikelNr. sind bedingt durch die 3 Aufrufe nicht sortiert in der Liste.
Das möchte ich im Anschluß der Aufrufe ändern.

VIELEN DANK!!
Michael Cohrs
  Mit Zitat antworten Zitat