FlexPro
HistoryBase
Ingénierie
Formation
Téléchargements
Support FlexPro
Connaissance
Communauté
À propos de nous
Références
Emplois
Contact général
Liste des revendeurs
Support FlexPro
FR
DE
EN
Porte-plaquette
Produits et solutions
Support et téléchargements
Entreprise
Magazine
Contact
Langue
MyWeisang

Paramètres du compte.

Topic

CalculateColumns exemple

Page d'accueil ' Communauté ' Automation et VBA ' CalculateColumns exemple

Voir les messages de 5 - 1 à 5 (sur un total de 5)
  • Auteur
    Messages
  • #34970
    Nicolas Beaupré
    Participant

    Hi, could you give me a proper exemple of how to use the CalculateColumns function for a dataset ?

    I got S as a dataset
    I want to add an offset to all y-data of that dataset.. I tried that, based on the helpfile, but it didn’t work…
    [code]Formule (as string) = “x + ” & offset
    S.CalculateColumns Formule, fpDataComponentY[/code]

    Also, I want to select just a small part of my entire dataset. I tried that code :
    [code]Formule = x[[StartTime, EndTime]]
    S.CalculateColumns Formule, fpDataComponentAll[/code]

    Both method are working fine in FScript… I tought CalculateColumns method was the same as FScript.

    #34974
    Nicolas Beaupré
    Participant

    Hi, could you give me a proper exemple of how to use the CalculateColumns function for a dataset ?

    I got S as a dataset
    I want to add an offset to all y-data of that dataset.. I tried that, based on the helpfile, but it didn’t work…
    [code]Formule (as string) = “x + ” & offset
    S.CalculateColumns Formule, fpDataComponentY[/code]

    Also, I want to select just a small part of my entire dataset. I tried that code :
    [code]Formule = x[[StartTime, EndTime]]
    S.CalculateColumns Formule, fpDataComponentAll[/code]

    Both method are working fine in FScript… I tought CalculateColumns method was the same as FScript.

    #34971
    Bernhard Kantz
    Participant

    [b]Expression.CalculateColumns(Formula, RowFrom, RowTo)[/b]

    Expression is an expression which returns an object of type DataSet.

    Example (in the root folder exists the dataset ‘S’):
    [Code]
    Dim oDataset As DataSet
    Dim str As String
    str = “x + 5”
    Set oDataset = ThisDatabase.RootFolder.Object(“S”, fpObjectTypeDataSet)
    oDataset.CalculateColumns str, fpDataComponentY
    [/Code]

    support@weisang.com

    #34972
    Nicolas Beaupré
    Participant

    This is exactly what I did! I tried again and it works only when the dataset “S” is in the rootfolder. If I select a dataset in another folder, I can’t make it work. I get the message : “Invalid procedure call or argument”
    Here is my code :[code] Dim oDataset As DataSet
    Dim str As String

    Set oDataset = ActiveDatabase.ActiveFolder.Object(“S”, fpObjectTypeDataSet)
    str = oDataset.FullName ‘Here I check if the correct dataset is selected
    str = “x + 5”
    oDataset.CalculateColumns str, fpDataComponentY[/code]
    This code work fine when S is in the rootfolder, but it doesn’t when S is in a folder (but I checked that the dataset is well selected)

    I’m confused…

    #34973
    Bernhard Kantz
    Participant

    Thanks for this information!
    That seems to be a bug in the automation interface.
    We’ll fix this bug in the next release.

    Support@weisang.com

Voir les messages de 5 - 1 à 5 (sur un total de 5)
  • Vous devez être connecté pour répondre à ce sujet.