Re: [fpc-pascal] Baby steps

2008-05-07 Thread Tiziano De Togni

Kristofer Skaug ha scritto:

Hi all,


3) Is there an FPC equivalent of DUnit? I have more than 150KLines' worth of
unit tests that would be a great help in the migration exercise, if I could
find a way to re-use them...


yes, fpcunit is the answer:
http://www.freepascal.org/docs-html/fpcunit.pdf


--
tiziano
__
http://digilander.libero.it/tizzziano/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Pascal postscript reading library

2008-04-24 Thread Tiziano De Togni

Graeme Geldenhuys ha scritto:

Funky Beast wrote:

Most if not all CAD or vectorial software out there supports
import/export from/to DXF format. If you support importing this format,
you would already support a plethora of designing software out there.
Your customers will have more choices for their favourite designing tool.


I agree with that. DXF is the de-facto standard file format that 99% of 
the CAD and Engineering software support. I have a friend that runs his 
own engineering firm. I asked him about this and he said, over the years 
they switched designing software and all of them supported DXF files.



This is true if you deal with metal sheet and mechanical applications.

But when you deal with cutting/engraving applicazions, PostScript is 
preferred because of his (vector) font handling ability.


I suppose that this is the reason why Felipe wishes to start with 
PostScript (or EPS).


--
tiziano
__
http://digilander.libero.it/tizzziano/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Empty record inside another record ?

2008-02-19 Thread Tiziano De Togni

Vincent Snijders ha scritto:

Tiziano De Togni schreef:

Florian Klaempfl ha scritto:

Skybuck Flying schrieb:

One drawback of objects already discovered:


am I correct?



This is not allowed in {$mode objfpc}, because of the reasons Florian 
memtioned. It is allowed in {$mode delphi}.


Vincent


errr... I tryied various combinations of options before posting, but did 
not try {$mode Delphi}... :-(


going back to read the manuals...

to Bee: Not so sure now, compilation depends on a lot of details...

--
tiziano
__
http://digilander.libero.it/tizzziano/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Empty record inside another record ?

2008-02-18 Thread Tiziano De Togni

Florian Klaempfl ha scritto:

Skybuck Flying schrieb:

One drawback of objects already discovered:

Objects cannot have the same field identifiers.


Indeed, especially if you want to win an obfuscation contest.


ok, this is true for object type, but it should not be extended to class
types. Look at this example taken from Delphi Help:

type
  TAncestor = class
Value: Integer;
  end;

  TDescendant = class(TAncestor)
Value: string;  // hides the inherited Value field
  end;

var
  MyObject: TAncestor;

begin
  MyObject := TDescendant.Create;
  // MyObject.Value := 'Hello!';  // error
  TDescendant(MyObject).Value := 'Hello!';  // works!
end;

it compiles correctly in Delphi (5 and 7) but FPC (v2.2.0 - compiled 
with Params Values=" -S2cdgi -OG1 -gl -WG -vewnhi") still says

that there is a duplicate identifier "Value"...

am I correct?

--
tiziano
__
http://digilander.libero.it/tizzziano/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Turbo Pascal and Object Pascal ways of OOP

2008-02-05 Thread Tiziano De Togni

Michael Van Canneyt ha scritto:


On Tue, 5 Feb 2008, Tiziano De Togni wrote:


From the Delphi (7) help and in the borland newgroups I read that the old TP
style object type is considered to disappear, and actually only kept for code
compatibility.

I see here that some developers still use the type object because of some
advantages against the Class type (static allocation).

Can someone explain better these advantages?


The advantage is mainly that you can have objects on the stack.


sorry, but don't understand exactly what this means exactly.

I understand that if I write a procedure of this kind:

procedure processmyobject(myobject: tmyobject);

procedure processmyobject(myclass: tmyclass);

I have myobject on the stack, instead myclass is passed by reference, 
but don't see the advantage...


--
tiziano
__
http://digilander.libero.it/tizzziano/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Turbo Pascal and Object Pascal ways of OOP

2008-02-05 Thread Tiziano De Togni


From the Delphi (7) help and in the borland newgroups I read that the 
old TP style object type is considered to disappear, and actually only 
kept for code compatibility.


I see here that some developers still use the type object because of 
some advantages against the Class type (static allocation).


Can someone explain better these advantages?

My other question is:
Will Free Pascal still support the type object in the future or it is 
considered to disappear in the same way as it is expected in Delphi?


tia
--
tiziano
__
http://digilander.libero.it/tizzziano/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: [ann] AggPas 2.4 RM3 update

2008-01-23 Thread Tiziano De Togni

Milan Marusinec ha scritto:


For those PASCAL users, who doesn't have a clue about
which C/C++ programmers I am talking about in the rest
of my announcement, I must admit that I have made a mistake
in the content of the message (which was originally addressed
to other discussion group).

Again, sorry. It's 2.00 am here and I am getting a little tired :-ooo

But, in the rest, the announcement is valid.

Look, Try and Enjoy.


I'll surely look at it, just two small questions before dowloading it:

"Agg2D API and also TAgg2D for Delphi VCL": can I use TAgg2D with 
Lazarus LCL? Can I use the API also with FPC-RTL/FCL applications?


It seems to me that (a) in Agg there is a SDL platform support and (b) 
it in not in AggPas, am I correct?

(I ask here only because actually I'm working with FPC and SDL)


thanks for your very (huge) and interesting work :-)
--
tiziano
__
http://digilander.libero.it/tizzziano/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FreePascal Coding style

2008-01-21 Thread Tiziano De Togni

Damien Gerard ha scritto:


Is there a standard Coding style for FreePascal (Pascal) available which 
programmers should use ?

It is for my boss :)



