Re-Writing IF-THEN-AND-ENDIF code?


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Jessey,
    Here is a small refinement to your IF-THEN-ENDIF
    Code:
      Temp = Seconds + Minutes + Hours + Seconds_Alarm_Set_Point + _
                   Minutes_Alarm_Set_Point + Hours_Alarm_Set_Point
      IF Temp <> 0 THEN  'Not Equal to 0
                         '<- Eliminates the unused ELSE
          IF Start_Stop_Mode = StartTime THEN   
              IF Hours = Hours_Alarm_Set_Point THEN
                  IF Minutes = Minutes_Alarm_Set_Point THEN
                      IF Seconds = Seconds_Alarm_Set_Point THEN
                          GOSUB StopTimer
                          LOW Clock_Active_Green_Led : Alarm_Is = On_  
                       ENDIF
                  ENDIF    
              ENDIF
         ENDIF
      ENDIF
    Steve

  2. #2
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Here is a small refinement to your IF-THEN-ENDIF
    Code:
      Temp = Seconds + Minutes + Hours + Seconds_Alarm_Set_Point + _
                   Minutes_Alarm_Set_Point + Hours_Alarm_Set_Point
      IF Temp <> 0 THEN  'Not Equal to 0
    
      ENDIF


    Hmmm...

    Maybe could go to this too...

    Code:
    IF Temp THEN ; Any Temp value over zero will make the "IF" true
     ;do something
    EndIF
    This may not work with older versions of PBP.

    Arch
    "Data sheets? I ain't got no data sheets. I don't need no data sheets. I don't have to read any stinking data sheets!"

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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