Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 135,961 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,538 people online right now. Registration is fast and FREE... Join Now!




Problem-Visual C++ Won't Find my if code ste, But it's in plai

 
Reply to this topicStart new topic

Problem-Visual C++ Won't Find my if code ste, But it's in plai

jasonprince2
7 Jun, 2007 - 03:30 PM
Post #1

New D.I.C Head
*

Joined: 6 Jun, 2007
Posts: 19


My Contributions
When I build, it says "error C2181: illegal else without matching if" and there's an if right there. The top two if sets are fine, and I know that because when I delete the bottom set, it does build, but when it's there, it does not build. The Build Log is attached. Here is my code.

CODE

#pragma once


namespace TeslaProgam {

    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;

    /// <summary>
    /// Summary for Form1
    ///
    /// WARNING: If you change the name of this class, you will need to change the
    ///          'Resource File Name' property for the managed resource compiler tool
    ///          associated with all .resx files this class depends on.  Otherwise,
    ///          the designers will not be able to interact properly with localized
    ///          resources associated with this form.
    /// </summary>
    public ref class Form1 : public System::Windows::Forms::Form
    {
    private:
        char unitin;
    private:
        char Unitmm;
    private: System::Windows::Forms::ToolStripMenuItem^  inchesToFeetToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  feetToInchesToolStripMenuItem;
    private: System::Windows::Forms::Label^  label10;
    private: System::Windows::Forms::Label^  label9;
    private: System::Windows::Forms::Label^  label8;
    private: System::Windows::Forms::Label^  label7;
    private:
        char balance;
    public:
        Form1(void)
        {
            InitializeComponent();
            //
            //TODO: Add the constructor code here
            //
        balance = 12;
        }

    protected:
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        ~Form1()
        {
            if (components)
            {
                delete components;
            }
        }

    protected:


    private: System::Windows::Forms::ToolStrip^  toolStrip1;
    private: System::Windows::Forms::ToolStripDropDownButton^  toolStripButton1;
    private: System::Windows::Forms::ToolStripMenuItem^  newToolStripMenuItem;




    private: System::Windows::Forms::ToolStripDropDownButton^  toolStripButton2;
    private: System::Windows::Forms::ToolStripDropDownButton^  toolStripButton3;
    private: System::Windows::Forms::ToolStripDropDownButton^  toolStripButton4;
    private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator1;
    private: System::Windows::Forms::ToolStripMenuItem^  openToolStripMenuItem;



    private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator2;
    private: System::Windows::Forms::ToolStripMenuItem^  saveToolStripMenuItem;



    private: System::Windows::Forms::ToolStripMenuItem^  saveAsToolStripMenuItem;
    private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator3;
    private: System::Windows::Forms::ToolStripMenuItem^  printToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  printPreviewToolStripMenuItem;
    private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator4;


    private: System::Windows::Forms::TabPage^  tabPage6;
    private: System::Windows::Forms::TabPage^  tabPage5;
    private: System::Windows::Forms::TabPage^  tabPage4;
    private: System::Windows::Forms::TabPage^  tabPage3;
    private: System::Windows::Forms::TabPage^  tabPage2;
    private: System::Windows::Forms::TabPage^  tabPage1;
    private: System::Windows::Forms::TabControl^  tabControl1;
    private: System::Windows::Forms::ToolStripMenuItem^  teslaComponentCreatorToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  capacitorsToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  mMCToolStripMenuItem4;
    private: System::Windows::Forms::ToolStripMenuItem^  polyPlateToolStripMenuItem;
    private: System::Windows::Forms::ToolStripDropDownButton^  toolStripDropDownButton1;
    private: System::Windows::Forms::GroupBox^  groupBox1;
    private: System::Windows::Forms::RadioButton^  wattdeterminespark;
    private: System::Windows::Forms::RadioButton^  sparklengthdeterminewatt;


    private: System::Windows::Forms::TextBox^  sparklength;
    private: System::Windows::Forms::TextBox^  watts;
    private: System::Windows::Forms::Label^  label1;
    private: System::Windows::Forms::Label^  sparklengthlabel;
    private: System::Windows::Forms::Label^  wattlabel;
    private: System::Windows::Forms::ToolStripMenuItem^  conversionsToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  dimensionsToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  lengthToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  milimetersToIInchesToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  inchesToMillimetersToolStripMenuItem;






    private: System::Windows::Forms::ToolStripMenuItem^  electricityToolStripMenuItem;
    private: System::Windows::Forms::Label^  label2;
    private: System::Windows::Forms::GroupBox^  groupBox2;
    private: System::Windows::Forms::ToolStripMenuItem^  capacitanceToolStripMenuItem1;
    private: System::Windows::Forms::ToolStripMenuItem^  uhToMhToolStripMenuItem1;
    private: System::Windows::Forms::ToolStripMenuItem^  mhToUhToolStripMenuItem1;
    private: System::Windows::Forms::ToolStripMenuItem^  resistanceToolStripMenuItem1;
    private: System::Windows::Forms::ToolStripMenuItem^  blahToBlahToolStripMenuItem1;




    private: System::Windows::Forms::ToolStripMenuItem^  allHelpInManualToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  saveAndExitToolStripMenuItem;
    private: System::Windows::Forms::GroupBox^  groupBox5;
    private: System::Windows::Forms::GroupBox^  groupBox4;
    private: System::Windows::Forms::GroupBox^  groupBox3;
    private: System::Windows::Forms::RadioButton^  radMillimeters;
    private: System::Windows::Forms::RadioButton^  radInches;
private: System::Windows::Forms::TextBox^  txtTurnSpac1;

private: System::Windows::Forms::TextBox^  txtWirDiam1;

private: System::Windows::Forms::TextBox^  txtNumTurns1;

private: System::Windows::Forms::TextBox^  txtDiam1;

private: System::Windows::Forms::Label^  label6;
private: System::Windows::Forms::Label^  label5;
private: System::Windows::Forms::Label^  label4;
private: System::Windows::Forms::Label^  label3;
private: System::Windows::Forms::TextBox^  txtUnit3;


private: System::Windows::Forms::TextBox^  txtUnit2;

private: System::Windows::Forms::TextBox^  txtUnit1;






























    private:
        /// <summary>
        /// Required designer variable.
        /// </summary>
        System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        void InitializeComponent(void)
        {
            System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
            this->toolStrip1 = (gcnew System::Windows::Forms::ToolStrip());
            this->toolStripButton1 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
            this->newToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
            this->openToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
            this->saveToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->saveAsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
            this->printToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->printPreviewToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());
            this->saveAndExitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->toolStripButton2 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
            this->toolStripButton3 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
            this->toolStripButton4 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
            this->teslaComponentCreatorToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->capacitorsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->mMCToolStripMenuItem4 = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->polyPlateToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->conversionsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->dimensionsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->lengthToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->milimetersToIInchesToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->inchesToMillimetersToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->inchesToFeetToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->feetToInchesToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->electricityToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->capacitanceToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->uhToMhToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->mhToUhToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->resistanceToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->blahToBlahToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->toolStripDropDownButton1 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
            this->allHelpInManualToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->tabPage6 = (gcnew System::Windows::Forms::TabPage());
            this->groupBox5 = (gcnew System::Windows::Forms::GroupBox());
            this->label10 = (gcnew System::Windows::Forms::Label());
            this->label9 = (gcnew System::Windows::Forms::Label());
            this->label8 = (gcnew System::Windows::Forms::Label());
            this->label7 = (gcnew System::Windows::Forms::Label());
            this->groupBox4 = (gcnew System::Windows::Forms::GroupBox());
            this->txtUnit3 = (gcnew System::Windows::Forms::TextBox());
            this->txtUnit2 = (gcnew System::Windows::Forms::TextBox());
            this->txtUnit1 = (gcnew System::Windows::Forms::TextBox());
            this->txtTurnSpac1 = (gcnew System::Windows::Forms::TextBox());
            this->txtWirDiam1 = (gcnew System::Windows::Forms::TextBox());
            this->txtNumTurns1 = (gcnew System::Windows::Forms::TextBox());
            this->txtDiam1 = (gcnew System::Windows::Forms::TextBox());
            this->label6 = (gcnew System::Windows::Forms::Label());
            this->label5 = (gcnew System::Windows::Forms::Label());
            this->label4 = (gcnew System::Windows::Forms::Label());
            this->label3 = (gcnew System::Windows::Forms::Label());
            this->groupBox3 = (gcnew System::Windows::Forms::GroupBox());
            this->radMillimeters = (gcnew System::Windows::Forms::RadioButton());
            this->radInches = (gcnew System::Windows::Forms::RadioButton());
            this->tabPage5 = (gcnew System::Windows::Forms::TabPage());
            this->tabPage4 = (gcnew System::Windows::Forms::TabPage());
            this->tabPage3 = (gcnew System::Windows::Forms::TabPage());
            this->tabPage2 = (gcnew System::Windows::Forms::TabPage());
            this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
            this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
            this->sparklength = (gcnew System::Windows::Forms::TextBox());
            this->label2 = (gcnew System::Windows::Forms::Label());
            this->watts = (gcnew System::Windows::Forms::TextBox());
            this->label1 = (gcnew System::Windows::Forms::Label());
            this->wattlabel = (gcnew System::Windows::Forms::Label());
            this->sparklengthlabel = (gcnew System::Windows::Forms::Label());
            this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
            this->wattdeterminespark = (gcnew System::Windows::Forms::RadioButton());
            this->sparklengthdeterminewatt = (gcnew System::Windows::Forms::RadioButton());
            this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
            this->toolStrip1->SuspendLayout();
            this->tabPage6->SuspendLayout();
            this->groupBox5->SuspendLayout();
            this->groupBox4->SuspendLayout();
            this->groupBox3->SuspendLayout();
            this->tabPage1->SuspendLayout();
            this->groupBox2->SuspendLayout();
            this->groupBox1->SuspendLayout();
            this->tabControl1->SuspendLayout();
            this->SuspendLayout();
            //
            // toolStrip1
            //
            this->toolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(5) {this->toolStripButton1,
                this->toolStripButton2, this->toolStripButton3, this->toolStripButton4, this->toolStripDropDownButton1});
            this->toolStrip1->Location = System::Drawing::Point(0, 0);
            this->toolStrip1->Name = L"toolStrip1";
            this->toolStrip1->Size = System::Drawing::Size(782, 25);
            this->toolStrip1->TabIndex = 1;
            this->toolStrip1->Text = L"toolStrip1";
            //
            // toolStripButton1
            //
            this->toolStripButton1->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text;
            this->toolStripButton1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(11) {this->newToolStripMenuItem,
                this->toolStripSeparator1, this->openToolStripMenuItem, this->toolStripSeparator2, this->saveToolStripMenuItem, this->saveAsToolStripMenuItem,
                this->toolStripSeparator3, this->printToolStripMenuItem, this->printPreviewToolStripMenuItem, this->toolStripSeparator4, this->saveAndExitToolStripMenuItem});
            this->toolStripButton1->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripButton1.Image")));
            this->toolStripButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
            this->toolStripButton1->Name = L"toolStripButton1";
            this->toolStripButton1->Size = System::Drawing::Size(36, 22);
            this->toolStripButton1->Text = L"File";
            //
            // newToolStripMenuItem
            //
            this->newToolStripMenuItem->Name = L"newToolStripMenuItem";
            this->newToolStripMenuItem->Size = System::Drawing::Size(148, 22);
            this->newToolStripMenuItem->Text = L"New Coil";
            //
            // toolStripSeparator1
            //
            this->toolStripSeparator1->Name = L"toolStripSeparator1";
            this->toolStripSeparator1->Size = System::Drawing::Size(145, 6);
            //
            // openToolStripMenuItem
            //
            this->openToolStripMenuItem->Name = L"openToolStripMenuItem";
            this->openToolStripMenuItem->Size = System::Drawing::Size(148, 22);
            this->openToolStripMenuItem->Text = L"Open Coil";
            //
            // toolStripSeparator2
            //
            this->toolStripSeparator2->Name = L"toolStripSeparator2";
            this->toolStripSeparator2->Size = System::Drawing::Size(145, 6);
            //
            // saveToolStripMenuItem
            //
            this->saveToolStripMenuItem->Name = L"saveToolStripMenuItem";
            this->saveToolStripMenuItem->Size = System::Drawing::Size(148, 22);
            this->saveToolStripMenuItem->Text = L"Save Coil";
            //
            // saveAsToolStripMenuItem
            //
            this->saveAsToolStripMenuItem->Name = L"saveAsToolStripMenuItem";
            this->saveAsToolStripMenuItem->Size = System::Drawing::Size(148, 22);
            this->saveAsToolStripMenuItem->Text = L"Save Coil As";
            //
            // toolStripSeparator3
            //
            this->toolStripSeparator3->Name = L"toolStripSeparator3";
            this->toolStripSeparator3->Size = System::Drawing::Size(145, 6);
            //
            // printToolStripMenuItem
            //
            this->printToolStripMenuItem->Name = L"printToolStripMenuItem";
            this->printToolStripMenuItem->Size = System::Drawing::Size(148, 22);
            this->printToolStripMenuItem->Text = L"Print";
            //
            // printPreviewToolStripMenuItem
            //
            this->printPreviewToolStripMenuItem->Name = L"printPreviewToolStripMenuItem";
            this->printPreviewToolStripMenuItem->Size = System::Drawing::Size(148, 22);
            this->printPreviewToolStripMenuItem->Text = L"Print Preview";
            //
            // toolStripSeparator4
            //
            this->toolStripSeparator4->Name = L"toolStripSeparator4";
            this->toolStripSeparator4->Size = System::Drawing::Size(145, 6);
            //
            // saveAndExitToolStripMenuItem
            //
            this->saveAndExitToolStripMenuItem->Name = L"saveAndExitToolStripMenuItem";
            this->saveAndExitToolStripMenuItem->Size = System::Drawing::Size(148, 22);
            this->saveAndExitToolStripMenuItem->Text = L"Exit";
            //
            // toolStripButton2
            //
            this->toolStripButton2->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text;
            this->toolStripButton2->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripButton2.Image")));
            this->toolStripButton2->ImageTransparentColor = System::Drawing::Color::Magenta;
            this->toolStripButton2->Name = L"toolStripButton2";
            this->toolStripButton2->Size = System::Drawing::Size(38, 22);
            this->toolStripButton2->Text = L"Edit";
            //
            // toolStripButton3
            //
            this->toolStripButton3->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text;
            this->toolStripButton3->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripButton3.Image")));
            this->toolStripButton3->ImageTransparentColor = System::Drawing::Color::Magenta;
            this->toolStripButton3->Name = L"toolStripButton3";
            this->toolStripButton3->Size = System::Drawing::Size(42, 22);
            this->toolStripButton3->Text = L"View";
            //
            // toolStripButton4
            //
            this->toolStripButton4->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text;
            this->toolStripButton4->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->teslaComponentCreatorToolStripMenuItem,
                this->conversionsToolStripMenuItem});
            this->toolStripButton4->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripButton4.Image")));
            this->toolStripButton4->ImageTransparentColor = System::Drawing::Color::Magenta;
            this->toolStripButton4->Name = L"toolStripButton4";
            this->toolStripButton4->Size = System::Drawing::Size(45, 22);
            this->toolStripButton4->Text = L"Tools";
            //
            // teslaComponentCreatorToolStripMenuItem
            //
            this->teslaComponentCreatorToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->capacitorsToolStripMenuItem});
            this->teslaComponentCreatorToolStripMenuItem->Name = L"teslaComponentCreatorToolStripMenuItem";
            this->teslaComponentCreatorToolStripMenuItem->Size = System::Drawing::Size(213, 22);
            this->teslaComponentCreatorToolStripMenuItem->Text = L"Tesla Component Creators";
            //
            // capacitorsToolStripMenuItem
            //
            this->capacitorsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->mMCToolStripMenuItem4,
                this->polyPlateToolStripMenuItem});
            this->capacitorsToolStripMenuItem->Name = L"capacitorsToolStripMenuItem";
            this->capacitorsToolStripMenuItem->Size = System::Drawing::Size(136, 22);
            this->capacitorsToolStripMenuItem->Text = L"Capacitors";
            //
            // mMCToolStripMenuItem4
            //
            this->mMCToolStripMenuItem4->Name = L"mMCToolStripMenuItem4";
            this->mMCToolStripMenuItem4->Size = System::Drawing::Size(133, 22);
            this->mMCToolStripMenuItem4->Text = L"MMC";
            this->mMCToolStripMenuItem4->Click += gcnew System::EventHandler(this, &Form1::mMCToolStripMenuItem4_Click);
            //
            // polyPlateToolStripMenuItem
            //
            this->polyPlateToolStripMenuItem->Name = L"polyPlateToolStripMenuItem";
            this->polyPlateToolStripMenuItem->Size = System::Drawing::Size(133, 22);
            this->polyPlateToolStripMenuItem->Text = L"Poly-Plate";
            //
            // conversionsToolStripMenuItem
            //
            this->conversionsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->dimensionsToolStripMenuItem,
                this->electricityToolStripMenuItem});
            this->conversionsToolStripMenuItem->Name = L"conversionsToolStripMenuItem";
            this->conversionsToolStripMenuItem->Size = System::Drawing::Size(213, 22);
            this->conversionsToolStripMenuItem->Text = L"Conversions";
            //
            // dimensionsToolStripMenuItem
            //
            this->dimensionsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->lengthToolStripMenuItem});
            this->dimensionsToolStripMenuItem->Name = L"dimensionsToolStripMenuItem";
            this->dimensionsToolStripMenuItem->Size = System::Drawing::Size(138, 22);
            this->dimensionsToolStripMenuItem->Text = L"Dimensions";
            //
            // lengthToolStripMenuItem
            //
            this->lengthToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {this->milimetersToIInchesToolStripMenuItem,
                this->inchesToMillimetersToolStripMenuItem, this->inchesToFeetToolStripMenuItem, this->feetToInchesToolStripMenuItem});
            this->lengthToolStripMenuItem->Name = L"lengthToolStripMenuItem";
            this->lengthToolStripMenuItem->Size = System::Drawing::Size(118, 22);
            this->lengthToolStripMenuItem->Text = L"Length";
            //
            // milimetersToIInchesToolStripMenuItem
            //
            this->milimetersToIInchesToolStripMenuItem->Name = L"milimetersToIInchesToolStripMenuItem";
            this->milimetersToIInchesToolStripMenuItem->Size = System::Drawing::Size(182, 22);
            this->milimetersToIInchesToolStripMenuItem->Text = L"Millimeters to Inches";
            //
            // inchesToMillimetersToolStripMenuItem
            //
            this->inchesToMillimetersToolStripMenuItem->Name = L"inchesToMillimetersToolStripMenuItem";
            this->inchesToMillimetersToolStripMenuItem->Size = System::Drawing::Size(182, 22);
            this->inchesToMillimetersToolStripMenuItem->Text = L"Inches to Millimeters";
            //
            // inchesToFeetToolStripMenuItem
            //
            this->inchesToFeetToolStripMenuItem->Name = L"inchesToFeetToolStripMenuItem";
            this->inchesToFeetToolStripMenuItem->Size = System::Drawing::Size(182, 22);
            this->inchesToFeetToolStripMenuItem->Text = L"Inches to Feet";
            //
            // feetToInchesToolStripMenuItem
            //
            this->feetToInchesToolStripMenuItem->Name = L"feetToInchesToolStripMenuItem";
            this->feetToInchesToolStripMenuItem->Size = System::Drawing::Size(182, 22);
            this->feetToInchesToolStripMenuItem->Text = L"Feet to Inches";
            //
            // electricityToolStripMenuItem
            //
            this->electricityToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->capacitanceToolStripMenuItem1,
                this->resistanceToolStripMenuItem1});
            this->electricityToolStripMenuItem->Name = L"electricityToolStripMenuItem";
            this->electricityToolStripMenuItem->Size = System::Drawing::Size(138, 22);
            this->electricityToolStripMenuItem->Text = L"Electricity";
            //
            // capacitanceToolStripMenuItem1
            //
            this->capacitanceToolStripMenuItem1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->uhToMhToolStripMenuItem1,
                this->mhToUhToolStripMenuItem1});
            this->capacitanceToolStripMenuItem1->Name = L"capacitanceToolStripMenuItem1";
            this->capacitanceToolStripMenuItem1->Size = System::Drawing::Size(144, 22);
            this->capacitanceToolStripMenuItem1->Text = L"Capacitance";
            //
            // uhToMhToolStripMenuItem1
            //
            this->uhToMhToolStripMenuItem1->Name = L"uhToMhToolStripMenuItem1";
            this->uhToMhToolStripMenuItem1->Size = System::Drawing::Size(127, 22);
            this->uhToMhToolStripMenuItem1->Text = L"uh to mh";
            //
            // mhToUhToolStripMenuItem1
            //
            this->mhToUhToolStripMenuItem1->Name = L"mhToUhToolStripMenuItem1";
            this->mhToUhToolStripMenuItem1->Size = System::Drawing::Size(127, 22);
            this->mhToUhToolStripMenuItem1->Text = L"mh to uh";
            //
            // resistanceToolStripMenuItem1
            //
            this->resistanceToolStripMenuItem1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->blahToBlahToolStripMenuItem1});
            this->resistanceToolStripMenuItem1->Name = L"resistanceToolStripMenuItem1";
            this->resistanceToolStripMenuItem1->Size = System::Drawing::Size(144, 22);
            this->resistanceToolStripMenuItem1->Text = L"Resistance";
            //
            // blahToBlahToolStripMenuItem1
            //
            this->blahToBlahToolStripMenuItem1->Name = L"blahToBlahToolStripMenuItem1";
            this->blahToBlahToolStripMenuItem1->Size = System::Drawing::Size(141, 22);
            this->blahToBlahToolStripMenuItem1->Text = L"Blah to Blah";
            //
            // toolStripDropDownButton1
            //
            this->toolStripDropDownButton1->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text;
            this->toolStripDropDownButton1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->allHelpInManualToolStripMenuItem});
            this->toolStripDropDownButton1->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripDropDownButton1.Image")));
            this->toolStripDropDownButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
            this->toolStripDropDownButton1->Name = L"toolStripDropDownButton1";
            this->toolStripDropDownButton1->Size = System::Drawing::Size(41, 22);
            this->toolStripDropDownButton1->Text = L"Help";
            //
            // allHelpInManualToolStripMenuItem
            //
            this->allHelpInManualToolStripMenuItem->Name = L"allHelpInManualToolStripMenuItem";
            this->allHelpInManualToolStripMenuItem->Size = System::Drawing::Size(171, 22);
            this->allHelpInManualToolStripMenuItem->Text = L"All help in manual.";