these are the FPC documents:
http://wiki.freepascal.org/Coding_style
http://wiki.freepascal.org/DesignGuidelines

but since FreePascal is Object Pascal, the Delphi guidelines should be 
equivalent:


There are a couple of docs in the codegear repository, this is one:
http://dn.codegear.com/it/article/10280

Anyway, this nice document is still online:
Delphi 4 Developer's Guide Coding Standards Document
http://www.econos.de/delphi/cs.html

try a google search like this: pascal delphi "guidelines", and you will 
surely find something interesting...


tiziano
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Notice: Possible copyright infringements in FPC code base

2008-01-16 Thread Tiziano De Togni

John Stoneham ha scritto:


apparent that he came to his conclusions as to the copyright issue at
the beginning of last year while still at CodeGear. I think it's
interesting that he never raised those issues then. It is also clear
that he has no clue about copyright law. It seems he believes that if
a unit does the same thing in the same way as another copyrighted
unit, there is a copyright violation somewhere involved. You can't
copyright an algorithm (and there's still an ongoing debate about
whether it's actually proper to patent one, although the USPTO does it
all the time now). But it doesn't help when someone is blowing smoke
into an already cloudy issue.


I am pleased to read your competent opinion about this matter that I
consider very interesting and relevant (both the opinion and the matter).

Could you please tell me if there is a real chance that CodeGear asks 
money for a concrete copyright violation to someone of the FPC or 
Lazarus developers?


And in this case, how this claim could be performed?

thanks
tiziano
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] What about signals.pp on win32?

2008-01-14 Thread Tiziano De Togni

Michael Van Canneyt ha scritto:


On Mon, 14 Jan 2008, Tiziano De Togni wrote:


I was trying to convert a C source to Pascal. It uses signals, and I thought
that these things were not available on Win platforms.

Documentation talks about signals in oldlinux and baseunix units only (Linux).

Then I went on the signals.pp unit in:

C:\fpc\...\source\rtl\win32\signals.pp


I understand the function signal, but I don't see a way to "Raise" a signal.


There isn't a proper way; 
Signals on windows have totally different semantics than on Linux/unix.

You should not try to imitate them.


I agree, so I removed all signal related code from the C source and in 
win32 I used other things.


But then, what is signals.pp meant for?

tiziano
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] What about signals.pp on win32?

2008-01-14 Thread Tiziano De Togni


I was trying to convert a C source to Pascal. It uses signals, and I 
thought that these things were not available on Win platforms.


Documentation talks about signals in oldlinux and baseunix units only 
(Linux).


Then I went on the signals.pp unit in:

C:\fpc\...\source\rtl\win32\signals.pp


I understand the function signal, but I don't see a way to "Raise" a 
signal.


(a second question is that I can't understand how to raise a signal 
under Linux without using the oldlinux unit)



Could someone enlight me?

tiziano
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] OT: fpc SDL HowTo (Was: Maybe a new fpc book :)

2008-01-09 Thread Tiziano De Togni

Marco Ciampa ha scritto:

On Tue, Jan 08, 2008 at 08:54:58AM +0100, Tiziano De Togni wrote:

Marco Ciampa ha scritto:

Can someone please point me a simple BGI to SDL howto or some very simple
Fpc SDL tutorials? 



These news are very sad. Why? Because we in Italy (but I think, in other 
countries too) have plenty of math and phisics high school books (and 
some written very well indeed) that reports Turbo Pascal/BGI examples thanks

to the easy way this lib permits to create simple graphs and/or drawings on the
screen. The fact that the sdl library is not included by default in the

...


Theese are the thoughts (perhaps OT sorry but I hope you appreciate the
feedback) of a high school technician.


your feedback tells me that I am working in the right direction.

There could be another way to explore, all this could be made using the 
AggPas Library instead of SDL: no .DLLs, .sos or .dev packages to 
install, only pascal units... but let's talk about that another day :-)


you can find the zip file here:

http://digilander.libero.it/tizzziano/pagine/brevinotizie.html
or, directly, with this direct link:
http://digilander.libero.it/tizzziano/files/sdlgraphex_080108.zip

The main program is sdlgraphex.lpr (Lazarus project) if you don't use 
the IDE you can compile it with FPC using the comman line in 
compile.bat. This requires only the SDL.dll (or SDL.so) installed in 
your system.


that's all, by now.

bye
tiziano
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] OT: fpc SDL HowTo (Was: Maybe a new fpc book :)

2008-01-07 Thread Tiziano De Togni

Marco Ciampa ha scritto:

On Sat, Jan 05, 2008 at 11:11:02AM +0100, Florian Klaempfl wrote:

Marco Ciampa schrieb:

I work in a high school in Italy.

console & 
graph unit (BGI drivers under windows and Linux (X _not_ VGAlib) )

If one writes a book, _please_ use SDL for graphics and skip the legacy
graph unit :)

Can someone please point me a simple BGI to SDL howto or some very simple
Fpc SDL tutorials? 


Hi, Marco,

I think that there is not (yet) a good answer to your question.

You can start from here: http://wiki.freepascal.org/FPC_and_SDL

Then you can find documentation about SDL and Free Pascal if you get and
install the latest JEDI-SDL v1.0:  http://sf.net/projects/jedi-sdl/
(\documentation\html\Using SDL under Free Pascal.htm).

For the graph side of your question, there is a project by Evgeniy
Ivanov to port the graph unit on SDL:
http://sourceforge.net/projects/sdlgraph
but it's still in a pre-alfa state.

I am actually working on another perspective.
SDL doesn't have functions to draw pixels, lines, rectangles, arcs,
ovals and text on the screen, and the FPC graph sources are the better
documentation I found about (there is also SGE, a nice SDL Graphics
Extension library in C but there are not headers translated for
pascal).

So I made first a little project including the basic Jedi-sdl units
(sdl.pas and sdl.inc) in order to work with the Lazarus IDE, then I made
a unit with equivalent graph procedures to draw on a SDL surface
(SDL_GetPixel, SDL_DirectputPixel, SDL_Line, SDL_Rectangle,
SDL_DrawPoly, SDL_FillPoly, SDL_Ellipse, SDL_OutTextXY, etc.).

This demo/test application (some sort of the classic bgidemo app)
compiles and works on Windows and Linux (Ubuntu), if you are interested
about this work I'll soon make it available on my home page. Keep in
mind that it's still work in progress...

It's not (yet) a tutorial, but, as Florian suggested, a practical
example about using SDL for graphics with Free Pascal.

tiziano







___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal