ObjGetProps

ObjGetProps liefert die Eigenschaften eines Diagramms oder eines Zeichenobjekts.

oProps = ObjGetProps(hObj)

Returnwert

oProps enthält die Eigenschaften eines Diagramms oder Zeichenobjekts, siehe LayerGetProps, TBGetProps, EBGetProps, LBGetProps, RBGetProps, TableGetProps, ImageGetProps.

Parameter

hObj

hObj ist die Zugriffsnummer einer Seite, eines Diagramms, eines Zeichenobjekts oder eines Datensatzes.

Kommentar

Bemerkung

Diese Funktion ist eine Beta-Version. Die Release-Version wird in einem der nächsten Updates fertig gestellt.

Hilfsfunktionen

props_flat

props_flat wandelt ein Objekt, dass weitere Objekte enthält, in ein Objekt mit nur noch einer Ebene um. Mit props_unflat kann das Ausgangsobjekt wieder erzeugt werden.

r = props_flat(o)
* a
[.
    b = [.
        c = 1
        d = [.
            a = 1
        ]
    ]
    c = "Hello"
]
* props_flat(a)
[.
    b.c = 1
    b.d.a = 1
    c = "Hello"
]

props_unflat

props_unflat siehe props_flat.

r = props_unflat(o)
* b
[.
    b.c = 1
    b.d.a = 1
    c = "Hello"
]
* props_unflat(b)
[.
    b = [.
        c = 1
        d = [.
            a = 1
        ]
    ]
    c = "Hello"
]

props_get

props_get liefert ein Objekt mit den angegebenen Schlüsseln (Keys).

r = props_get(o, keys)
* props_get([. a = 1, b = 2, c = 3], "a c")
[.
    a = 1
    c = 3
]

props_remove

props_remove entfernt Elemente aus einem Objekt.

r = props_remove(o, keys)
* props_remove([. a = 1, b = 2], "a")
[.
    b = 2
]
* props_remove([. a = 1, b = 2], "a b")
[.
]

props_fromstring

props_fromstring wandelt einen String mit „Key=Value“-Paaren in ein Objekt um.

o = props_fromstring(s)
* props_fromstring("a = 12.34 b = Hallo")
[.
    a = 12.34
    b = "Hallo"
]

props_tostring

props_tostring wandelt das Objekt in einen String oder eine 2-spaltige Stringmatrix um.

s = props_tostring(o)
s = props_tostring(o, options)

Der optionale zweite Parameter ist ein Objekt mit folgendem Defaultwert: [. tomatrix = 1, nodefault = 1].

* o = ObjGetProps(39)
* o
[.
    arrow-lenght = 5
    ...
    x1 = 4.7
]
* props_tostring(o)
x1     4.7
arrow-lenght   5

* props_tostring(o, [.tomatrix=0])
x1='4.7' arrow-lenght='5'

props_dialog

props_dialog gibt eine einfache Dialogbox aus mit der die Properties angezeigt und ausgewählt werden können. Das Ergebnis ist ein String mit den ausgewählten Eigenschafts-Namen (Keys).

s = props_dialog(o)

props_diff

props_diff liefert alle Properties aus o1 und o2 die nicht gleich sind. Die Property-Werte werden o1 entnommen, falls vorhanden.

r = props_diff(o1, o2)
* props_diff([. a = 1, b = 1], [. a = 1, b = 2, c = 3])
[.
    b = 1
    c = 3
]

History

Version Beschreibung
R2016 Neu.

id-1611894