Post Reply 
Newbie to HP PPL
09-01-2023, 01:50 PM (This post was last modified: 09-01-2023 01:52 PM by gehakte_bits.)
Post: #3
RE: Newbie to HP PPL
Here are some examples in PPL [/code]...
Code:

// 2023.0901 pretty-prime v0.3b
#pragma mode(separator(.,;) integer(h32))

//=============
EXPORT prog()                               // most literally
BEGIN 
LOCAL a,b,c,d,e;
  PRINT();
  PRINT("Enter zero for unknown");WAIT(1);
  PRINT("Sin Θ = OPP/HYP");
  INPUT(a,"Sin Θ");
  INPUT(b,"OPP");
  INPUT(c,"HYP");
  IF a=0 THEN 
    d:=b/c;
    e:=ASIN(d);
    PRINT("B/C = "+d);
    PRINT("Θ ="+e);
  END;
END;

//=============
EXPORT prog1()                              // fancier input
BEGIN 
LOCAL x,a,b,c,d,e;
  x:=INPUT({{a,[0],{30,30,1}},
            {b,[0],{30,30,2}},
            {c,[0],{30,30,3}}},
           "Sin Θ = OPP/HYP",
           {"Sin Θ ","OPP ","HYP "},{},{},{0,10,10});
  IF x=1 THEN 
    d:=b/c;
    e:=ASIN(d);
    PRINT();
    PRINT("B/C = "+d);
    PRINT("Θ ="+e);
  END;
END;

//============= one of many solve solutions...(FNROOT,ROOT,fsolve...) 
EXPORT hypp,opp,sinΘ;                       // must use externals with Solve
EXPORT prog2()                              // use solver
BEGIN 
  E1:='SIN(sinΘ)=opp/hypp';
  FOR X:=0 TO 9 DO 
    Solve.UNCHECK(X);
  END;
  Solve.CHECK(1);                           // select E1
  STARTAPP("Solve");
  STARTVIEW(2);
  DelHVars(sinΘ);
END;
[code]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Newbie to HP PPL - nonakag - 09-01-2023, 05:34 AM
RE: Newbie to HP PPL - Insoft - 09-01-2023, 12:54 PM
RE: Newbie to HP PPL - nonakag - 09-01-2023, 02:41 PM
RE: Newbie to HP PPL - gehakte_bits - 09-01-2023 01:50 PM
RE: Newbie to HP PPL - nonakag - 09-01-2023, 02:47 PM
RE: Newbie to HP PPL - nonakag - 09-02-2023, 04:32 AM



User(s) browsing this thread: 1 Guest(s)