FlexPro
HistoryBase
Engineering
Training
Downloads
FlexPro-Support
Wissen
Community
Über Uns
Referenzen
Jobs
Allgemeiner Kontakt
Händlerverzeichnis
FlexPro-Support
DE
EN
FR
Placeholder
Produkte und Lösungen
Support und Downloads
Unternehmen
Magazin
Kontakt
Sprache
MyWeisang

Account Einstellungen

Topic

Wert ungültig setzen

Startseite ' Community ' Allgemein ' Wert ungültig setzen

Anzeigen von 7-Stellen - 1 bis 7 (von insgesamt 7)
  • Autor
    Beiträge
  • #34086
    Marius Schmidt
    Teilnehmer

    Ich möchte einen bestimmten Wert in allen Datensätzen eines Ordners ungültig setzen. Mit welcher Funktion erreiche ich dies? Wichtig ist mir dabei, dass ich diesen Schritt nicht separat für jeden einzelnen Datensatz durchführen muss, denn es sind weit über 60 Datensätze in dem Ordner.

    #34092
    Marius Schmidt
    Teilnehmer

    Ich möchte einen bestimmten Wert in allen Datensätzen eines Ordners ungültig setzen. Mit welcher Funktion erreiche ich dies? Wichtig ist mir dabei, dass ich diesen Schritt nicht separat für jeden einzelnen Datensatz durchführen muss, denn es sind weit über 60 Datensätze in dem Ordner.

    #34087
    Bernhard Kantz
    Teilnehmer

    There is a property names “Object.Names” to obtain the names of objects in a folder. Optionally this property accepts “wildcard” characters to restrict the object to be addressed.
    Once you have the list of object names, you can use the indirection operator $$ to access the objects.

    With The following example you get all datasets of the folder which includes the FPScript formula:
    [code]
    Dim names, i
    names = ..Objects({“.*.dat”}).Names
    For Each Row i in names Do
    dim data = $names[i]$
    data[10] = ?
    End
    [/code]

    See also “How can I access all objects in the root folder with FPScript?” in the FPScript forum

    Support@weisang.com

    #34088
    Marius Schmidt
    Teilnehmer

    Kann diese Anweisung auch in FlexPro 6.0 übertragen werden, bzw. wie würde sie dann lauten?

    #34089
    Bernhard Kantz
    Teilnehmer

    That’s possible with [b]ObjectNames[/b].
    [code]
    Dim names, i
    names = $.Path : “.FLD”$.ObjectNames({“.*.dat”})

    For Each Value i in names Do
    dim data
    data = $names[i]$
    data[10] = ?
    End
    [/code]

    support@weisang.com

    #34090
    Marius Schmidt
    Teilnehmer

    Und wie erreiche ich nun, dass in allen Datensätzen z.B. der Wert “-3,40282e+038” ungültig gesetzt wird.

    #34091
    Bernhard Kantz
    Teilnehmer

    You can search the index of a value with the FPScript function [b]SearchValue[/b]. With FPScript you cannot directly manipulate a data set. In this case you have to write a VBA macro. But the formula can return the new calculated values.
    [code]
    Dim data
    data = dataset
    data[SearchValue(data, -3.40282e+038)] = ?
    data
    [/code]
    In FlexPro 7 a FPScript formula can return a list with the datasets. In FlexPro 6 you need a formula for each data set.
    In this case it’s better to create a VBA macro with FlexPro Professional. With FlexPro Standard you cannot automate these steps.

    Do these steps:
    1) Create the formula ‘ReplaceValue’ with the arguments data and value which replaces the value with ‘?’.
    [code]
    Arguments data, value
    Dim dd
    dd = data
    dd[SearchValue(dd, value)] = ?
    dd
    [/code]
    2) Write a macro which creates one formula for each dataset.
    [code]
    ReplaceValue(dataset, value)
    [/code]
    With VBA you can also convert (evaluate) these formulas into a dataset and delete the origin data sets.

    Support@weisang.com

Anzeigen von 7-Stellen - 1 bis 7 (von insgesamt 7)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.