# illegal start of an expression!!

Printable View

• 06-06-2013, 08:42 PM
gbonecapone
illegal start of an expression!!
i am totally stumped on why im getting these two errors. can someone take a look at it?

double newT;

if (newT > t) && (lf > li) ERROR HERE unexpected type. required class. found value.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
di = (newT - l * dinv - df * ((1 / lf) - dinv)) / ((1 / li) - dinv);
else{

//GOTO 1505
t=ta+ti+tf;
if (newT < t) && (lf > li) { ERROR HERE ";" expected <<<<<<<<<<<<<<<<<<<<<<<<<<<<
df = (newT - l * dinv - di * ((1 / li) - dinv)) / ((1 / lf) - dinv);
tf = df / lf;
// }//THEN GOSUB 1520: GOTO 1505
t=ta+ti+tf;
if (lf < li) {
double templf = lf; lf = li; li = templf;
double tempdf = df; df = di; di = tempdf;
double tempTF = tf; tf = ti; ti = tempTF;
if (newT > t){
di = (newT - l * dinv - df * ((1 / lf) - dinv)) / ((1 / li) - dinv);
ti = di / li;
}
} else{ df = (newT - l * dinv - di * ((1 / li) - dinv)) / ((1 / lf) - dinv);
tf = df / lf;}
double templf = lf; lf = li; li = templf;
double tempdf = df; df = di; di = tempdf;
double tempTF = tf; tf = ti; ti = tempTF;
}}
df = (newT - l * dinv - di * ((1 / li) - dinv)) / ((1 / lf) - dinv);
tf = df / lf;
t=ta+ti+tf;
• 06-06-2013, 08:51 PM
JosAH
Re: illegal start of an expression!!
Quote:

Originally Posted by gbonecapone
if (newT > t) && (lf > li) ERROR HERE unexpected type. required class. found value.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

The syntax is if ( ... )

Check your parentheses, you wrote if ( ... ) && ( ... )

You probably wanted to write if (newT > t && lf > li)

b.t.w. those are terrible variable names ...

kind regards,

Jos
• 06-06-2013, 08:51 PM
sehudson
Re: illegal start of an expression!!
Please wrap your code in tags to make it easier to read.
Also, is this code inside of a class declaration, for example:

Code:

```public class Example { //code here }```
• 06-06-2013, 09:08 PM
gbonecapone
Re: illegal start of an expression!!
parentheses worked! thanks and haha yeah i know they are. im converting a program from basic and am just using the same variables names for ease of following the code. planning on changing them in the future. thanks for all the help youve been giving me.