(04-03-2017 12:00 AM)roadrunner Wrote: [ -> ]A, B, and C already exist so declaring them local confuses the compiler. Try this:

Code:

`EXPORT EXAMPLE()`

BEGIN

LOCAL TMP;

// LOCAL A,B,C;

A:=2000.0;

B:=1.0;

C:=0.0;

TMP:=solve((C/(π*B/12.0))-A,C);

MSGBOX("RESULT = " + TMP);

END;

-road

MohrCircle()

BEGIN

//Declare Local Variables

LOCAL theta1,theta3,thetaPrime1,thetaPrime3,phiPrime,u,ch1;

LOCAL c:=1;

MSGBOX("Mohr's Circle Equations");

INPUT({{theta1,1},{theta3,1},{thetaPrime1,1},{thetaPrime3,1},{phiPrime,1},{u,1},{c,1}},"Select given values");

CASE

IF c==0 THEN

INPUT({A,B,C,D,E,F},"Enter given values",

{"σ1=","σ3=","σ'1=","σ'3=","Ø'=","u="},

{"Major Princ Stress [kN/m²]","Min Princ Stress [kN/m²]",

"Maj Princ Eff Stress [kN/m²]","Min Princ Eff Stress [kN/m²]",

"Friction Angle [°]","Pore Water Pressure [kN/m²]"});

theta1:=A;

theta3:=B;

thetaPrime1:=C;

thetaPrime3:=D;

phiPrime:=E;

u:=F;

// Solve.SOLVE(thetaPrime1 = thetaPrime3*(TAN(45+(phiPrime/2)))^2 + 2*X*TAN(45+(phiPrime/2)),X);

c:=solve(C=D*(TAN(45+(E/2)))^2+2*X*TAN(45+(E/2)),X);

MSGBOX("c = "+c);

RETURN c;

END;

END;

Hi,

I tried the suggestion, however I also get "{X}" returned to the Home Screen. Not sure how to implement solve() in a program? Any suggestions?