Finns det någon som har råkat ut för detta meddelande i VB.NET på Win2k ? Vet ej vad ditt fel beror på, låter rätt underligt. Har du en 60 dagars version av Vs .Net du kör på eller vad kodar du VB .Net i? system.arithmeticException
Vad beror det på? Hur kommer man runt problemet?
Jag har blivit tvungen att formatera hårddisken oc h installera allt från scrach, då har miljön fungerat några timmar men sedan har jag fått tillbaka eländet.
Detta har drabbat bägge mina datorer.
Tack på förhand för alla tips och råd
/HamidSv: system.arithmeticException
"ArithmeticException is the base class for DivideByZeroException, NotFiniteNumberException, and OverflowException. In general, use one of the derived classes of ArithmeticException to more precisely indicate the exact nature of the error."
Om det är ditt egna program som orsakar den så har du skrivit fel i din kod, här har du ett exempel dock i C#:
<code>
namespace Foo
{
using System;
public class FooTest
{
public static void Main()
{
Test t = new Test();
t.TestFunc();
}
public void TestFunc()
{
try
{
double a = 5;
double b = 0;
Console.WriteLine ("{0} / {1} = {2}",
a, b, DoDivide(a,b));
}
catch (System.DivideByZeroException)
{
Console.WriteLine(
"DivideByZeroException caught!");
}
catch (System.ArithmeticException)
{
Console.WriteLine(
"ArithmeticException caught!");
}
catch
{
Console.WriteLine(
"Unknown exception caught");
}
}
public double DoDivide(double a, double b)
{
if (b == 0)
throw new System.DivideByZeroException();
if (a == 0)
throw new System.ArithmeticException();
return a/b;
}
}
}
</code>
JN