瀏覽代碼

Added library example

michael 26 年之前
父節點
當前提交
150ba339ac
共有 2 個文件被更改,包括 25 次插入0 次删除
  1. 1 0
      docs/refex/README
  2. 24 0
      docs/refex/ex84.pp

+ 1 - 0
docs/refex/README

@@ -86,3 +86,4 @@ ex80.pp contains an example of the High/Low functions.
 ex81.pp contains an example of the HexStr function.
 ex81.pp contains an example of the HexStr function.
 ex82.pp contains an example of the BinStr function.
 ex82.pp contains an example of the BinStr function.
 ex83.pp contains an example of the Assigned function.
 ex83.pp contains an example of the Assigned function.
+ex84.pp contains an example of the Library keyword.

+ 24 - 0
docs/refex/ex84.pp

@@ -0,0 +1,24 @@
+Library Greeting;
+
+{$Mode objpas}
+
+Procedure Hello;
+
+begin
+  Writeln ('Hello, World !');
+end;
+
+Function GetNumber (Max : longint) : Longint;
+
+begin
+  Repeat
+    Write ('Please enter a nuber between 0 and ',max,' : ');
+    ReadLn (Result);
+  Until (Result>=0) and (Result<=Max);
+end; 
+
+exports
+  Hello,
+  GetNumber;
+  
+end.