Results 1 to 4 of 4

Thread: how to use 'or'

  1. #1
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default how to use 'or'

    I've been trying to get 'or' to work in this little function for half an hour but in keeps throwing type mistmatch errors at me. I don't know hat the hell is wrong with it, can anyone spot the mistake?


    Simba Code:
    If GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = ('Enter the price you wish to sell for: |') or ('Enter the price you wish to buy for: |') then
              begin
               SendKeys(FloatToStr(round(decimal)) + chr(13), 200);
               Wait(500 + Random(500));

    Am I using or correctly?

  2. #2
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Simba Code:
    If GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = ('Enter the price you wish to sell for: |') or GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = ('Enter the price you wish to buy for: |') then

  3. #3
    Join Date
    Jul 2010
    Posts
    1,115
    Mentioned
    1 Post(s)
    Quoted
    10 Post(s)

    Default

    im guessing you need extra brackets around the second half or another =
    never scripted before, but try

    Simba Code:
    If GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = (('Enter the price you wish to sell for: |') or ('Enter the price you wish to buy for: |')) then
              begin
               SendKeys(FloatToStr(round(decimal)) + chr(13), 200);
               Wait(500 + Random(500));

    or

    Simba Code:
    If GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = ('Enter the price you wish to sell for: |') or GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = ('Enter the price you wish to buy for: |') then
              begin
               SendKeys(FloatToStr(round(decimal)) + chr(13), 200);
               Wait(500 + Random(500));

    E:
    Last edited by bolshak25; 12-25-2011 at 12:02 AM.

  4. #4
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    thanks man your's didn't work but I got it to work by adding brackets around each condition:

    Simba Code:
    If (GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = ('Enter the price you wish to sell for: |')) or (GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = ('Enter the price you wish to buy for: |')) then


    thanks a lot bolshak25 that was alon the lines of what i did
    Last edited by HT BaaFly; 12-25-2011 at 12:02 AM.

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
  •