From 7cdb37d35e6978c245ca656ba9d55df0a6e362e6 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 9 May 2026 02:56:07 +0200 Subject: Add project skeleton --- examples/hello.uc | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 examples/hello.uc (limited to 'examples') diff --git a/examples/hello.uc b/examples/hello.uc new file mode 100644 index 0000000..bbd7b14 --- /dev/null +++ b/examples/hello.uc @@ -0,0 +1,62 @@ +* simple example with 3 functions + +function bar +storage + var word +types + MONDAY constant + TUESDAY constant + WEDNESDAY constant + THURSDAY constant + FRIDAY constant + SATURDAY constant + SUNDAY constant + + mystruct struct + var long + var2 long + end + + mystruct2 struct + var word + end +linkage + retcode uword +procedure returning retcode + set retcode to SATURDAY + display "bar has now changed the retcode to " SATURDAY + +function foo +storage +linkage + param uword + param2 uword + retcode uword +procedure with param param2 returning retcode + set retcode to 12 + display "hi from foo! param is " param + ", param2 is " param2 + ", assigning retcode to " retcode + set param to 90 + set param2 to 60 + display "now, param is " param ", param2 is " param2 + call bar returning retcode + display "bar returned " retcode + +function main public +globals +storage + myparam uword + myparam2 uword + myret uword +procedure + set myret to size of word + display "myret is " myret + set myret to 100 + set myparam to 300 + set myparam2 to 400 + display "calling foo, myparam is " myparam + ", myparam2 is " myparam2 + ", myret is " myret + call foo with myparam myparam2 + display "foo in turn returned " myret -- cgit v1.2.3