Results 1 to 5 of 5

Thread: compiling problem

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    compiling problem

    im having problem compiling with this code.. what is the problem of this code?

    Code:
    private void sensorwatch()
    {
    while (Thread.CurrentThread.IsAlive)
    {
    //Wait for sensor to be ready
    while (Inp(inportAddress) == sensor2);
    
    //Scan sensor activity
    while (Inp(inportAddress) != sensor2)
    {
    if (Inp(inportAddress) == sensor1) //BB has passed thru sensor1
    QueryPerformanceCounter(ref time1); //record the time
    }
    
    QueryPerformanceCounter(ref time2); //BB has passed thru sensor 2
    
    //Compute the Velocity
    elapsed = time2 - time1;
    ts = (1 / freq) * elapsed;
    
    FpsResult = System.Math.Round(1/(ts * (12/sensorGap)), 3);
    MpsResult = System.Math.Round(FpsResult / 3.333333,3);
    
    if (Thread.CurrentThread.IsAlive)
    {
    //Add list to Velocity log
    lstFireLog.Items.Add("Fire # " + fireCount.ToString() + " : " +
    Convert.ToString(Math.Round(ts * 1000,4)) + " millisec : " +
    MpsResult + " mps | " + FpsResult + " fps");
    
    lstFireLog.SelectedIndex = lstFireLog.Items.Count - 1;
    
    lblFPSResult.Text = Convert.ToString(System.Math.Round(FpsResult, 0));
    lblMPSResult.Text = Convert.ToString(System.Math.Round(MpsResult, 0));
    
    //Compute the average FPS and MPS
    FPSArray.Add(FpsResult);
    MPSArray.Add(MpsResult);
    
    FPSSum = FPSSum + Convert.ToDouble(FPSArray[fireCount]);
    MPSSum = MPSSum + Convert.ToDouble(MPSArray[fireCount]);
    
    fpsAverage = Math.Round(FPSSum / FPSArray.Count,2);
    mpsAverage = Math.Round(MPSSum / MPSArray.Count,2);
    
    lblFPSAve.Text = fpsAverage.ToString();
    lblMPSAve.Text = mpsAverage.ToString();
    
    //increment fire count
    lblFireCount.Text = fireCount.ToString();
    fireCount++;
    }
    }
    }
    regards

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: compiling problem

    If the code won't compile then the IDE will give you at least one error message. Are you prepared to pass that on or are we to just guess?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: compiling problem

    Quote Originally Posted by jmcilhinney
    If the code won't compile then the IDE will give you at least one error message. Are you prepared to pass that on or are we to just guess?
    probably we just guess hope you help me compiling this code

    regards

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: compiling problem

    So you're refusing to post the error message? You must not want help very badly.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: compiling problem

    If you cannot compile your code then Visual Studio will tell you why. Each issue will be underlined in red. You can mouse over those red underlined parts and the tool tip will appear containing the error message. Those same error messages are listed in the Errors window, where you can double-click any error message and the IDE will highlight the offending code.

    I strongly suggest that you use the tools at your disposal and do all that you can do before asking someone else to do it for you. If you've done all that you can do and it still doesn't, then you need to provide the (which you've), provide the error message (which you haven't) and point out exactly where the error occurs (which you also haven't).
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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