Informační tok Funkční structura Datová struktura ER model Modulová struktura Typová struktura Relační model Dokumentace


[Celkový datový model] [Funkce] [Externí rohraní] [Stavové diagramy] [Datové elementy] [Entity] [Relace]
[Databáze] [Události] [Materiály] [Generovací funkce] [Vyhodnocovací funkce] [Konfigurace] [Uživatelé] [Projekt] [Home]



Vyhodnocovací funkce
QueryRelAttr
(OLE Functions for MS Word)


Vytvořeno: 01-20-1997 10:07:45
Poslední změna: 11-28-2002 10:23:35

Outputs information about relations and their relationships shown in the specified relational model; the amount of information on attributes can be customized by parameters.

Modul

Module: OLE Functions for MS Word

Zdrojový kód:

PROCEDURE QueryRelAttr(diagname$, which$)
BEGIN
    PRINT {"Arial", 12, BOLD} "Atributy v relačním modelu ";
    FOR Relarea WHERE Name = diagname$ DO
        PRINT {"Arial", 12, BOLD, ITALIC} CONV$(Boxname);
    END
    PRINT {"Arial", 12, BOLD} ":", NL, NL;
    FOREACH Relnode WHERE Area = diagname$
                    ORDER BY Relation DO
        FOR Relation WHERE Name = Relnode.Relation DO
            PRINT {"Arial", 10, BOLD} CONV$(Boxname), NL;
        END
        found%=0;
        PRINT {"Arial", 8, BOLD} TAB(4), "Atributy", NL;
        FOREACH Relattribute WHERE Relation = Relnode.Relation ORDER BY Position DO
            found%=1;
            PRINT TAB(4);
            IF INSTR(which$, "k") > 0 AND Pkey<>0 THEN
                PRINT {"Arial", 8, UNDERLINE} Name;
            ELSE
                PRINT {"Arial", 8} Name;
            END
            addtab%=0;
            IF INSTR(which$, "i") > 0 THEN
                PRINT {"Arial", 8} " (", Id,")";
                addtab%=36;
            ELSE
                addtab%=26;
            END
            IF INSTR(which$, "d") > 0 AND Data <> "" THEN
                FOR Data WHERE Name=Relattribute.Data DO
                    PRINT {"Arial", 8} TAB(4+addtab%), Boxname;
                END
                addtab%=addtab%+25;
            END
            IF INSTR(which$, "t") > 0 THEN
                CALL DataElementType(Data, Typename$);
                IF Typename$ <> "" THEN
                    PRINT {"Arial", 8} TAB(4+addtab%), Typename$;
                END
            END
            PRINT {"Arial", 8} NL;
        END
            
        // Attribute in Index?
        IF INSTR(which$, "k") > 0 THEN // only if key is required
            index% = 0;
            FOREACH Index WHERE Relation = Relnode.Relation DO
                IF index% = 0 THEN
                    PRINT {"Arial", 8, BOLD} NL, TAB(4), "Indexy", NL;
                    index% = 1;
                END
                PRINT {"Arial", 8} TAB(4) , Name, NL;
                indexattr% = 0;
                FOREACH Indexattribute WHERE Relation = Relnode.Relation
                                         AND Index = Index.Name ORDER BY Position DO
                    PRINT {"Arial",8} TAB(8), Attribute, NL;
                    indexattr% = 1;
                END
                IF indexattr% = 0 THEN
                    PRINT {"Arial", 8, ITALIC} TAB(8), "Neexistují atributy.",NL;
                END
            END
        END
        PRINT {"Arial", 8} NL;
        
         // show descriptions
        IF INSTR(which$, "c") > 0 THEN
            foundText% = 0;
            FOREACH Relattribute WHERE Relation = Relnode.Relation ORDER BY Position DO
                IF Text <> "" THEN
                    IF foundText% = 0 THEN
                        foundText% = 1;
                        PRINT {"Arial", 8, BOLD} NL, "Popis atributů", NL(2);
                    END
                    PRINT {"Arial", 8} Name, ": ", NL;
                    PRINT Text, NL;
                END
            END
        END
        
        
        IF found%=0 THEN
            PRINT {"Arial",10,ITALIC} TAB(4),"Neexistují atributy.",NL;
        END
        PRINT NL;
    END
END


Generováno: 16.10.2003 7:41 Systém: C:\Documents and Settings\hajsman\Dokumenty\Vyuka\Irs2\Projekt case40\Projekt03.csf Generováno systémem case/4/0
Vygeneroval: Administrator Soubor: C:\Documents and Settings\hajsman\Dokumenty\Vyuka\Irs2\Projekt case40\html\8316.htm (C) microTOOL GmbH 2002