/*
 * Attribute.rexx
 * Beispiel-ARexx-Skript zu TurboBase   © Michael Friedrich
 *
 * Dieses Skript druckt zahlreiche Informationen zum aktuellen Objekt.
 *
 */


Options FailAt 90

/* Dies wird benötigt, um die Ergebnisse in RESULT zurückzuerhalten */
Options Results

/* Wir wollen mit TurboBase kommunizieren */
ADDRESS TBASE

CONTEXT.USER

GETATTR TYP
IF rc~=0 then exit
say "Objekttyp: " RESULT

GETATTR NAME
if rc==0 then say "Objektname: " RESULT

GETATTR PROJEKTNAME
if rc==0 then say "Projektname: " RESULT


GETATTR FILTER
if rc==0 then
  if RESULT ~= "" then say "Filter: " RESULT
                  else say "Filter: kein Filter"

GETATTR INDEX
if rc==0 then
  if RESULT ~= "" then say "Index: " RESULT
                  else say "Index: kein Index"


say " "
say "======================================================"
say "Feld-Informationen:"
say "-------------------"

GETATTR FELDANZAHL
if rc==0 then do
   say "Feldanzahl: " RESULT
   Anzahl = RESULT
   do i = 1 to Anzahl
     say "    Feld " i
     GETATTR FELDNAME i
     if rc==0 then say "        Name: " RESULT
     GETATTR FELDTYP i
     if rc==0 then say "        Typ: " RESULT
  end
end

say " "
say "======================================================"
say "Datensatz-Informationen:"
say "------------------------"
GETATTR GESAMTZAHL
if rc==0 then say "Anzahl Sätze in dieser Datenbank: " RESULT
         else say "Keine aktuelle Datenbank!"

GETATTR DATENSATZZAHL
if rc==0 then say "Anzahl ausgewählter Sätze (Filter): " RESULT



say " "
say "======================================================"
say "Fenster-Koordinaten:"
say "--------------------"
GETATTR LINKS
if rc==0 then say "    Links: " RESULT
GETATTR OBEN
if rc==0 then say "    Oben: " RESULT
GETATTR BREITE
if rc==0 then say "    Breite: " RESULT
'GETATTR HÖHE'
if rc==0 then say "    Höhe: " RESULT

