Showing results 1 to 2 of 2

Thread: Change RtFunctions parameters in VBA

  1. #1
    Join Date
    27.08.2008
    Posts
    50

    Default Change RtFunctions parameters in VBA

    Hello!

    I want to get rid of the "Linked variable not found:" messages without erasing the functions.

    It is not possible to change the ParamString because it's "Read only" so i tried to set the type to a beep sound, which seemed to work, but there was no change in the Editor.

    Code:
    Dim iX As Integer
    
    For iX = 0 To thisProject.RtFunctions.Count - 1
    If thisProject.RtFunctions.Item(iX).ParamString = "xxx" And thisProject.RtFunctions.Item(iX).Type = "13" Then
    
        'thisProject.RtFunctions.Item(iX).ParamString = "Internal.Dummy.....off->"
        thisProject.RtFunctions.Item(iX).Type = "74"
    
    End If
    Next iX
    
    End Sub
    My VB knowledge is not very good, sorry for that.

    Thank you!

  2. #2
    Join Date
    27.08.2008
    Posts
    50

    Default Re: Change RtFunctions parameters in VBA

    Solution found.

    Module:
    Code:
    Public Function setFunctionParameter(ByRef obFunc As RtFunction, sVar As variable, sParameter As Integer) As Boolean
    
    setFunctionParameter = True
    
        With obFunc
            .DynProperties("SetValue.Variable") = sVar
            .DynProperties("SetValue.NumValue") = sParameter
            .DynProperties("SetValue.IsDirect") = True
        End With
        Exit Function
    
    End Function
    Code:
    Private Sub CommandButton74_Click()
    Dim iX As Integer
    Dim obFunc As RtFunction
    Dim obVar As variable
    
    For iX = 0 To thisProject.RtFunctions.Count - 1
    If thisProject.RtFunctions.Item(iX).ParamString = "xxx" And thisProject.RtFunctions.Item(iX).Type = "13" Then
        
        Set obFunc = thisProject.RtFunctions.Item(iX)
        Set obVar = thisProject.Variables.Item("Internal.Dummy")
        
        imFunc.setFunctionParameter obFunc, obVar, 1
        
    End If
    Next iX
    
    End Sub

Similar Threads

  1. Start Program error with parameters
    By maurodx in forum zenon Supervisor
    Replies: 2
    Last Post: 16th November 2009, 06:51
  2. Change the Ip Address in Zenon 5.5
    By sikenga in forum zenon Network
    Replies: 1
    Last Post: 9th June 2009, 13:09
  3. Parameters in Property window greyed out?
    By dak2483 in forum zenon Supervisor
    Replies: 1
    Last Post: 25th September 2008, 14:24
  4. Replies: 0
    Last Post: 21st August 2007, 08:15

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •