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

Zugriff auf eine Datenmatrix über die Range Methode

Page d'accueil ' Communauté ' Automation et VBA ' Accès à une matrice de données via la méthode Range

Voir les messages de 3 - 1 à 3 (sur un total de 3)
  • Auteur
    Messages
  • #34953
    Norbert Ramm
    Participant

    Hallo,
    wie ist es möglich, in eine Kanal der eine Matrixstruktur hat über die Range Anweisung
    einen Abschnitt einer beliebigen Spalte mit
    dem Inhalt eines Arrays zu füllen ?

    Auf einzelne Werte in der Matrix kann wie im
    Beispiel zugegriffen werden.

    Option Explicit
    Public Kanal As DataSet

    Sub Test()
    Dim Wert(3) As Double
    Wert(0) = 11
    Wert(1) = 22
    Wert(2) = 33
    Wert(3) = 44

    If Kanal Is Nothing Then

    Set Kanal = ActiveDatabase.ActiveFolder.Add(“Matrix”, fpObjectTypeDataSet, fpNameClashHandlingOverwrite)
    Kanal.DataStructure = fpDataStructureDataMatrix
    Kanal.DataType(fpDataComponentX) = fpDataTypeFloat32
    Kanal.DataType(fpDataComponentY) = fpDataTypeFloat32
    Kanal.DataType(fpDataComponentAll) = fpDataTypeFloat32
    Kanal.NumberOfColumns = 4
    Kanal.NumberOfRows = 9
    Kanal.FillColumns “(NumberOfValues(i), FloatingPoint32 0, FloatingPoint32 0)”, fpDataComponentAll
    Kanal.Update

    End If

    Kanal.Value(fpDataComponentY, 1, 4) = 40 ‘ i.O.

    Kanal.Range(fpDataComponentY, 1, 1, 1, 4) = Wert ‘ Fehler, Objekt unterstützt Methode nicht

    End Sub

    Hat jemand eine Idee was ich hier falsch mache ?

    #34955
    Norbert Ramm
    Participant

    Hallo,
    wie ist es möglich, in eine Kanal der eine Matrixstruktur hat über die Range Anweisung
    einen Abschnitt einer beliebigen Spalte mit
    dem Inhalt eines Arrays zu füllen ?

    Auf einzelne Werte in der Matrix kann wie im
    Beispiel zugegriffen werden.

    Option Explicit
    Public Kanal As DataSet

    Sub Test()
    Dim Wert(3) As Double
    Wert(0) = 11
    Wert(1) = 22
    Wert(2) = 33
    Wert(3) = 44

    If Kanal Is Nothing Then

    Set Kanal = ActiveDatabase.ActiveFolder.Add(“Matrix”, fpObjectTypeDataSet, fpNameClashHandlingOverwrite)
    Kanal.DataStructure = fpDataStructureDataMatrix
    Kanal.DataType(fpDataComponentX) = fpDataTypeFloat32
    Kanal.DataType(fpDataComponentY) = fpDataTypeFloat32
    Kanal.DataType(fpDataComponentAll) = fpDataTypeFloat32
    Kanal.NumberOfColumns = 4
    Kanal.NumberOfRows = 9
    Kanal.FillColumns “(NumberOfValues(i), FloatingPoint32 0, FloatingPoint32 0)”, fpDataComponentAll
    Kanal.Update

    End If

    Kanal.Value(fpDataComponentY, 1, 4) = 40 ‘ i.O.

    Kanal.Range(fpDataComponentY, 1, 1, 1, 4) = Wert ‘ Fehler, Objekt unterstützt Methode nicht

    End Sub

    Hat jemand eine Idee was ich hier falsch mache ?

    #34954
    Bernhard Kantz
    Participant

    Your example only works if you want to fill a data series. Create a two-dimensional array to fill a data matrix.
    Example:
    [code]
    Dim oValue(0, 3) As Single
    oValue(0, 0) = 11
    oValue(0, 1) = 22
    oValue(0, 2) = 33
    oValue(0, 3) = 44

    oDataset.Range(fpDataComponentY, 1, 1, 1, 4).Value = oValue
    [/code]

    support@weisang.com

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