Results 1 to 4 of 4

Thread: Something happen !! quick help ...

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Posts
    9

    Something happen !! quick help ...

    Can anyone explain for me this code i can`t understand it ....

    Code:
      Sub dimSquare()
            If xUp < 0 Then xUp = 0
            If xUp > 600 Then xUp = 600
            If yUp < 0 Then yUp = 0
            If yUp > 480 Then yUp = 480
            intW = Math.Abs(xUp - xDown)
            intH = Math.Abs(yUp - yDown)
            If intW > intH Then intW = intH
            If xUp < xDown Then intL = xDown - intW Else intL = xDown
            If yUp < yDown Then intT = yDown - intW Else intT = yDown
        End Sub
        Sub dimRectangle()
            If xUp < 0 Then xUp = 0
            If xUp > 1000 Then xUp = 1000
            If yUp < 0 Then yUp = 0
            If yUp > 480 Then yUp = 480
            intW = Math.Abs(xUp - xDown)
            intH = Math.Abs(yUp - yDown)
            If xUp < xDown Then intL = xDown - intW Else intL = xDown
            If yUp < yDown Then intT = yDown - intH Else intT = yDown
        End Sub
        Sub dimCircle()
            If xUp < 0 Then xUp = 0
            If xUp > 600 Then xUp = 600
            If yUp < 0 Then yUp = 0
            If yUp > 480 Then yUp = 480
            intW = Math.Abs(xUp - xDown)
            intH = Math.Abs(yUp - yDown)
            If intW < intH Then intW = intH
            intL = xDown - intW
            intT = yDown - intW
            intW *= 2
        End Sub
        Sub dimEllipse()
            If xUp < 0 Then xUp = 0
            If xUp > 600 Then xUp = 600
            If yUp < 0 Then yUp = 0
            If yUp > 480 Then yUp = 480
            intW = Math.Abs(xUp - xDown)
            intH = Math.Abs(yUp - yDown)
            intL = xDown - intW
            intT = yDown - intH
            intW *= 2
            intH *= 2
        End Sub

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Re: Something happen !! quick help ...

    You must remember we are all volunteers. We understand you need help but you will delay help in using poor thread titles. You say something has happened yet posted a question asking what code does. You clearly have not written this. Why should be look at your code when you have made no effort to explain what you are doing?

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Posts
    9

    Re: Something happen !! quick help ...

    Quote Originally Posted by ident View Post
    You must remember we are all volunteers. We understand you need help but you will delay help in using poor thread titles. You say something has happened yet posted a question asking what code does. You clearly have not written this. Why should be look at your code when you have made no effort to explain what you are doing?
    It's not a matter of being not understanding the code!it's about finding someone to explain the mathematical operations in the code so i can Learn and Apply it.
    thank you

  4. #4
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Something happen !! quick help ...

    If you can understand mathematical symbols, you can understand that code:


    Sub dimSquare()
    If xUp < 0 Then xUp = 0 'Ensure that xUp is not less than 0
    If xUp > 600 Then xUp = 600 'Ensure that xUp is not more than 600
    If yUp < 0 Then yUp = 0 'Ensure that xUp is not less than 0
    If yUp > 480 Then yUp = 480 'Ensure that xUp is not more than 480

    intW = Math.Abs(xUp - xDown) 'Set intW to xUp minus xDown ensuring that the value is positive (that's the ABS part)
    intH = Math.Abs(yUp - yDown)


    etc etc..

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width