Results 1 to 7 of 7

Thread: How to make a Boolean argument?

  1. #1
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default How to make a Boolean argument?

    I have this:
    Simba Code:
    if FindColorsTolerance(TreeTPA, 2649183, MSX1, MSY1, MSX2, MSY2, 6) then
    result := True;

    If complied gives: Unknown identifier 'result'
    Thank you

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Is this called in a function?
    You should have something like
    Simba Code:
    function FunctionName: Boolean;

  3. #3
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Simba Code:
    function Thecolor: Boolean;
    var
     TreeTPA: TpointArray;
    begin
     if FindColorsTolerance(TreeTPA, 2649183, MSX1, MSY1, MSX2, MSY2, 6) then
     result := True;
    end;

    Edit 'd

    Creds to DannyRS for this wonderful sig!

  4. #4
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    Simba Code:
    function Thecolor: Boolean;
    var
     TreeTPA: TpointArray;
    begin
     if FindColorsTolerance(TreeTPA, 2649183, MSX1, MSY1, MSX2, MSY2, 6) then
     result := True;
    end;

    Edit 'd
    A simpler way would be:

    Simba Code:
    function Thecolor: Boolean;
    var
     TreeTPA: TpointArray;
    begin
      result := FindColorsTolerance(TreeTPA, 2649183, MSX1, MSY1, MSX2, MSY2, 6);
    end;
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  5. #5
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default

    Quote Originally Posted by litoris View Post
    A simpler way would be:

    Simba Code:
    function Thecolor: Boolean;
    var
     TreeTPA: TpointArray;
    begin
      result := FindColorsTolerance(TreeTPA, 2649183, MSX1, MSY1, MSX2, MSY2, 6);
    end;
    But then that could be false or true?

  6. #6
    Join Date
    Oct 2012
    Posts
    758
    Mentioned
    6 Post(s)
    Quoted
    282 Post(s)

    Default

    Quote Originally Posted by Blakebn2011 View Post
    But then that could be false or true?
    No that means it returns true if FindColors.. etc..
    Boolean function is false by default at the start.

  7. #7
    Join Date
    Mar 2013
    Posts
    224
    Mentioned
    1 Post(s)
    Quoted
    127 Post(s)

    Default

    Quote Originally Posted by litoris View Post
    A simpler way would be:

    Simba Code:
    function Thecolor: Boolean;
    var
     TreeTPA: TpointArray;
    begin
      result := FindColorsTolerance(TreeTPA, 2649183, MSX1, MSY1, MSX2, MSY2, 6);
    end;

    Use this, what it's saying is that the result will be true if it finds it, false if not.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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