From f609c55b5983c5ef6309bd84576d5105048408ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Thu, 4 Jan 2018 09:04:31 +0000 Subject: [PATCH] palmunits: added a simple 'Hello, World' for PalmOS git-svn-id: trunk@37903 - --- .gitattributes | 1 + packages/palmunits/examples/hello.pas | 24 ++++++++++++++++++++++++ packages/palmunits/fpmake.pp | 3 +++ 3 files changed, 28 insertions(+) create mode 100644 packages/palmunits/examples/hello.pas diff --git a/.gitattributes b/.gitattributes index 2eaf3d4daa..a34cb94322 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6668,6 +6668,7 @@ packages/os4units/src/workbench.pas svneol=native#text/pascal packages/palmunits/Makefile svneol=native#text/plain packages/palmunits/Makefile.fpc svneol=native#text/plain packages/palmunits/Makefile.fpc.fpcmake svneol=native#text/plain +packages/palmunits/examples/hello.pas svneol=native#text/plain packages/palmunits/fpmake.pp svneol=native#text/plain packages/palmunits/src/aboutbox.pp svneol=native#text/plain packages/palmunits/src/alarmmgr.pp svneol=native#text/plain diff --git a/packages/palmunits/examples/hello.pas b/packages/palmunits/examples/hello.pas new file mode 100644 index 0000000000..4b40640f04 --- /dev/null +++ b/packages/palmunits/examples/hello.pas @@ -0,0 +1,24 @@ +{$APPID FPHL} +{$APPNAME Hello, FPC} +program hello; + +uses + event_, sysevent, systemmgr, window; + +const + message = 'FPC says: Hello, Palm!'; + +procedure EventLoop; +var + event: EventType; +begin + repeat + EvtGetEvent(event, evtWaitForever); + SysHandleEvent(event); + until (event.eType = appStopEvent); +end; + +begin + WinDrawChars(message, length(message), 35, 74); + EventLoop; +end. diff --git a/packages/palmunits/fpmake.pp b/packages/palmunits/fpmake.pp index a5a096793f..ad0b093f18 100644 --- a/packages/palmunits/fpmake.pp +++ b/packages/palmunits/fpmake.pp @@ -123,6 +123,9 @@ begin P.Targets.AddUnit('pdilib.pp',[PalmOS]); P.Targets.AddUnit('helperserviceclass.pp',[PalmOS]); + P.ExamplePath.Add('examples'); + P.Targets.AddExampleProgram('hello.pas'); + {$ifndef ALLPACKAGES} Run; end;