Program prog1
use unit1
myObj=class
private
public
.....
end;
---------------------------
unit unit1
..............
like above, can i access myObj in unit1?

Mailing lists / fpc-pascal / 2009-09
7 messages · 5 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Program prog1
use unit1
myObj=class
private
public
.....
end;
---------------------------
unit unit1
..............
like above, can i access myObj in unit1?
No.
A unit only has access to symbols that appear in units in it's uses clause. The program can never appear in the uses clause of a unit, because a unit can exist without a program.
Michael.
Program prog1 use unit1 myObj=class private public ..... end; ---------------------------…
Much better to have something like this:
Program prog1;
uses CommonStuff, unit1;
..........
---------------------------
unit CommonStuff;
myObj=class
privatepublic
.....
end;
..............
---------------------------
unit unit1
uses CommonStuff;
.......
Jeff.
Thanks.
another question,any one has successful compile indy on FPC? I tried,but did not success.
scritti il 25/09/2009 05.34.53
Thanks. another question,any one has successful compile indy on FPC? I tried,but did not success.
Indy 10? It's FPC compatible.
Indy 9 not.
I just now download indy-10.2.0.3.tar.gz - for Unix/Linux system users. and build success on windows.
the file indy-10.2.0.3.zip - for Windows users. damaged ,can not be decompressed.
when I try to build indy10 files from http://indy.fulgan.com/ZIP/ I get a lot of mistaks:
---------- make ----------
E:/tools/programming/fpc/bin/i386-Win32/ppc386.exe -gl - -Fu../System/lib/i386-win32 -Fu../System -Fi../Inc -FE. -FUlib/i386-win32 -di386 indycorefpc.pas
Free Pascal Compiler version 2.2.4 [2009/04/10] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling indycorefpc.pas
Compiling IdIcmpClient.pas
Compiling IdRawHeaders.pas
IdRawHeaders.pas(59,14) Error: There is no method in an ancestor class to be overridden: "TIdSunB.GetBytesLen:DWord;"
IdRawHeaders.pas(61,15) Error: There is no method in an ancestor class to be overridden: "TIdSunB.ReadStruct(const TIdBytes,var LongWord);" ......
2009/9/25 :
Maybe you'll have an easier time with either Synapse or Lnet. I don't know if either of them have the functionality you need, but I had a pretty easy time getting them both working on linux.
http://lnet.wordpress.com/
http://sourceforge.net/projects/synalist/
yu ping wroteI just now download indy-10.2.0.3.tar.gz - for Unix/Linux system
users.