Results 1 to 4 of 4

Thread: Correct Syntax

  1. #1
    Join Date
    Jan 2012
    Posts
    83
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default Correct Syntax

    I have a procedure that returns coords of a specific location... when those coords are returned I want to trigger different actions depending on which X,Y is returned, I do not know how to write this properly.

    The below is written incorrect and returns the error "Closing parenthesis expected" but hopefully someone can understand what I am trying to do.

    if FindNear(X, Y) then
    begin
    if (X=242..260) and (Y=526..574) then begin
    writeln('Middle');
    end;

    So, just to be clear, with the above with the ".."s I was trying to detect if X and Y were found in that range.

    Thanks.

  2. #2
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by halgboy_tbc View Post
    I have a procedure that returns coords of a specific location... when those coords are returned I want to trigger different actions depending on which X,Y is returned, I do not know how to write this properly.

    The below is written incorrect and returns the error "Closing parenthesis expected" but hopefully someone can understand what I am trying to do.

    if FindNear(X, Y) then
    begin
    if (X=242..260) and (Y=526..574) then begin
    writeln('Middle');
    end;

    So, just to be clear, with the above with the ".."s I was trying to detect if X and Y were found in that range.

    Thanks.
    what is your find near function?
    where did you learn pascal script? you can't do x = 242..260

  3. #3
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Simba Code:
    if FindNear(X, Y) then
    begin
      if (InRange(X, 242, 260) and InRange(Y, 526, 574)) then
      begin
        //DoStuff
      end;
    end;
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  4. #4
    Join Date
    Jan 2012
    Posts
    83
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Thanks Rich and footballjds.

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
  •