GetAspects

Ukázka získání názvů a hodnot aspektů z DMS

Popis

declare procedure GetEnter dll "ActualDocument" (string)

declare function Dms_ExecuteQuery dll "ActualDocument" (string, var integer, pointer): integer
declare function Dms_GetDocument dll "ActualDocument" (integer, integer): integer
declare function DmsDocument_GetAspectCount dll "ActualDocument" (integer): integer
declare function DmsDocument_GetAspectName dll "ActualDocument" (integer, integer): string
declare function DmsDocument_GetAspect dll "ActualDocument" (integer, integer): string

script GetAspects (): string
var
  Index: integer
  QryRes: integer
  DocCount: integer
  DocDesc: integer
  AspCount: integer
  Enter: string
  Aspect: string
  AspName: string
begin
  GetEnter(Enter)
  QryRes := Dms_ExecuteQuery("(dokument_nazev = ""*test*"")", DocCount, actualdocument)

  if DocCount > 0 then
    DocDesc := Dms_GetDocument(QryRes, 0)
    AspCount := DmsDocument_GetAspectCount(DocDesc)

    for Index := 0 to AspCount -1 do
      AspName := DmsDocument_GetAspectName(DocDesc, Index)
      Aspect := DmsDocument_GetAspect(DocDesc, Index)
      Result += AspName + " - " + Aspect + Enter
    end
  end

  write(Result)
end