Post Reply 
example python ppl with subroutines hp prime
06-08-2021, 05:28 AM (This post was last modified: 06-08-2021 05:54 AM by toml_12953.)
Post: #2
RE: example python ppl with subroutines hp prime
(06-08-2021 01:53 AM)Liamtoh Resu Wrote:  edit: fixed ppl code, was missing predeclaration for cls().

You don't need to pre-declare functions anymore. The below still works.

Code:
// aprxpi01

// main program
EXPORT aprxpi01()
BEGIN
cls();
pintro();
pout();
end;

// clear screen
cls()
begin
print();
end;

// print intro
pintro()
begin
print("aprxpi01: pi approximation");
end;

// pi approximation
api()
begin
return 355/113;
end;

// print output
local q1;
pout()
begin
q1 := api();
print("pi = " + q1);
end;

// end of source code

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: example python ppl with subroutines hp prime - toml_12953 - 06-08-2021 05:28 AM



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