Attached File(s)
Attached File  BuildLog.htm ( 5.43k ) Number of downloads: 17
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Problem-Visual C++ Won't Find My If Code Ste, But It's In Plai
7 Jun, 2007 - 03:35 PM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,225



Thanked: 36 times
Dream Kudos: 25
My Contributions
Can you point to the if statements you are referring to? I see only one if, and no else statements.
User is online!Profile CardPM
+Quote Post

BeaverDono
RE: Problem-Visual C++ Won't Find My If Code Ste, But It's In Plai
7 Jun, 2007 - 05:20 PM
Post #3

New D.I.C Head
*

Joined: 17 Apr, 2007
Posts: 36


My Contributions
Can I suggest something? I am not sure if this will do anything really since I've only been playing around with C++ for a few months.. but, doesn't it need a closing } at the end of the program?

For the life of me, all I can think about is those {} being the problem.. I could be wrong but might be something to look into.
User is offlineProfile CardPM
+Quote Post

jasonprince2
RE: Problem-Visual C++ Won't Find My If Code Ste, But It's In Plai
7 Jun, 2007 - 06:54 PM
Post #4

New D.I.C Head
*

Joined: 6 Jun, 2007
Posts: 19


My Contributions
Never mind. Everything works. BeaverDono was right. I needed braces. The other thing didn't post all the code. Here's what I had before:

