# Thread: illegal start of an expression!!

1. Member
Join Date
May 2013
Posts
68
Rep Power
0

## 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;

2. ## Re: illegal start of an expression!!

Also, is this code inside of a class declaration, for example:

Java Code:
```public class Example {

//code here

}```

3. ## Re: illegal start of an expression!!

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

4. Member
Join Date
May 2013
Posts
68
Rep Power
0

## 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.