Results 1 to 4 of 4

Thread: Logic operators in fonctions

  1. #1
    Join Date
    Feb 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Logic operators in fonctions

    Hello , I'm working a little project and I have a question about this :

    if (FindBitmapToleranceIn((A or B or C or D), x, y, 146, 542, 167, 582, 0)=True)then
    Nb1:= 50 ;

    the script is compiling but I have this runtime error often

    is it allowed to put A OR B OR C ....... I mean, can we put several bitmaps
    or is it the wrong syntaxe for it?

    thanks

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    You'll have to write a separate piece for each of them, like this:
    SCAR Code:
    if FindBitmapToleranceIn(A, x, y, 146, 542, 167, 582, 0) or
    FindBitmapToleranceIn(B, x, y, 146, 542, 167, 582, 0) or
    FindBitmapToleranceIn(C, x, y, 146, 542, 167, 582, 0) or
    FindBitmapToleranceIn(D, x, y, 146, 542, 167, 582, 0) then
    Nb1 := 50;

  3. #3
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    or store them in an arrray and loop through them all...

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  4. #4
    Join Date
    Feb 2009
    Location
    Nebraska
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by HyperSecret View Post
    or store them in an arrray and loop through them all...
    A good way to do that would be to declare a new FindBitmapsToleranceIn() that takes as a first parameter 'Bitmaps: array of integer' and returns true (or perhaps the bitmap index) as soon as any one of them are found or false (or -1) if none are found.
    Grippy has approximately 30,000 hours of Delphi coding experience. srsly.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Got Logic?
    By Laur€ns in forum News and General
    Replies: 21
    Last Post: 09-11-2008, 06:42 PM
  2. In-depth Bitwise Operators.
    By R0b0t1 in forum OSR Advanced Scripting Tutorials
    Replies: 3
    Last Post: 09-02-2008, 06:32 PM
  3. Logical operators in Scar/Pascal
    By tojoh in forum OSR Help
    Replies: 3
    Last Post: 06-03-2008, 02:30 PM
  4. Logic and Efficiency
    By munk in forum OSR Outdated Tutorials
    Replies: 6
    Last Post: 11-17-2007, 12:32 AM
  5. Logic thinking puzzle
    By yachibu in forum News and General
    Replies: 2
    Last Post: 03-09-2006, 01:01 AM

Posting Permissions

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