[fpc-pascal] How to use var or object in a programm file from a unit file

Jeff Wormsley daworm10 at comcast.net
Thu Sep 24 19:43:45 CEST 2009


yu ping wrote:
> Program prog1
> use unit1
> myObj=class
> private
>
> public
>   .....
> end;
> ---------------------------
> unit unit1
> ..............
>
> like above, can i access myObj in unit1?
>   
Much better to have something like this:

 Program prog1;
 uses CommonStuff, unit1;
..........
 ---------------------------
 unit CommonStuff;
 myObj=class
 private

 public
   .....
 end;
  ..............
 ---------------------------
unit unit1
uses CommonStuff;
.......

Jeff.
--
I haven't smoked for 3 years, 1 month and 1 week, saving $5,105.70 and 
not smoking 34,038.04 cigarettes.



More information about the fpc-pascal mailing list