The Best Solution


Results 1 to 18 of 18

Threaded View

  1. #1

    Default The Best Solution

    Hi ,

    I Have a question?

    What is the best Solution to simplify this code:

    if (ML_Value[0] <= $5A) or (ML_Value[0] => $82) then Summe_Alarm.0 = 1
    if (ML_Value[1] <= $5A) or (ML_Value[1] => $82) then Summe_Alarm.1 = 1
    if (ML_Value[2] <= $5A) or (ML_Value[2] => $82) then Summe_Alarm.2 = 1
    if (ML_Value[3] <= $5A) or (ML_Value[3] => $82) then Summe_Alarm.3 = 1
    if (ML_Value[4] <= $5A) or (ML_Value[4] => $82) then Summe_Alarm.4 = 1
    if (ML_Value[5] <= $5A) or (ML_Value[5] => $82) then Summe_Alarm.5 = 1
    if (ML_Value[6] <= $5A) or (ML_Value[6] => $82) then Summe_Alarm.6 = 1
    if (ML_Value[7] <= $5A) or (ML_Value[7] => $82) then Summe_Alarm.7 = 1

    if (ML_Value[0] > $5A) and (ML_Value[0] < $82) then Summe_Alarm.0 = 0
    if (ML_Value[1] > $5A) and (ML_Value[1] < $82) then Summe_Alarm.1 = 0
    if (ML_Value[2] > $5A) and (ML_Value[2] < $82) then Summe_Alarm.2 = 0
    if (ML_Value[3] > $5A) and (ML_Value[3] < $82) then Summe_Alarm.3 = 0
    if (ML_Value[4] > $5A) and (ML_Value[4] < $82) then Summe_Alarm.4 = 0
    if (ML_Value[5] > $5A) And (ML_Value[5] < $82) then Summe_Alarm.5 = 0
    if (ML_Value[6] > $5A) and (ML_Value[6] < $82) then Summe_Alarm.6 = 0
    if (ML_Value[7] > $5A) and (ML_Value[7] < $82) then Summe_Alarm.7 = 0

    Thanks a lot for any answer.

    Regard Pesti
    Last edited by Pesticida; - 26th May 2007 at 18:19.

Similar Threads

  1. Strange I2C problem (and solution)
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th December 2008, 19:14
  2. Replies: 6
    Last Post: - 20th September 2008, 12:28
  3. Replies: 7
    Last Post: - 7th February 2008, 09:46
  4. Need PC software solution
    By mister_e in forum Off Topic
    Replies: 9
    Last Post: - 27th November 2005, 02:18
  5. Battery Solution
    By Keith in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd July 2005, 06:07

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