Closed Thread
Results 1 to 4 of 4

Thread: Implement some sort of untill() function?

  1. #1
    Wirererer Blob 92's Avatar
    Join Date
    Dec 2009
    Location
    vec( √ -1, √ -1, √ -1 )
    Posts
    222

    Default Implement some sort of untill() function?

    Ive been working on some stuff and would find a function that stopped an if()/elsif() statement when something happens, e.g:
    Code:
    if(Button){
         Height++
    }untill(Height = 30)
    I know it can be done by doing this:
    Code:
    if(Button & Height < 30){
         Height++
    }
    But there are some cases where it would be easier for some sort of untill() function.

  2. #2
    Wirererer malum's Avatar
    Join Date
    Feb 2009
    Posts
    217

    Default Re: Implement some sort of untill() function?

    Code:
    while(Height < 30) {
         if(Button) {
              Height++
         }
    }
    I think

  3. #3
    Wirererer Blob 92's Avatar
    Join Date
    Dec 2009
    Location
    vec( √ -1, √ -1, √ -1 )
    Posts
    222

    Default Re: Implement some sort of untill() function?

    Lol, I completely forgot about the while() functions :P Thanks

  4. #4
    Not a bot itsbth's Avatar
    Join Date
    Feb 2007
    Location
    Norway
    Posts
    1,173

    Default Re: Implement some sort of untill() function?

    Quote Originally Posted by malum View Post
    Code:
    while(Height < 30) {
         if(Button) {
              Height++
         }
    }
    I think
    Last edited by itsbth; 08-21-2010 at 04:26 PM.

Closed Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots