Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-12

Standalone fpc tply

5 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Agustin Barto

I tried to compile tply with fpc-1.9.5, and I got an error about memAvail not being avaible. A quick googling and I found out about GetHeapStatus. A little more googling and I discovered that the fpc-1.9.5 version of tply doesn't have the problem (thanks for that btw).

It'll be cool if this version of tply were available stand-alone.

Ron Weidner
to Agustin Barto
I'm looking for a little syntax help please.  How do
you use units in a unit?  The following doesn't work.
unit unit_test;
uses crt;
interface
    function make_line(): String;
implementation
    function make_line(): String;
    begin
         make_line := 'This is a string returned';
    end;
end.

What I'm trying to accomplish in my program is I want to create a file called defs.pas. this would contain all the constants for all the units that make up the prgram. For example, there might be a constant
SCREEN_WIDTH or SCREEN_HEIGHT. Now I want to be
able to use those varibles in the units, Collide.pas and Draw.pas. How is this done in Pascal.

Ron_W

__________________________________
Do you Yahoo!?
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com

Vincent Snijders
to Ron Weidner
Ron Weidner wrote 15 lines
I'm looking for a little syntax help please. How do you use units in a unit? The following doesn't work. unit unit_test; interface uses crt; function make_line(): String; implementation function make_line(): String; begin make_line := 'This is a string returned'; end; end.

Like this.

David Emerson

You need to put your "uses" list inside either the interface or the implementation of the unit. You can even put different lists in the interface and implementation sections (though you can't list the same unit in BOTH lists). Usually the implementation section will have a longer uses list; the interface only needs a uses list for types, including object types, etc., which appear in the interface.

I'm not sure about it, but it may even be possible to put a uses list inside initialization and/or finalization sections.

~David.

Earlier message 44 lines
-------- Original Message -------- > From: Ron Weidner > Sent: Tuesday, December 07, 2004 2:30 PM > To: Agustin Barto , FPC-Pascal users discussions > Subject: [fpc-pascal] using units in units... > > I'm looking for a little syntax help please. How do > you use units in a unit? The following doesn't work. > > unit unit_test; > uses crt; > interface > function make_line(): String; > > implementation > function make_line(): String; > begin > make_line := 'This is a string returned'; > end; > end. > > What I'm trying to accomplish in my program is I want > to create a file called defs.pas. this would contain > all the constants for all the units that make up the > prgram. For example, there might be a constant > SCREEN_WIDTH or SCREEN_HEIGHT. Now I want to be > able to use those varibles in the units, Collide.pas > and Draw.pas. How is this done in Pascal. > > Ron_W > > > > > > > __________________________________ > Do you Yahoo!? > The all-new My Yahoo! - What will yours do? > http://my.yahoo.com > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Olle Raab
to David Emerson

04-12-08 00.27, skrev David Emerson följande:

I'm not sure about it, but it may even be possible to put a uses list inside initialization and/or finalization sections.

No, but the initialization and finalization sections has access to the units already used.

Olle