How to continue a “For Each Value” Loop in FPScript?

SupportCommunity FPScript How to continue a “For Each Value” Loop in FPScript?

Ansicht von 3 Beiträgen - 1 bis 3 (von insgesamt 3)
  • Autor
    Beiträge
  • #12823
    Sven WickSven Wick
    Mitglied

    Hi,

    here is a snippet from one of our Python scripts,
    which I would like to port to FPScript.

    
    
    ...
    
    import fileinput
    
    for line in fileinput.input():
    
      if not CURRENT_TEMP > RANGE_MIN and CURRENT_TEMP  RANGE_MIN And CURRENT_TEMP < RANGE_MAX Then
     
       // Do nothing. Just get the next value
     
     End
    
     // ...
    
    End
    
    #8480
    Sven WickSven Wick
    Mitglied

    Hi,

    here is a snippet from one of our Python scripts,
    which I would like to port to FPScript.

    ...

    import fileinput

    for line in fileinput.input():

    if not CURRENT_TEMP > RANGE_MIN and CURRENT_TEMP < RANGE_MAX: continue ... [/code] It seems, there is no way in FPScript to just skip to the next iteration. I would like to do something like this: [code] For Each Value CURRENT_TEMP In Messdaten\T_MWE_2 Do If Not CURRENT_TEMP > RANGE_MIN And CURRENT_TEMP < RANGE_MAX Then // Do nothing. Just get the next value End // ... End [/code]

    #9295
    Bernhard KantzBernhard Kantz
    Moderator

    The following code should work. But should avoid such loops and use the Event Isolation Analysis object.

    
    Dim CURRENT_TEMP
    Dim RANGE_MIN = 600
    Dim RANGE_MAX = 800
    
    For Each Value CURRENT_TEMP In T_MWE_2 Do
     
     If Not (CURRENT_TEMP > RANGE_MIN And CURRENT_TEMP < RANGE_MAX) Then
     
       // Do nothing. Just get the next value
     
     End
      // ...
    End
    

    Support@weisang.com

Ansicht von 3 Beiträgen - 1 bis 3 (von insgesamt 3)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.