Results 1 to 7 of 7
  1. #1
    25+ Posting Member
    Join Date
    Aug 2008
    Location
    oslo, norway
    Posts
    63
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    sioc programming question: IF..AND..

    Hello!
    If I want to say "if a>0 AND b=5, then c=0",
    can I write

    Var 2000
    (
    IF a>0
    b=5
    (
    c=0
    )
    )

    or do I have to use the "AND" word?
    I receive errors when trying to say " IF a>0 AND b=5 "

  2. #2
    25+ Posting Member
    Join Date
    Aug 2008
    Location
    oslo, norway
    Posts
    63
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    ... or,
    what to write if I want to say

    IF a>5 OR a<-5

    ..

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

    Hi,

    As fas as I remeber you have to write a new condition using ELSE IF. Try using the own program within SIOC to wirte instead of trying on the .txt format. You can find all functions in a very good GUI there.

    Best Regards,

    barkay

  4. #4
    25+ Posting Member
    Join Date
    Jun 2008
    Location
    Jersey Channel Islands
    Posts
    32
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    SIOC Code

    Hi

    Try this...

    Var 1 name a
    Var 2 name b
    var 3 name c

    {
    C0 = &a > 0
    C1 = &b = 5
    IF C0 AND C1
    {
    &c = 0
    }

    }

  5. #5
    25+ Posting Member
    Join Date
    Aug 2008
    Location
    oslo, norway
    Posts
    63
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    thank you som much, pro's!
    I see; the AND and OR is to be used only with the C's,
    true or not trues.
    I will certainly try that!

  6. #6
    25+ Posting Member
    Join Date
    Jun 2008
    Location
    Jersey Channel Islands
    Posts
    32
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    SIOC Code

    Hi

    This is a better way of writting it the other way was to show the use of Internal Variables.

    Var 1 name a
    Var 2 name b
    var 3 name c

    {
    IF &a > 0
    {
    IF &b = 5
    {
    &c = 0
    }
    }
    }

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


Similar Threads

  1. Replies: 5
    Last Post: 09-22-2010, 12:02 PM
  2. Programming in SIOC with Lekseecon?
    By Boeing 747 Flyer in forum lekseecon Q&A and Discussions
    Replies: 10
    Last Post: 04-28-2010, 05:30 PM
  3. Sioc Question
    By Olympic260 in forum OpenCockpits General Discussion
    Replies: 6
    Last Post: 02-01-2010, 08:50 PM
  4. Question on SIOC
    By 4EVERCooL in forum OpenCockpits General Discussion
    Replies: 5
    Last Post: 10-14-2008, 01:07 AM
  5. A BIG thanks & another SIOC question
    By jmig in forum OpenCockpits General Discussion
    Replies: 1
    Last Post: 09-02-2008, 01:25 PM