Problems with return value of function - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Problems with return value of function (/thread-8568.html) Problems with return value of function - Powersoft - 06-25-2017 02:44 PM I am starting to program the HP Prime again after a long time! Try to start with a simple program that is running almost perfect. See program below. In the export function a call the subroutine Eccentricity is placed, this should give back a value of E. It's give the value "0" back. But when I print it before the Return it has a value. I can't understand why this is happens. Please need some help! Thanks for any help Code: ```Eccentricity(ecc,M) ; EXPORT KEPLER(ecc,M) BEGIN PRINT;  //Clear screen LOCAL E; //Local variable E=Eccentricity(ecc,M); PRINT("E="+E); HAngle:=0; END; Eccentricity(ecc,M)  // kepler's routine BEGIN LOCAL Rad2Deg,E,F,err,iter; print("ecc = "+ecc);  //ecentricity print("M = "+M); HAngle:=1; //Degree mode Rad2Deg := 180 / pi;  //start values for iteration E := M + (ecc * sin(M) * (1.0 + (ecc * cos(M)))); F := E - (E - (Rad2Deg * ecc * sin(E)) - M) / (1 - ecc * cos(E)); err := abs(F - E); iter:=0; print(err); WHILE (err > 1e-9) DO   iter := iter + 1;   F := E - (E - (Rad2Deg * ecc * sin(E)) - M) / (1 - ecc * cos(E));   err := abs (F - E);   //print(err);   E := F; END; print("iterations = "+iter); print("E = "+E); print("F = "+F); RETURN E; END;``` RE: Problems with return value of function - Didier Lachieze - 06-25-2017 03:11 PM A ":" is missing in this line: E:=Eccentricity(ecc,M);