CODE

private: System::Void wattdeterminespark_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
//This is the other good one.
             if (sparklengthdeterminewatt->Checked == true)
{
             this->watts->ReadOnly = true;
             this->sparklength->ReadOnly = false;
}
else
{
             this->watts->ReadOnly = false;
             this->sparklength->ReadOnly = true;
}         }
private: System::Void mMCToolStripMenuItem4_Click(System::Object^  sender, System::EventArgs^  e) {
         }
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
         }
private: System::Void butStep1a_Click(System::Object^  sender, System::EventArgs^  e) {
//This is the good one.
             if (sparklengthdeterminewatt->Checked == true)
{
             this->watts->ReadOnly = true;
             this->sparklength->ReadOnly = false;
}
else
{
             this->watts->ReadOnly = false;
             this->sparklength->ReadOnly = true;
}
         }
private: System::Void textBox6_TextChanged(System::Object^  sender, System::EventArgs^  e) {
         }
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
            ;
         }
private: System::Void radInches_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
//Here is the messed up one.
             if (radInches->Checked == true)
            
                             this->txtUnit3->Text = L"In.";
                            this->txtUnit2->Text = L"In.";
                            this->txtUnit1->Text = L"In.";
            
             else
                         
                 this->txtUnit3->Text = L"Mm.";
                 this->txtUnit2->Text = L"Mm.";
                 this->txtUnit1->Text = L"Mm.";
        
             }


