C++: Adding repeat/until functionality

Discussion in 'Programming General' started by Govind, Sep 13, 2007.

C++: Adding repeat/until functionality
  1. Unread #1 - Sep 13, 2007 at 4:53 PM
  2. Govind
    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    C++: Adding repeat/until functionality

    This makes it easier for people familiar with Delphi and SCAR to use C++ by adding the familiar repeat/until loop. Only difference is that it must be capitalized to fit naming conventions.
    Add this to the beginning of your file(s) after the includes/other directives:
    Code:
    #define REPEAT do{
    #define UNTIL( condition ) }while(!(condition));
    Example usage:
    Code:
    #include <iostream>
    #define REPEAT do{
    #define UNTIL( condition ) }while(!(condition));
    using namespace std;
    int main(int argc, char *argv[])
    {
        int i = 0;
        REPEAT
              cout << "The value of i is: " << i <<  endl;
              i++;
        UNTIL(i==10)
        system("PAUSE");
        return EXIT_SUCCESS;
    }
     
  3. Unread #2 - Sep 17, 2007 at 1:13 PM
  4. rogue poser
    Joined:
    Jul 10, 2005
    Posts:
    51
    Referrals:
    0
    Sythe Gold:
    0

    rogue poser Member

    C++: Adding repeat/until functionality

    you seem fairly knowledgeable in c++ so could you help me, i know this is bacic but the programs ive written in the past in c++ never interacted with the screen, so how do i parse the screen for a color or a bitmap? what includes will i need?
     
  5. Unread #3 - Sep 18, 2007 at 2:12 PM
  6. Govind
    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    C++: Adding repeat/until functionality

    Most of everything you need will be in <windows.h>. Try looking up the MSDN library for APIs.
     
  7. Unread #4 - Oct 2, 2007 at 7:03 PM
  8. rogue poser
    Joined:
    Jul 10, 2005
    Posts:
    51
    Referrals:
    0
    Sythe Gold:
    0

    rogue poser Member

    C++: Adding repeat/until functionality

    thankyou so much man!!! i really appreciate it, i was having the hardest time finding a function list, your the best
     
< Retrieved RSC Source Code :p | Please help me to do this project. Thanks >

Users viewing this thread
1 guest


 
 
Adblock breaks this site