+ Added 69,70

This commit is contained in:
michael 2000-05-26 19:57:07 +00:00
parent 13d617c4e9
commit 92622a3ab2
4 changed files with 54 additions and 3 deletions

View File

@ -37,8 +37,8 @@ OBJECTS=ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex11 ex12 ex13 ex14 \
ex28 ex29 ex30 ex31 ex32 ex33 ex34 ex35 ex36 ex37 ex38 ex39 ex40 \
ex41 ex42 ex43 ex44 ex45 ex46 ex47 ex48 ex49 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
ex67 ex68 ex69 ex70
# ex71 ex72 ex73 ex74 ex75 ex76 ex77
TEXOBJECTS=$(addsuffix .tex, $(OBJECTS))

View File

@ -68,5 +68,7 @@ ex64.pp contains an example of the SysInfo function.
ex64.pp contains an example of the SigRaise function.
ex66.pp contains an example of the MMap function.
ex67.pp contains an example of the FSplit function.
serial.pp contains an example of serial port programming in FPC.
ex68.pp contains an example of the Octal function.
ex69.pp contains an example of the FNMatch function.
ex70.pp contains an example of the StringToPPchar function.
serial.pp contains an example of serial port programming in FPC.

27
docs/linuxex/ex69.pp Normal file
View File

@ -0,0 +1,27 @@
Program Example69;
{ Program to demonstrate the FNMatch function. }
Uses linux;
Procedure TestMatch(Pattern,Name : String);
begin
Write ('"',Name,'" ');
If FNMatch (Pattern,Name) then
Write ('matches')
else
Write ('does not match');
Writeln(' "',Pattern,'".');
end;
begin
TestMatch('*','FileName');
TestMatch('.*','FileName');
TestMatch('*a*','FileName');
TestMatch('?ile*','FileName');
TestMatch('?','FileName');
TestMatch('.?','FileName');
TestMatch('?a*','FileName');
TestMatch('??*me?','FileName');
end.

22
docs/linuxex/ex70.pp Normal file
View File

@ -0,0 +1,22 @@
Program Example70;
{ Program to demonstrate the StringToPPchar function. }
Uses linux;
Var S : String;
P : PPChar;
I : longint;
begin
// remark whitespace at end.
S:='This is a string with words. ';
P:=StringToPPChar(S);
I:=0;
While P[i]<>Nil do
begin
Writeln('Word ',i,' : ',P[i]);
Inc(I);
end;
FreeMem(P,i*SizeOf(Pchar));
end.