here's what I have now:

CODE

private: System::Void wattdeterminespark_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
//This is the other good one.
             if (sparklengthdeterminewatt->Checked == true)
{
             this->watts->ReadOnly = true;
             this->sparklength->ReadOnly = false;
}
else
{
             this->watts->ReadOnly = false;
             this->sparklength->ReadOnly = true;
}         }
private: System::Void mMCToolStripMenuItem4_Click(System::Object^  sender, System::EventArgs^  e) {
         }
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
         }
private: System::Void butStep1a_Click(System::Object^  sender, System::EventArgs^  e) {
//This is the good one.
             if (sparklengthdeterminewatt->Checked == true)
{
             this->watts->ReadOnly = true;
             this->sparklength->ReadOnly = false;
}
else
{
             this->watts->ReadOnly = false;
             this->sparklength->ReadOnly = true;
}
         }
private: System::Void textBox6_TextChanged(System::Object^  sender, System::EventArgs^  e) {
         }
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
            ;
         }
private: System::Void radInches_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
//Here is the messed up one.
             if (radInches->Checked == true)
             {
                             this->txtUnit3->Text = L"In.";
                            this->txtUnit2->Text = L"In.";
                            this->txtUnit1->Text = L"In.";
             }
             else
             {             
                 this->txtUnit3->Text = L"Mm.";
                 this->txtUnit2->Text = L"Mm.";
                 this->txtUnit1->Text = L"Mm.";
         }
             }

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 09:30AM

Live C++ Help!

C++ Tutorials