Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use #include

0 views
Skip to first unread message

Ramrao Salkar

unread,
Jun 12, 1999, 3:00:00 AM6/12/99
to
I wanted to know how to use #INCLUDE statement...
I tried it but it gave me an error saying 'Error in Integer
Constant'......which i really could not figure out.??
Also let me know, whether '#INCLUDE' and 'USES' are same??

thanx.....

Martin Beck

unread,
Jun 12, 1999, 3:00:00 AM6/12/99
to
I don't know such a statement in TP/BP and I don't think it
exists.
But as #INCLUDE comes from C I think you mean the {$I xxxx} compiler
directive. If you use this, the compiler will first read the file
xxxx as it was in file, which will be compiled, before going on.
So USES and {$I xxx} are not the same, as USES needs an unit, but
with {$I xxx} you can include any file. Of course, there can be
compile errors in that include file.
Example (not tested):
{test.inc}
type
THello = string[6];

{test.pas}
program Test;
{$I test.inc} {here test.inc will be included, but not saved
{later...}
var Hello : THello;
begin
Hello:='Hello';
WriteLn(Hello);
end.

hth, Martin

Robert AH Prins

unread,
Jun 12, 1999, 3:00:00 AM6/12/99
to
In article <7ju9a3$oge$1...@news.vsnl.net.in>,

"Ramrao Salkar" <ram...@vsnl.com> wrote:
> I wanted to know how to use #INCLUDE statement...
> I tried it but it gave me an error saying 'Error in Integer
> Constant'......which i really could not figure out.??
> Also let me know, whether '#INCLUDE' and 'USES' are same??

From the three posting you have made to this newsgroup is is patently
obvious that you either

a) haven't bothered to read the excellent manuals that come with the
Borland Pascal products, or
b) have not attended your classes, or
c) are using a pirated version without manuals.

Robert
--
Robert AH Prins
pri...@williscorroon.com


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

0 new messages