Results 1 to 3 of 3

Thread: Boolean?

  1. #1
    Join Date
    Dec 2006
    Posts
    354
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Boolean?

    hmm, i need some help figuring this out.

    at the begining of my script, i have a const, and i want it to do a certain thing if =true, and also a certain thing if false. i think this is a boolean function, and this is what i have so far..

    Code:
    function LeatherTypes: Boolean;
    begin
     if (SoftLeather = True) then
     begin
      MMouse(93, 105,5,5);
      Mouse(93, 105,5,5,false);
      Wait(500+random(300));
      ClickOption('All', 1);
      Wait(4000+random(250));
     if (SoftLeather = False) then
       begin
       MMouse(208, 104,5,5);
       Mouse(208, 104,5,5,false);
       Wait(500+random(300));
       ClickOption('All', 1);
       Wait(4000+random(250));
       end;
      end;
    end;

    any ideas anyone? everytime the const is set to false, it just ignores it as if it's not there...

  2. #2
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You don't need a function for this. A boolean function would only be used in this case if you wanted your function to return a value as true or false.

    Also, you have an end; in the wrong place.

    Try this
    SCAR Code:
    procedure LeatherTypes;
    begin
     if (SoftLeather = True) then
     begin
      MMouse(93, 105,5,5);
      Mouse(93, 105,5,5,false);
      Wait(500+random(300));
      ClickOption('All', 1);
      Wait(4000+random(250));
      end else

     if (SoftLeather = False) then
       begin
       MMouse(208, 104,5,5);
       Mouse(208, 104,5,5,false);
       Wait(500+random(300));
       ClickOption('All', 1);
       Wait(4000+random(250));
       end;
    end;

    It sounds like you have this part, but just make sure.
    SCAR Code:
    const
    SoftLeather=True;

  3. #3
    Join Date
    Dec 2006
    Posts
    354
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmm, i'll give this a try, it seems like it'd work. eitherway, thanks a lot i appreciate the helpz.

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
  •