PDA

Click to See Complete Forum and Search --> : compiling problem


nokmaster
Apr 4th, 2007, 01:53 AM
im having problem compiling with this code.. what is the problem of this 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

jmcilhinney
Apr 4th, 2007, 02:19 AM
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?

nokmaster
Apr 4th, 2007, 04:27 AM
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 :D hope you help me compiling this code

regards

jmcilhinney
Apr 4th, 2007, 06:58 AM
So you're refusing to post the error message? You must not want help very badly.

jmcilhinney
Apr 4th, 2007, 11:22 PM
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).