Skip to content

Commit 45c9b97

Browse files
committed
Move include file to code-samples/myconfig.inc
1 parent 3f3280e commit 45c9b97

File tree

12 files changed

+70
-28
lines changed

12 files changed

+70
-28
lines changed

code-samples/myconfig.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{$ifdef FPC}
2+
{$mode objfpc}
3+
{$H+}
4+
{$J-}
5+
{$modeswitch advancedrecords}
6+
{$ifdef VER2}
7+
{$message fatal 'This code can only be compiled using FPC version >= 3.0.'}
8+
{$endif}
9+
{$endif}

code-samples/test_myconfig.dpr

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{$ifdef MSWINDOWS} {$apptype CONSOLE} {$endif}
2+
3+
{ Compile this to test that myconfig.inc is valid. }
4+
{$I myconfig.inc}
5+
6+
begin
7+
end.

code-samples_bg/myconfig.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{$ifdef FPC}
2+
{$mode objfpc}
3+
{$H+}
4+
{$J-}
5+
{$modeswitch advancedrecords}
6+
{$ifdef VER2}
7+
{$message fatal 'This code can only be compiled using FPC version >= 3.0.'}
8+
{$endif}
9+
{$endif}

code-samples_bg/test_myconfig.dpr

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{$ifdef MSWINDOWS} {$apptype CONSOLE} {$endif}
2+
3+
{ Compile this to test that myconfig.inc is valid. }
4+
{$I myconfig.inc}
5+
6+
begin
7+
end.

code-samples_russian/myconfig.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{$ifdef FPC}
2+
{$mode objfpc}
3+
{$H+}
4+
{$J-}
5+
{$modeswitch advancedrecords}
6+
{$ifdef VER2}
7+
{$message fatal 'This code can only be compiled using FPC version >= 3.0.'}
8+
{$endif}
9+
{$endif}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{$ifdef MSWINDOWS} {$apptype CONSOLE} {$endif}
2+
3+
{ Compile this to test that myconfig.inc is valid. }
4+
{$I myconfig.inc}
5+
6+
begin
7+
end.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{$ifdef FPC}
2+
{$mode objfpc}
3+
{$H+}
4+
{$J-}
5+
{$modeswitch advancedrecords}
6+
{$ifdef VER2}
7+
{$message fatal 'This code can only be compiled using FPC version >= 3.0.'}
8+
{$endif}
9+
{$endif}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{$ifdef MSWINDOWS} {$apptype CONSOLE} {$endif}
2+
3+
{ Compile this to test that myconfig.inc is valid. }
4+
{$I myconfig.inc}
5+
6+
begin
7+
end.

modern_pascal_introduction.adoc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,13 +2086,7 @@ Include files have commonly the `.inc` extension, and are used for two purposes:
20862086
+
20872087
[source,pascal]
20882088
----
2089-
{$mode objfpc}
2090-
{$H+}
2091-
{$J-}
2092-
{$modeswitch advancedrecords}
2093-
{$ifndef VER3}
2094-
{$error This code can only be compiled using FPC version at least 3.x.}
2095-
{$endif}
2089+
include::code-samples/myconfig.inc[]
20962090
----
20972091
+
20982092
Now you can include this file using `{$I myconfig.inc}` in all your sources.
@@ -2685,6 +2679,8 @@ include::code-samples/interface_casting.dpr[]
26852679

26862680
### CORBA and COM types of interfaces
26872681

2682+
NOTE: This section is only relevant for FPC. Delphi has only _COM_ interfaces.
2683+
26882684
Why are the interfaces (presented above) called "CORBA"?::
26892685

26902686
//The declaration `{$interface corba}` simply means that the declared interfaces *do not* automatically descend from the special `IUnknown` interface. Which in turn means that they *do not* by default have any extra baggage (like reference-counting found in the *COM* interfaces).

modern_pascal_introduction_bg.adoc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,13 +1971,7 @@ end.
19711971
+
19721972
[source,pascal]
19731973
----
1974-
{$mode objfpc}
1975-
{$H+}
1976-
{$J-}
1977-
{$modeswitch advancedrecords}
1978-
{$ifndef VER3}
1979-
{$error Този код може да се компилира само с FPC версия 3.x. или по-висока}
1980-
{$endif}
1974+
include::code-samples/myconfig.inc[]
19811975
----
19821976
+
19831977
Сега можете да включите този файл с помощта на `{$I myconfig.inc}` във всички ваши изходни файлове.

0 commit comments

Comments
 (0)