Το πρόγραμμα που έχω το πρόβλημα είναι το παρακάτω
<
asp:Content ID="Content1" ContentPlaceHolderID="PageContents" Runat="Server">
<TABLE border=0 cellPadding=0 cellSpacing=0 WIDTH="100%" align="Center">
<TR vAlign=bottom><TD height=27 width="100%" ALIGN="CENTER"><H1>Scientific calculator</H1></TD></TR>
<TR>
<TD vAlign=top width="100%">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%" ALIGN="CENTER">
<TR align=left vAlign=top>
<TD width="100%">
<FORM name=Scientific onsubmit=return(false);>
<CENTER><INPUT name=TheValue size=46><BR>
<TABLE>
<TR>
<TD><A HREF="BLOCKED SCRIPTScientNot();" onclick="ScientNot();return false;"><IMG SRC="pictures/buttonNot.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('and');" onclick="ScientDoOperation('and');return false;"><IMG SRC="pictures/buttonAND.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('or');" onclick="ScientDoOperation('or');return false;"><IMG SRC="pictures/buttonOR.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('xor');" onclick="ScientDoOperation('xor');return false;"><IMG SRC="pictures/buttonXOR.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('7');" onclick="ScientNumber('7');return false;"><IMG SRC="Pictures/button7.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('8');" onclick="ScientNumber('8');return false;"><IMG SRC="Pictures/button8.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('9');" onclick="ScientNumber('9');return false;"><IMG SRC="Pictures/button9.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('division');" onclick="ScientDoOperation('division');return false;"><IMG SRC="Pictures/buttonDivision.gif" border=0></A></TD>
</TR>
<TR>
<TD><A HREF="BLOCKED SCRIPTScientPowerTo2();" onclick="ScientPowerTo2();return false;"><IMG SRC="pictures/buttonPowerTo2.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('powertox');" onclick="ScientDoOperation('powertox');return false;"><IMG SRC="pictures/buttonPowerToX.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientSquareRoot();" onclick="ScientSquareRoot();return false;"><IMG SRC="pictures/buttonSquareRoot.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('buttonXRootX');" onclick="ScientDoOperation('buttonXRootX');return false;"><IMG SRC="pictures/buttonXRootX.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('4');" onclick="ScientNumber('4');return false;"><IMG SRC="Pictures/button4.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('5');" onclick="ScientNumber('5');return false;"><IMG SRC="Pictures/button5.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('6');" onclick="ScientNumber('6');return false;"><IMG SRC="Pictures/button6.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('multiplication');" onclick="ScientDoOperation('multiplication');return false;"><IMG SRC="Pictures/buttonMultiplication.gif" border=0></A></TD>
</TR>
<TR>
<TD><A HREF="BLOCKED SCRIPTScientIncrease();" onclick="ScientIncrease();return false;"><IMG SRC="pictures/buttonIncrease.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDecrease();" onclick="ScientDecrease();return false;"><IMG SRC="pictures/buttonDecrease.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('min');" onclick="ScientDoOperation('min');return false;"><IMG SRC="pictures/buttonMin.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('max');" onclick="ScientDoOperation('max');return false;"><IMG SRC="pictures/buttonMax.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('1');" onclick="ScientNumber('1');return false;"><IMG SRC="Pictures/button1.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('2');" onclick="ScientNumber('2');return false;"><IMG SRC="pictures/button2.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('3');" onclick="ScientNumber('3');return false;"><IMG SRC="pictures/button3.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('subtraction');" onclick="ScientDoOperation('subtraction');return false;"><IMG SRC="pictures/buttonSubtraction.gif" border=0></A></TD>
</TR>
<TR>
<TD><A HREF="BLOCKED SCRIPTScientSin();" onclick="ScientSin();return false;"><IMG SRC="pictures/buttonSin.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientCos();" onclick="ScientCos();return false;"><IMG SRC="pictures/buttonCos.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientTan();" onclick="ScientTan();return false;"><IMG SRC="pictures/buttonTan.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('rightshift');" onclick="ScientDoOperation('rightshift');return false;"><IMG SRC="pictures/buttonRightShift.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('0');" onclick="ScientNumber('0');return false;"><IMG SRC="pictures/button0.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientNumber('.');" onclick="ScientNumber('.');return false;"><IMG SRC="pictures/buttonDot.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientChangeSign();" onclick="ScientChangeSign();return false;"><IMG SRC="pictures/buttonChangeSign.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('addition');" onclick="ScientDoOperation('addition');return false;"><IMG SRC="pictures/buttonAddition.gif" border=0></A></TD>
</TR>
<TR>
<TD><A HREF="BLOCKED SCRIPTScientASin();" onclick="ScientASin();return false;"><IMG SRC="pictures/buttonASin.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientACos();" onclick="ScientACos();return false;"><IMG SRC="pictures/buttonACos.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientATan();" onclick="ScientATan();return false;"><IMG SRC="pictures/buttonATan.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('leftshift');" onclick="ScientDoOperation('leftshift');return false;"><IMG SRC="pictures/buttonLeftShift.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientCommandClear();" onclick="ScientCommandClear();return false;"><IMG SRC="Pictures/buttonClear.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientEuroToDr();" onclick="ScientEuroToDr();return false;"><IMG SRC="pictures/buttonDR.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDrToEuro();" onclick="ScientDrToEuro();return false;"><IMG SRC="pictures/buttonEuro.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientDoOperation('equals');" onclick="ScientDoOperation('equals');return false;"><IMG SRC="pictures/buttonEqual.gif" border=0></A></TD>
</TR>
<TR>
<TD><A HREF="BLOCKED SCRIPTScientPersentage();" onclick="ScientPersentage();return false;"><IMG SRC="pictures/buttonPercentage.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientOneOverX();" onclick="ScientOneOverX();return false;"><IMG SRC="pictures/buttonOneOverX.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientInteger();" onclick="ScientInteger();return false;"><IMG SRC="pictures/buttonInteger.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientFactorial();" onclick="ScientFactorial();return false;"><IMG SRC="pictures/buttonFactorial.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientLog();" onclick="ScientLog();return false;"><IMG SRC="pictures/buttonLn.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientAbs();" onclick="ScientAbs();return false;"><IMG SRC="pictures/buttonAbs.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientPi();" onclick="ScientPi();return false;"><IMG SRC="pictures/buttonPi.gif" border=0></A></TD>
<TD><A HREF="BLOCKED SCRIPTScientE();" onclick="ScientE();return false;"><IMG SRC="pictures/buttonE.gif" border=0></A></TD>
</TR>
</TABLE>
</CENTER>
</FORM>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<SCRIPT language=JavaScript>
var Scientific = new Object;
var ScientPrevious
var ScientTheOperation
var ScientClearOnInput
function ScientCommandClear()
{
ScientClearOnInput =
true;
ScientPrevious =
'0';
document.Scientific.TheValue.value =
'0';
ScientTheOperation =
'';
}
function ScientAbs()
{
if(document.Scientific.TheValue.value.charAt(0) == '-')
{
document.Scientific.TheValue.value = document.Scientific.TheValue.value.substr(1, document.Scientific.TheValue.value.length);
}
}
function ScientLog()
{
document.Scientific.TheValue.value = Math.log(parseFloat(document.Scientific.TheValue.value));
}
function ScientSin()
{
document.Scientific.TheValue.value = Math.sin(parseFloat(document.Scientific.TheValue.value));
}
function ScientCos()
{
document.Scientific.TheValue.value = Math.cos(parseFloat(document.Scientific.TheValue.value));
}
function ScientTan()
{
document.Scientific.TheValue.value = Math.tan(parseFloat(document.Scientific.TheValue.value));
}
function ScientASin()
{
document.Scientific.TheValue.value = Math.asin(parseFloat(document.Scientific.TheValue.value));
}
function ScientACos()
{
document.Scientific.TheValue.value = Math.acos(parseFloat(document.Scientific.TheValue.value));
}
function ScientATan()
{
document.Scientific.TheValue.value = Math.atan(parseFloat(document.Scientific.TheValue.value));
}
function ScientFactorial()
{
var DotPosition;
var TheValue;
DotPosition = document.Scientific.TheValue.value.indexOf(
'.');
if (DotPosition != -1)
{
TheValue = document.Scientific.TheValue.value.substring(0, DotPosition);
}
else
{
TheValue = document.Scientific.TheValue.value;
}
document.Scientific.TheValue.value = ScientFactorialCalculation(parseFloat(TheValue));
}
function ScientFactorialCalculation(Number)
{
if (Number == 1)
{
return 1;
}
if (Number < 1)
{
return 0;
}
if (Number > 1)
{
NewNumber = Number * ScientFactorialCalculation(Number - 1);
Number--;
return NewNumber;
}
}
function ScientInteger()
{
DotPosition = document.Scientific.TheValue.value.indexOf(
'.')
if (DotPosition != -1)
{
TempValue = document.Scientific.TheValue.value.substring(0, DotPosition);
if (TempValue == '')
TempValue =
'0'
document.Scientific.TheValue.value = TempValue
}
}
function ScientSquareRoot()
{
document.Scientific.TheValue.value = Math.sqrt(parseFloat(document.Scientific.TheValue.value));
}
function ScientPowerTo2()
{
document.Scientific.TheValue.value = Math.pow(parseFloat(document.Scientific.TheValue.value), 2);
}
function ScientNot()
{
document.Scientific.TheValue.value = ~ parseFloat(document.Scientific.TheValue.value)
}
function ScientOneOverX()
{
document.Scientific.TheValue.value = 1 / parseFloat(document.Scientific.TheValue.value)
}
function ScientIncrease()
{
document.Scientific.TheValue.value = parseFloat(document.Scientific.TheValue.value) + 1
}
function ScientDecrease()
{
document.Scientific.TheValue.value = parseFloat(document.Scientific.TheValue.value) - 1
}
function ScientPersentage()
{
document.Scientific.TheValue.value = parseFloat(document.Scientific.TheValue.value) / 100
}
function ScientPi()
{
ScientPrevious = document.Scientific.TheValue.value;
document.Scientific.TheValue.value =
'3.141592653589793';
ScientClearOnInput =
false;
}
function ScientE()
{
ScientPrevious = document.Scientific.TheValue.value;
document.Scientific.TheValue.value =
'2.718281828459045';
ScientClearOnInput =
false;
}
function ScientChangeSign()
{
if(document.Scientific.TheValue.value.charAt(0) == '-')
{
document.Scientific.TheValue.value = document.Scientific.TheValue.value.substr(1, document.Scientific.TheValue.value.length);
}
else
{
if(document.Scientific.TheValue.value != '0')
{
document.Scientific.TheValue.value =
'-' + document.Scientific.TheValue.value;
}
}
}
function ScientNumber(TheNumber)
{
if(ScientClearOnInput)
{
ScientPrevious = document.Scientific.TheValue.value;
document.Scientific.TheValue.value = TheNumber;
ScientClearOnInput =
false;
}
else
{
if(document.Scientific.TheValue.value == '0')
{
document.Scientific.TheValue.value = TheNumber;
}
else
{
document.Scientific.TheValue.value = document.Scientific.TheValue.value + TheNumber;
}
}
}
function ScientDrToEuro()
{
document.Scientific.TheValue.value /= 340.75;
document.Scientific.TheValue.value = Math.floor(document.Scientific.TheValue.value * 100) / 100;
}
function ScientEuroToDr()
{
document.Scientific.TheValue.value *= 340.75;
document.Scientific.TheValue.value = Math.floor(document.Scientific.TheValue.value * 100) / 100;
}
function ScientdoEquals()
{
ScientClearOnInput =
true;
if (ScientTheOperation == 'addition')
{
ScientTheOperation =
'';
return parseFloat(ScientPrevious) + parseFloat(document.Scientific.TheValue.value);
}
if (ScientTheOperation == 'subtraction')
{
ScientTheOperation =
'';
return parseFloat(ScientPrevious) - parseFloat(document.Scientific.TheValue.value);
}
if (ScientTheOperation == 'multiplication')
{
ScientTheOperation =
'';
return parseFloat(ScientPrevious) * parseFloat(document.Scientific.TheValue.value);
}
if (ScientTheOperation == 'division')
{
ScientTheOperation =
'';
return parseFloat(ScientPrevious) / parseFloat(document.Scientific.TheValue.value);
}
if (ScientTheOperation == 'rightshift')
{
ScientTheOperation =
'';
return parseFloat(ScientPrevious) >> parseFloat(document.Scientific.TheValue.value);
}
if (ScientTheOperation == 'leftshift')
{
ScientTheOperation =
'';
return parseFloat(ScientPrevious) << parseFloat(document.Scientific.TheValue.value);
}
if (ScientTheOperation == 'and')
{
ScientTheOperation =
'';
return parseFloat(ScientPrevious) & parseFloat(document.Scientific.TheValue.value);
}
if (ScientTheOperation == 'or')
{
ScientTheOperation =
'';
return parseFloat(ScientPrevious) | parseFloat(document.Scientific.TheValue.value);
}
if (ScientTheOperation == 'xor')
{
ScientTheOperation =
'';
return parseFloat(ScientPrevious) ^ parseFloat(document.Scientific.TheValue.value);
}
if (ScientTheOperation == 'powertox')
{
ScientTheOperation =
'';
return Math.pow(parseFloat(ScientPrevious), parseFloat(document.Scientific.TheValue.value));
}
if (ScientTheOperation == 'buttonXRootX')
{
ScientTheOperation =
'';
return Math.pow(parseFloat(ScientPrevious), 1 / parseFloat(document.Scientific.TheValue.value));
}
if (ScientTheOperation == 'min')
{
ScientTheOperation =
'';
return Math.min(parseFloat(ScientPrevious), parseFloat(document.Scientific.TheValue.value));
}
if (ScientTheOperation == 'max')
{
ScientTheOperation =
'';
return Math.max(parseFloat(ScientPrevious), parseFloat(document.Scientific.TheValue.value));
}
}
function ScientDoOperation(operation)
{
if(ScientTheOperation == '')
{
if(operation == 'equals')
{
ScientClearOnInput =
true;
}
else
{
ScientTheOperation = operation;
ScientClearOnInput =
true;
ScientPrevious = document.Scientific.TheValue.value;
}
}
else
{
var result = ScientdoEquals();
ScientPrevious = document.Scientific.TheValue.value;
document.Scientific.TheValue.value = result;
if(operation != 'equals')
{
ScientTheOperation = operation;
}
else
{
ScientTheOperation =
'';
}
}
}
ScientCommandClear();
</SCRIPT>
</
asp:Content>