Results 1 to 4 of 4

Thread: What am I doing wrong?

  1. #1

    Thread Starter
    PowerPoster SuperSparks's Avatar
    Join Date
    May 2003
    Location
    London, England
    Posts
    265

    What am I doing wrong?

    Can anyone tell me what is wrong with this code, please?

    VB Code:
    1. If Counter < 2 AndAlso txtSin.Text <> "" Then Sine = CDbl(txtSin.Text)
    2.             Counter += CByte(1)
    3.            elseIf Counter < 2 AndAlso txtCos.Text <> "" Then Cosine = CDbl(txtCos.Text)
    4.  
    5.             End If

    Both the ElseIf and End If statements have the blue squiggly lines under them with the tooltip saying they must be preceded by a matching If statement
    Nick.

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Move Sine = CDbl(txtSin.Text) to a new line.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196
    Code:
                            If Counter < 2 AndAlso txtSin.Text <> "" Then
                                Sine = CDbl(txtSin.Text)
                                Counter += CByte(1)
                            ElseIf Counter < 2 AndAlso txtCos.Text <> "" Then
                                Cosine = CDbl(txtCos.Text)
    
                            End If
    "And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
    Frank Zappa

  4. #4

    Thread Starter
    PowerPoster SuperSparks's Avatar
    Join Date
    May 2003
    Location
    London, England
    Posts
    265
    Thanks guys, I just spotted it myself

    I think I've had one beer too many for any more programming tonight
    Nick.

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