Showing results 1 to 3 of 3

Thread: EdLimit DynProperties("Function")

  1. #1

    Default EdLimit DynProperties("Function")

    Hi to all,
    I need to read the DynProperties("Function").Name in a Wizard, associated to a variable that has some limit enabled.

    Unfortunately I continue to get runtime errors in VBA when there is no function specified on the limit.

    It works only if there is a function string inside the field.

    Is there a safe way to know if a variable limit has a function specified? This is the list of usable dynproperties for an EdLimit object:


    0: Color
    1: UserProperty2
    2: UserProperty1
    3: Alarm
    4: FlagActiv
    5: FlagAQuit
    6: Delay
    7: IsVariable
    8: Variable
    9: AlarmAcknowledge
    10: FlagClassID
    11: FlagMessage
    12: Text
    13: Blinking
    14: HelpFile
    15: FlagInvisible
    16: AlarmDelete
    17: Group
    18: FlagTreshold
    19: FlagLimitVar
    20: FlagFunction
    21: FlagUser2
    22: FlagUser1
    23: ThresholdValue
    24: FlagAColor
    25: Print
    26: Function
    27: FlagToDelete
    28: IsMax
    29: Active
    30: Cel
    31: AML_Call
    32: Class
    33: FlagAlarmPrt
    34: FlagLimitVariable
    35: HelpCapture
    36: FlagAlarm
    37: FlagQuest
    38: LimitValue
    39: FlagDelay
    40: FlagIsAlarm
    41: FlagHelpCapture
    42: Invisible
    43: FlagToCEL
    44: FlagLimitIsMax
    45: FlagGroup
    46: FlagBlinking
    47: FlagHelpFile

  2. #2
    Best Answer

    Default Re: EdLimit DynProperties("Function")

    Hi carlo.chiari,

    welcome to the forum!

    One example how this could be checked is shown below (there may be other ways as well, but this works OK)

    Sub PrintAlarmFnc()
    Dim obVar As Variable
    Dim obEDLimit As EdLimit
    Dim obFnc As RtFunction
    Dim i As Integer
    Dim j As Integer
    
    For i = 0 To MyWorkspace.ActiveDocument.Variables.Count - 1
        Set obVar = MyWorkspace.ActiveDocument.Variables.Item(i)
        If (Not obVar Is Nothing) Then
            For j = 0 To obVar.EdLimitCount - 1
                Set obEDLimit = obVar.EdLimitItem(j)
                On Error Resume Next
                If (Not obEDLimit Is Nothing) Then
                    Set obFnc = obEDLimit.DynProperties("Function")
                    If (Not obFnc Is Nothing) Then
                        Debug.Print obFnc.Name
                    End If
                End If
            Next j
        End If
    Next i
    End Sub

    Best regards,
    Mark

  3. #3

    Default Re: EdLimit DynProperties("Function")

    Thank you so much Mark, no I can finish the job.

    Regards.

Similar Threads

  1. RGM - VBA - ".Save" / ".Read" - change recipe status
    By markclemens in forum zenon Supervisor
    Replies: 12
    Last Post: 29th September 2014, 12:25
  2. Replies: 1
    Last Post: 19th May 2011, 05:54
  3. Replies: 2
    Last Post: 9th June 2009, 12:53
  4. Replies: 5
    Last Post: 28th November 2008, 10:49
  5. function "Export Data" on Windows CE
    By martinw in forum zenon Operator
    Replies: 0
    Last Post: 20th August 2007, 07:01

Posting Rules

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