From a1fede8c2a1791b1240b3c1ed7a9161b358fdd78 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 5 Jun 1999 10:49:59 +0000 Subject: [PATCH] + Added last examples --- docs/sysutex/Makefile | 5 ++--- docs/sysutex/README | 13 +++++++++++++ docs/sysutex/ex75.pp | 23 +++++++++++++++++++++++ docs/sysutex/ex76.pp | 12 ++++++++++++ docs/sysutex/ex77.pp | 9 +++++++++ docs/sysutex/ex78.pp | 14 ++++++++++++++ docs/sysutex/ex79.pp | 12 ++++++++++++ docs/sysutex/ex80.pp | 12 ++++++++++++ docs/sysutex/ex81.pp | 12 ++++++++++++ docs/sysutex/ex82.pp | 17 +++++++++++++++++ docs/sysutex/ex83.pp | 17 +++++++++++++++++ docs/sysutex/ex84.pp | 18 ++++++++++++++++++ docs/sysutex/ex85.pp | 18 ++++++++++++++++++ docs/sysutex/ex86.pp | 18 ++++++++++++++++++ docs/sysutex/ex87.pp | 9 +++++++++ 15 files changed, 206 insertions(+), 3 deletions(-) create mode 100644 docs/sysutex/ex75.pp create mode 100644 docs/sysutex/ex76.pp create mode 100644 docs/sysutex/ex77.pp create mode 100644 docs/sysutex/ex78.pp create mode 100644 docs/sysutex/ex79.pp create mode 100644 docs/sysutex/ex80.pp create mode 100644 docs/sysutex/ex81.pp create mode 100644 docs/sysutex/ex82.pp create mode 100644 docs/sysutex/ex83.pp create mode 100644 docs/sysutex/ex84.pp create mode 100644 docs/sysutex/ex85.pp create mode 100644 docs/sysutex/ex86.pp create mode 100644 docs/sysutex/ex87.pp diff --git a/docs/sysutex/Makefile b/docs/sysutex/Makefile index 76093e7cd5..bb64adb4a1 100644 --- a/docs/sysutex/Makefile +++ b/docs/sysutex/Makefile @@ -38,9 +38,8 @@ OBJECTS=ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex11 ex12\ ex37 ex38 ex39 ex40 ex41 ex42 ex43 ex44 ex45 ex46 ex47\ ex48 ex49 ex50 ex51 ex52 ex53 ex54 ex55 ex56 ex57 ex58\ ex59 ex60 ex61 ex62 ex63 ex64 ex65 ex66 ex67 ex68 ex69 ex70\ - ex71 ex72 ex73 ex74 -#ex75 ex76 ex77 ex78 ex79 ex80 -# ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 + ex71 ex72 ex73 ex74 ex75 ex76 ex77 ex78 ex79 ex80 \ + ex81 ex82 ex83 ex84 ex85 ex86 ex87 TEXOBJECTS=$(addsuffix .tex, $(OBJECTS)) diff --git a/docs/sysutex/README b/docs/sysutex/README index 39cd62738c..9b17d7c9a0 100644 --- a/docs/sysutex/README +++ b/docs/sysutex/README @@ -74,3 +74,16 @@ ex71.pp contains an example of the Format function. ex71.pp contains an example of the FormatBuf function. ex73.pp contains an example of the IntToHex function. ex74.pp contains an example of the IntToStr function. +ex75.pp contains an example of the IsValidIdent function. +ex76.pp contains an example of the LeftStr function. +ex77.pp contains an example of the LowerCase function. +ex78.pp contains an example of the QuotedStr function. +ex79.pp contains an example of the RightStr function. +ex80.pp contains an example of the StrFmt function. +ex81.pp contains an example of the StrLFmt function. +ex82.pp contains an example of the StrToInt function. +ex83.pp contains an example of the StrToIntDef function. +ex84.pp contains an example of the Trim function. +ex85.pp contains an example of the TrimLeft function. +ex86.pp contains an example of the TrimRight function. +ex87.pp contains an example of the UpperCase function. diff --git a/docs/sysutex/ex75.pp b/docs/sysutex/ex75.pp new file mode 100644 index 0000000000..50adfa073c --- /dev/null +++ b/docs/sysutex/ex75.pp @@ -0,0 +1,23 @@ +Program Example75; + +{ This program demonstrates the IsValidIdent function } + +Uses sysutils; + +Procedure Testit (S : String); + +begin + Write ('"',S,'" is '); + If not IsVAlidIdent(S) then + Write('NOT '); + Writeln ('a valid identifier'); +end; + +Begin + Testit ('_MyObj'); + Testit ('My__Obj1'); + Testit ('My_1_Obj'); + Testit ('1MyObject'); + Testit ('My@Object'); + Testit ('M123'); +End. \ No newline at end of file diff --git a/docs/sysutex/ex76.pp b/docs/sysutex/ex76.pp new file mode 100644 index 0000000000..80c5efdb89 --- /dev/null +++ b/docs/sysutex/ex76.pp @@ -0,0 +1,12 @@ +Program Example76; + +{ This program demonstrates the LeftStr function } + +Uses sysutils; + +Begin + Writeln (LeftStr('abcdefghijklmnopqrstuvwxyz',20)); + Writeln (LeftStr('abcdefghijklmnopqrstuvwxyz',15)); + Writeln (LeftStr('abcdefghijklmnopqrstuvwxyz',1)); + Writeln (LeftStr('abcdefghijklmnopqrstuvwxyz',200)); +End. \ No newline at end of file diff --git a/docs/sysutex/ex77.pp b/docs/sysutex/ex77.pp new file mode 100644 index 0000000000..4f423fd9d4 --- /dev/null +++ b/docs/sysutex/ex77.pp @@ -0,0 +1,9 @@ +Program Example77; + +{ This program demonstrates the LowerCase function } + +Uses sysutils; + +Begin + Writeln (LowerCase('THIS WILL COME out all LoWeRcAsE !')); +End. \ No newline at end of file diff --git a/docs/sysutex/ex78.pp b/docs/sysutex/ex78.pp new file mode 100644 index 0000000000..5815f31c37 --- /dev/null +++ b/docs/sysutex/ex78.pp @@ -0,0 +1,14 @@ +Program Example78; + +{ This program demonstrates the QuotedStr function } + +Uses sysutils; + +Var S : AnsiString; + +Begin + S:='He said ''Hello'' and walked on'; + Writeln (S); + Writeln (' becomes'); + Writeln (QuotedStr(S)); +End. \ No newline at end of file diff --git a/docs/sysutex/ex79.pp b/docs/sysutex/ex79.pp new file mode 100644 index 0000000000..462431d022 --- /dev/null +++ b/docs/sysutex/ex79.pp @@ -0,0 +1,12 @@ +Program Example79; + +{ This program demonstrates the RightStr function } + +Uses sysutils; + +Begin + Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',20)); + Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',15)); + Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',1)); + Writeln (RightStr('abcdefghijklmnopqrstuvwxyz',200)); +End. \ No newline at end of file diff --git a/docs/sysutex/ex80.pp b/docs/sysutex/ex80.pp new file mode 100644 index 0000000000..13e552a263 --- /dev/null +++ b/docs/sysutex/ex80.pp @@ -0,0 +1,12 @@ +Program Example80; + +{ This program demonstrates the StrFmt function } + +Uses sysutils; + +Var S : AnsiString; + +Begin + SetLEngth(S,80); + Writeln (StrFmt (@S[1],'For some nice examples of fomatting see %s.',['Format'])); +End. \ No newline at end of file diff --git a/docs/sysutex/ex81.pp b/docs/sysutex/ex81.pp new file mode 100644 index 0000000000..bea3695351 --- /dev/null +++ b/docs/sysutex/ex81.pp @@ -0,0 +1,12 @@ +Program Example80; + +{ This program demonstrates the StrFmt function } + +Uses sysutils; + +Var S : AnsiString; + +Begin + SetLEngth(S,80); + Writeln (StrLFmt (@S[1],80,'For some nice examples of fomatting see %s.',['Format'])); +End. \ No newline at end of file diff --git a/docs/sysutex/ex82.pp b/docs/sysutex/ex82.pp new file mode 100644 index 0000000000..2e6fbda91e --- /dev/null +++ b/docs/sysutex/ex82.pp @@ -0,0 +1,17 @@ +Program Example82; + +{ This program demonstrates the StrToInt function } + +Uses sysutils; + +Begin + Writeln (StrToInt('1234')); + Writeln (StrToInt('-1234')); + Writeln (StrToInt('0')); + Try + Writeln (StrToInt('12345678901234567890')); + except + On E : EConvertError do + Writeln ('Invalid number encountered'); + end; +End. \ No newline at end of file diff --git a/docs/sysutex/ex83.pp b/docs/sysutex/ex83.pp new file mode 100644 index 0000000000..5be13dff14 --- /dev/null +++ b/docs/sysutex/ex83.pp @@ -0,0 +1,17 @@ +Program Example82; + +{ This program demonstrates the StrToInt function } + +Uses sysutils; + +Begin + Writeln (StrToIntDef('1234',0)); + Writeln (StrToIntDef('-1234',0)); + Writeln (StrToIntDef('0',0)); + Try + Writeln (StrToIntDef('12345678901234567890',0)); + except + On E : EConvertError do + Writeln ('Invalid number encountered'); + end; +End. \ No newline at end of file diff --git a/docs/sysutex/ex84.pp b/docs/sysutex/ex84.pp new file mode 100644 index 0000000000..66869cb1ac --- /dev/null +++ b/docs/sysutex/ex84.pp @@ -0,0 +1,18 @@ +Program Example84; + +{ This program demonstrates the Trim function } + +Uses sysutils; +{$H+} + +Procedure Testit (S : String); + +begin + Writeln ('"',Trim(S),'"'); +end; + +Begin + Testit (' ha ha what gets lost ? '); + Testit (#10#13'haha '); + Testit (' '); +End. \ No newline at end of file diff --git a/docs/sysutex/ex85.pp b/docs/sysutex/ex85.pp new file mode 100644 index 0000000000..450de47f94 --- /dev/null +++ b/docs/sysutex/ex85.pp @@ -0,0 +1,18 @@ +Program Example85; + +{ This program demonstrates the TrimLeft function } + +Uses sysutils; +{$H+} + +Procedure Testit (S : String); + +begin + Writeln ('"',TrimLeft(S),'"'); +end; + +Begin + Testit (' ha ha what gets lost ? '); + Testit (#10#13'haha '); + Testit (' '); +End. \ No newline at end of file diff --git a/docs/sysutex/ex86.pp b/docs/sysutex/ex86.pp new file mode 100644 index 0000000000..6ca539821b --- /dev/null +++ b/docs/sysutex/ex86.pp @@ -0,0 +1,18 @@ +Program Example86; + +{ This program demonstrates the TrimRight function } + +Uses sysutils; +{$H+} + +Procedure Testit (S : String); + +begin + Writeln ('"',TrimRight(S),'"'); +end; + +Begin + Testit (' ha ha what gets lost ? '); + Testit (#10#13'haha '); + Testit (' '); +End. \ No newline at end of file diff --git a/docs/sysutex/ex87.pp b/docs/sysutex/ex87.pp new file mode 100644 index 0000000000..b8201eb145 --- /dev/null +++ b/docs/sysutex/ex87.pp @@ -0,0 +1,9 @@ +Program Example87; + +{ This program demonstrates the UpperCase function } + +Uses sysutils; + +Begin + Writeln (UpperCase('this will come OUT ALL uPpErCaSe !')); +End. \ No newline at end of file