Results 1 to 3 of 3
  1. #1
    75+ Posting Member
    Join Date
    Jun 2011
    Location
    FRANCE
    Posts
    121
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Max buses value for panels backlighting

    This is a SIOC question but relative to psxseecon and PSX. I want to get the max value of 6 PSX/psxseecon variables :

    4942 : gT38
    4943 : gT40
    4944 : gT44
    4945 : gR8098ab
    4946 : gR8098c
    4947 : gR8098d

    and store this max value in a variable to drive the intensity of my OVH panels backlighting. I can do in C++ very easily with max() function, but I do not find solution to do it with SIOC. Help will be very appreciated.

  2. #2
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Max buses value for panels backlighting

    Code:
    Var 4942 name gT38 static
    {
      CALL &MaxOvhd
    }
    Var 4943 name gT40 static
    {
      CALL &MaxOvhd
    }
    Var 4944 name gT44 static
    {
      CALL &MaxOvhd
    }
    Var 4945 name gR8098ab static
    {
      CALL &MaxOvhd
    }
    Var 4946 name gR8098ac static
    {
      CALL &MaxOvhd
    }
    Var 4947 name gR8098ad static
    {
      CALL &MaxOvhd
    }
    Var 9000 name MaxOvhd Link SUBRUTINE
    {
      L0 = &GT38
      IF &gT40 > L0
      {
        L0 = &GT40
      }
      IF &GT44 > L0
      {
        L0 = &GT44
      }  
      IF &gR8098ab > L0
      {
        L0 = &gR8098ab
      }
      IF &gR8098ac > L0
      {
        L0 = &gR8098ac
      }
      IF &gR8098ad > L0
      {
        L0 = &gR8098ad
      }
      // here you are: L0 contains the max value
    }

  3. #3
    75+ Posting Member
    Join Date
    Jun 2011
    Location
    FRANCE
    Posts
    121
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Max buses value for panels backlighting

    Nico,

    Wonderful. I asked for an advice and you send me the whole code directly. I didn't expect so much. Thank you very much !

    PS : I though about this solution with comparators but wondered if SIOC had a function to make it easier, like max() for example.