Results 1 to 4 of 4

Thread: Logical operators in Scar/Pascal

  1. #1
    Join Date
    May 2008
    Location
    Sweden
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Logical operators in Scar/Pascal

    Hello everyone! Ive wondered how you use the logical operators "And" and "or" in Scar/pascal.

    In other languages ive usen the operators were "||" for the operator "or" and "&&" for the operator "and". Now i wonder if its the same in scar/pascal?

    examples
    SCAR Code:
    if(myBoolean && myTimer > 500) then.....
    SCAR Code:
    if(myBoolean || myOtherBoolean) then...

  2. #2
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    C++ I know uses || and && for operators. It also has != for not equal. The equivalents in Scar are. Note I put extra parenthesis out of habit from c++, the second set i do not believe is necessary.
    ||/or
    SCAR Code:
    if ((myBoolean or (myTimer > 500)) then
    &&/and
    SCAR Code:
    if ((myBoolean) and (myTimer > 500)) then
    !=/not equal to
    SCAR Code:
    if not (myBoolean) then

  3. #3
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    SCAR Code:
    if MyBool and ( Timer > 500) then

    SCAR Code:
    if FirstBool or SecondBool then

    simple

    edit: Dusk412 beat me. Dusk412, MyBool is a boolean, not an integer

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  4. #4
    Join Date
    May 2008
    Location
    Sweden
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks alot for the help : )

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 11-08-2008, 08:17 PM
  2. Idea on SCAR? logical?
    By jumbosped in forum News and General
    Replies: 6
    Last Post: 08-10-2008, 01:56 AM
  3. is it Scar, Pascal or Me?
    By man slaughter in forum OSR Help
    Replies: 3
    Last Post: 02-18-2008, 10: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
  •