Results 1 to 3 of 3

Thread: how to go out from a case statement

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2004
    Location
    Mauritius
    Posts
    19

    how to go out from a case statement

    hi
    i have a case statement
    Do While stage < 10

    For k = 0 To 1023
    temp_real(k) = out_real(k)
    temp_imag(k) = out_imag(k)
    Next

    Select Case stage
    Case 1
    For k = 513 To 1023
    temp_real(k) = (out_real(k) * wn_real(256)) - (out_imag(k) * wn_imag(256))
    temp_imag(k) = (out_real(k) * wn_imag(256)) + (out_imag(k) * wn_real(256))
    k = k + 2
    Next k
    '
    Case 2
    For weight = 1 To 3
    For k = 1 To 255
    temp_real(k + weight * 256) = out_real(k + weight * 256) * wn_real(weight * 128) - out_imag(k + weight * 256) * wn_imag(weight * 128)
    temp_imag(k + weight * 256) = out_real(k + weight * 256) * wn_imag(weight * 128) + out_imag(k + weight * 256) * wn_real(weight * 128)
    k = k + 2
    Next k
    Next
    End Select

    stage = stage + 1
    Loop

    i want to go out of the case statement after doing it
    can anybody helps me?

  2. #2
    Do While stage < 10

    For k = 0 To 1023
    temp_real(k) = out_real(k)
    temp_imag(k) = out_imag(k)
    Next

    Select Case stage
    Case 1
    For k = 513 To 1023
    temp_real(k) = (out_real(k) * wn_real(256)) - (out_imag(k) * wn_imag(256))
    temp_imag(k) = (out_real(k) * wn_imag(256)) + (out_imag(k) * wn_real(256))
    k = k + 2
    Next k
    goto stagelbl:
    Case 2
    For weight = 1 To 3
    For k = 1 To 255
    temp_real(k + weight * 256) = out_real(k + weight * 256) * wn_real(weight * 128) - out_imag(k + weight * 256) * wn_imag(weight * 128)
    temp_imag(k + weight * 256) = out_real(k + weight * 256) * wn_imag(weight * 128) + out_imag(k + weight * 256) * wn_real(weight * 128)
    k = k + 2
    Next k
    Next
    End Select

    stagelbl:
    stage = stage + 1
    Loop

  3. #3
    Hyperactive Member dRAMmer's Avatar
    Join Date
    Oct 2001
    Location
    strangelans
    Posts
    463

    Re: how to go out from a case statement

    Originally posted by cprema
    i want to go out of the case statement after doing it
    can anybody helps me?
    Do you mean breaking your loop inside the case? If not, you don't need to be concern about getting out of the select statement, it will not go into the other if it has been through one.
    live, code and die...

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