Results 1 to 5 of 5

Thread: Getting mouse position?

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

    Default Getting mouse position?

    How would I get the actual X and Y position?
    I've tried the GetMousePos or something but that's a procedure and doesn't really return anything.

  2. #2
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Simba Code:
    Procedure TestMouse;
    Var
      M: TPoint;
    Begin
      GetMousePos( M.X, M.Y);
      Writeln( 'Our position is ' + IntToStr( M.X) + ' and ' + IntToStr( M.Y));
    End;
    Oh Hai Dar

  3. #3
    Join Date
    Jan 2012
    Posts
    64
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay thanks.

  4. #4
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    What Main said is fine and dandy, but if you want it to be a little less complicated when using the vars, do this -

    Simba Code:
    procedure NIFNISDFDFIKS;
    var
       x,y:Integer;
    begin
       GetMousePos(x,y);
       Writeln( 'Our position is ' + IntToStr( M.X) + ' and ' + IntToStr( M.Y));
    end;

  5. #5
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Shay View Post
    What Main said is fine and dandy, but if you want it to be a little less complicated when using the vars, do this -

    Simba Code:
    procedure NIFNISDFDFIKS;
    var
       x,y:Integer;
    begin
       GetMousePos(x,y);
       Writeln( 'Our position is ' + IntToStr(M.X) + ' and ' + IntToStr(M.Y));
    end;
    He means this...
    Simba Code:
    procedure NIFNISDFDFIKS;
    var
       x,y:Integer;
    begin
       GetMousePos(x,y);
       Writeln( 'Our position is ' + IntToStr(X) + ' and ' + IntToStr(Y));
    end;

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
  •