[fpc-pascal] Re: Library for network calculation

2011-07-25 Thread Paul Nicholls
Jorge Aldo G. de F. Junior 
jagf...@gmail.com wrote in message 
news:CAAHHabS9aUe9gwyNjkve-XVXsRyf2UPsArh6=fsdpgokugj...@mail.gmail.com...
 Some time ago someone asked for a library able to do network calculations.

 Here is something that might evolve into such library :

SNIP
 Function NetMaskToHostMask(NetMask : TNetworkIP): TNetworkIP;
 Begin
 Result.Mode := False;
 NetMask.Mode := False;
 Result.IP := NetMask.IP Xor %;
 End;

SNIP

I didn't know that freepascal handled binary formatted numbers?!?

%

cheers,
Paul 



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


Re: [fpc-pascal] Prof. Wirth speaking on Oberon day

2011-06-30 Thread Paul Nicholls
- Original Message - 
From: greim gr...@schleibinger.com

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Thursday, June 30, 2011 8:35 PM
Subject: [fpc-pascal] Prof. Wirth speaking on Oberon day


Some asked my to place a link to the Oberon day videos recorded last month 
in Zürich.


For example Professor Wirth was there presenting its original 25 years old 
still running CERES-3 computer.


Also there have been very intersting discussions.


http://www.multimedia.ethz.ch/conferences/2011/oberon

Another private video is there:

http://www.google.de/url?sa=tsource=webcd=4ved=0CDUQtwIwAwurl=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHoZuzE7Lq5Eei=LVAMTvHlL8nMtAaK7JjWDgusg=AFQjCNH8IqQ6XmTRf1xgEDO0MhLb0zNzKQsig2=BTEC0ZPEueDm7FVacnw8Pg



Thanks for sharing Markus!

cheers,
Paul 


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


[fpc-pascal] Delphi 2010 code crashing in Lazarus (0.9.30, Win32)

2011-04-13 Thread Paul Nicholls
Hi all,
  I have a DLL that was compiled using Delphi 2010 (or Delphi XE, not sure 
which...), and this DLL uses PWideString in a bunch of it's interfaces.

I have some code that uses the DLL which runs fine using D2010, but crashes 
using Lazarus 0.9.30, Win32.  The debugger is being less than helpful in 
allowing me to track down the problem (big AAARRR!!!).

Does Lazarus/Freepascal have WideString/AnsiString support (mixing types 
too) out of the box like D2010, or do I have to do different things with 
Lazarus code when mixing WideString/AnsiString values and assignments?

cheers,
Paul
-- 
The plastic veneer of civilization is easily melted in the heat of the 
moment - Paul Nicholls 



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


Re: [fpc-pascal] Re: assign code to a method

2011-02-22 Thread Paul Nicholls
I second the motion of using a Dynamic array too instead of the manual 
creation/destruction of a memory block.


I use this for a virtual machine I created a few years back and it works 
under XP/Vista for me :)


cheers,
Paul

- Original Message - 
From: Jonas Maebe jonas.ma...@elis.ugent.be

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Wednesday, February 23, 2011 7:54 AM
Subject: Re: [fpc-pascal] Re: assign code to a method



On 22 Feb 2011, at 21:24, Angel Montesinos wrote:


one uncomments the commented line of code, that is  makes
  codeFunction:= '',
the program fails.


What may be happening here?


This code is wrong:

  functionCode : AnsiString; {the function opCode sequence}
...
  Move(functionCode, PChar(FBlock^.code), len);

An ansistring is a pointer. Move takes formal const/var parameters. So the 
move() moves the pointer along with whatever data comes after it over the 
FBlock^.code pointer and whatever data comes after that. What you want, is 
to move the data to which functionCode points into the memory block to which 
FBlock^.code points. The correct statement is therefore:


  Move(functionCode[1], FBlock^.code^, len);

It would also be cleaner to use a dynamic array instead of a string to store 
arbitrary binary data (in that case, you'd have to use functionCode[0] above 
though).



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


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


[fpc-pascal] Re: fpGUI powered by OpenGL

2010-12-22 Thread Paul Nicholls
Darius Blaszyk dhkblas...@zeelandnet.nl wrote 
in message news:1292870518.1851.35.ca...@darius-desktop...
 On Mon, 2010-12-20 at 18:58 +0100, Darius Blaszyk wrote:
  The above explains why it is useful for an application developer to
  use an openGL backend.
 
  It does not explain the following: Since fpGUI already has two
  backends (afaik, X and winap), why can't openGL a third one? Did you
  change the way fpGUI interfaces with its backend? Is this change so
  incompatible with the current backends, that they cannot be modified?

 The changes I think are pretty incompatible. This is because the GLut
 library also provides messaging, whereas in fpGUI the messages are
 implemented outside of the backend. Therefore hacks are needed to keep
 the drawing messages coming correctly. With a pascal context library
 everything could be merged seamless I suppose.

 I've been badly mistaking. With some minor adjustments it will be
 possible to create an OpenGL back-end most probably. At least to a
 higher degree that I was proclaiming previously. I've now been able to
 hook most fpGUI messages to GLut.

 Regards, Darius


Hi Darius, nicely done :)

I for one, would be interested in the code :)

cheers,
Paul 



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


Re: [fpc-pascal] Re: fpGUI powered by OpenGL

2010-12-22 Thread Paul Nicholls
- Original Message - 
From: Darius Blaszyk dhkblas...@zeelandnet.nl

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Thursday, December 23, 2010 10:15 AM
Subject: Re: [fpc-pascal] Re: fpGUI powered by OpenGL



On Thu, 2010-12-23 at 10:06 +1100, Paul Nicholls wrote:

Darius Blaszyk dhkblas...@zeelandnet.nl wrote
in message news:1292870518.1851.35.ca...@darius-desktop...
 On Mon, 2010-12-20 at 18:58 +0100, Darius Blaszyk wrote:
  The above explains why it is useful for an application developer to
  use an openGL backend.
 
  It does not explain the following: Since fpGUI already has two
  backends (afaik, X and winap), why can't openGL a third one? Did you
  change the way fpGUI interfaces with its backend? Is this change so
  incompatible with the current backends, that they cannot be 
  modified?


 The changes I think are pretty incompatible. This is because the GLut
 library also provides messaging, whereas in fpGUI the messages are
 implemented outside of the backend. Therefore hacks are needed to keep
 the drawing messages coming correctly. With a pascal context library
 everything could be merged seamless I suppose.

 I've been badly mistaking. With some minor adjustments it will be
 possible to create an OpenGL back-end most probably. At least to a
 higher degree that I was proclaiming previously. I've now been able to
 hook most fpGUI messages to GLut.

 Regards, Darius


Hi Darius, nicely done :)

I for one, would be interested in the code :)


Hi Paul,

I've cleaned up the code and integrated it more nicely with the existing
implementation. It runs now on Linux and Win32. However still struggling
with the message loop which is implemented differently in GLut.
As for the code, perfectly happy to share although I don't know where to
put it. I will ask Graeme if he can create a branch or something. Will
let you know.

Regards, Darius



Thanks Darius, keep up the excellent work :)

cheers,
Paul 


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


Re: [fpc-pascal] Looking for SDL_opengl header

2010-12-08 Thread Paul Nicholls
- Original Message - 
From: Matt Emson memson.li...@googlemail.com

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Thursday, December 09, 2010 4:11 AM
Subject: Re: [fpc-pascal] Looking for SDL_opengl header



On 08/12/2010 09:42, Darius Blaszyk wrote:


Couldn't find it there, although there are some examples with SDL and
OpenGL available with Jedi-SDL. So perhaps I don't need a specific
SDL_opengl header (I'm porting a C app).

Darius



Did you try here? http://www.freepascal-meets-sdl.net/
Or here? http://www.pascalgamedevelopment.com/content.php

Also, I used to work with a guy called Dominique Louis (he now owns 
Savage Software, who seem to still be around) and he was an extremely 
big Delphi/Pascal game development advocate. I believe he had a hand in 
the Jedi SDL conversion, at least for FreePascal. It might be worth 
trying to get in contact with him. He might even be on this list.




You can also find Dominique on these forums:

www.pascalgamedevelopment.com

See his profile page here:

http://www.pascalgamedevelopment.com/member.php?10-savage

and here is Savage Software:

http://www.savagesoftwaresolutions.com/

He is/was the main guy doing the Jedi-SDL project :)

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


[fpc-pascal] Re: Re: TPLY

2010-11-01 Thread Paul Nicholls
leledumbo leledumbo_c...@yahoo.co.id wrote 
in message news:1288343826290-3241740.p...@n5.nabble.com...

 I would start with this site to learn how to create recursive descent
 parsers using Pascal :)

 Definitely, but it doesn't build AST, which is required if you need to 
 write
 a parser for a language that can't be parsed in single pass like Java.


True, but you just have to use the code as a starting point and generate an 
AST :)

Shouldn't be too hard... (tm) LOL

cheers,
Paul 



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


[fpc-pascal] Re: Re: TPLY

2010-10-28 Thread Paul Nicholls
Brian Winfrey bwcod...@gmail.com wrote in 
message news:aanlktinq5bgnulg05nyuizl8bpoxdenu3ofyuqhnp...@mail.gmail.com...
Thank you, What techiniques have you used in the past that you could
share to get me started?

On Wed, Oct 27, 2010 at 8:04 PM, leledumbo 
leledumbo_c...@yahoo.co.id wrote:

 Learn compilation technique, a recursive descent parser should be easy to
 understand and code instead of learning automatic lexer and parser
 generator. Plus, structurally, Java is a very simple language, so AST
 transformation should be easy. With FPC 2.5.1, almost all Java constructs
 can be directly translated to FPC dialect, minus anonymous inner class 
 only
 AFAIK.

I would start with this site to learn how to create recursive descent 
parsers using Pascal :)

http://compilers.iecc.com/crenshaw/

Using this information as a starting point, I have created pascal-like 
script languages (compiled to byte code), and pascal-like HL language 
compiled to virtual machine ML instructions :)

cheers,
Paul 



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


[fpc-pascal] Re: ReadStr/WriteStr vs Val/Str

2010-10-18 Thread Paul Nicholls
Richard Ward row...@mac.com wrote in message 
news:6707d87e-2ea6-4469-97a5-cf55d1a04...@mac.com...
As a user of the old Macintosh Pascal (later THINK Pascal),  both ReadStr 
and WriteStr functions were included and I used them quite a bit.   The 
names were different but the FPC implementation is basically the same as far 
as I can tell.

Besides backward compatibility, portability issues and personal preference, 
is there any functionality Val and Str may have that ReadStr and WriteStr 
don't?  I can't see any, but wanted to make sure there there were no subtle 
technical issue(s) I might need to consider.

Thank you for implementing these functions. 
___
fpc-pascal maillist  - 
fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Hi Richard,
 I don't know about the Macintosh Pascal ReadStr and WriteStr routines 
(never used them), but a 'possible' gotcha is that I think the Str() 
function will append a space at the beginning of a value to leave room for 
the sign if negative...

if you don't want that then you can use the Format routine instead:

Integer to string:
s := Format('%d',[some integer number]);

float to string:
s := Format('%.4f',[some floating point number]); //formats a floating 
point number to 4 decimal places (just change, or remove if you want 
scientific notation I think)

I hope this helps :)

cheers,
Paul 



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


Re: [fpc-pascal] fpc-passrc expression parser (issue #16914)

2010-07-13 Thread Paul Nicholls
- Original Message - 
From: Michael Van Canneyt mich...@freepascal.org

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Tuesday, July 13, 2010 6:42 PM
Subject: Re: [fpc-pascal] fpc-passrc expression parser (issue #16914)





On Tue, 13 Jul 2010, dmitry boyarintsev wrote:


Hello, Michael Van Canneyt,

Sorry, I can't write to the resolved issue (without re-opening) it.

- better class tree (split out binary/unary/primitive operators in 
subclasses)
These may break backwards compatiblity; if you prefer to do them 
yourself, I can say what I have in mind.


That's how it was originally written. However, I personally prefer to
keep less subclasses.


I prefer more, with less fields, it saves memory on big expressions :-)


I would like to hear your ideas.


Well, at least I would have expected 4 subclasses:
TPasExpr
 +-- TUnaryExpr (field operand)
 +-- TBinaryExpr (fields left, right)
 +-- TPrimitiveExpr (field 'value')
 +-- TFunctionCallExpr (fields value/params)

I must say that I am not familiar with the parsing style you used. I wrote 
2 expression parsers meanwhile, and both used a different style. (see 
fcl-base/fpexprpars.pp; the other one is in fcl-js. A third will follow in 
the sql parser I'm about to commit)



thanks,
dmitry

P.S.. the expression parser still doesn't resolve ranges (i.e. in
sets), neither simple nor complex, like:

Char(6) in [Char(sizeof(Integer))..Char(SizeOf(int64))]


That should be relatively easy to add, no ?

Michael.


Hi all,
 I am interested in expression parsers myself :)

Where can I find the code for fpexprpars.pp and other fpc parsing code 
like that?


I had bit of a look browsing the SVN online, but no luck...

cheers,
Paul 


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


Re: [fpc-pascal] linked list to criticize

2010-05-03 Thread Paul Nicholls

Hi Denis,
 nice :)

I'm curious, why didn't you make it a class...wouldn't that have made it
nicer/easier to use and program?

cheers,
Paul

- Original Message - 
From: spir ☣ denis.s...@gmail.com

To: FreePascal fpc-pascal@lists.freepascal.org
Sent: Monday, May 03, 2010 4:25 AM
Subject: [fpc-pascal] linked list to criticize


Hello,

Finally did it!
Managed to write in Pascal a linked list type, with all common operations 
(put, change, remove, find  more).

If anyone is nice enough to have a look, comment, and criticize:
http://spir.wikidot.com/pascal-doubly-linked-list
(There's an extensive intro text, and a test suite with output.)

Denis


vit esse estrany ☣

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


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


Re: [fpc-pascal] including libraies ?

2010-03-14 Thread Paul Nicholls
- Original Message - 
From: Terry A. Haimann te...@haimannonline.com

To: fpc-pascal@lists.freepascal.org
Sent: Monday, March 15, 2010 9:11 AM
Subject: [fpc-pascal] including libraies ?



I tried to write a little utility to submit a command to the At Facility.

The code to do this is as follows:

program TestPrg;

Uses Classes, Process;

Var
   i:Integer;
   Cmd, Pre, Post, StrVar, SwStr:String;
   MyProcess: TProcess;
   SOut, EOut, StdStrLst: TStringList;

Begin
   StdStrLst   := TStringlist.Create;
   SOut   := TStringlist.Create;
   EOut   := TStringlist.Create;  EOut := TStringlist.Create; MyProcess := 
TProcess.Create(nil);  MyProcess.CommandLine := 'at now'; 
MyProcess.Options := MyProcess.Options + [poUsePipes];  MyProcess.Execute; 
StdStrLst.Clear;
 StdStrLst.Add('awk -F: ''{print $1\t$3\t$4}'' /etc/passwd | 
sort');StdStrLst.SaveToStream(MyProcess.Input);StdStrLst.Clear; 
StdStrLst.Add(chr(4));

 StdStrLst.SaveToStream(MyProcess.Input);
 SOut.LoadFromStream(MyProcess.Output);
 For i:=1 to SOut.Count Do
 WriteLn(SOut.Strings[i]);
 EOut.LoadFromStream(MyProcess.StdErr);
 For i:=1 to EOut.Count Do
 WriteLn(EOut.Strings[i]);
End.


Running this code from a Lazarus test program works with out any problems. 
When running it from a Free Pascal (non gui,) the program finishes 
normally, but nothing gets submitted to the AT Facility.
uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, 
Dialogs,

StdCtrls, Process;

Someone on the Lazarus List recommend I add SysUtils to my utility 
program.  I am not sure how to do this.  SysUtils has many included files 
in there and they are all in other directories, none of which are in my 
path.  I am sure there is some simple method here that I am totally 
ignorant of.




HI Terry, you should be able to just include SysUtils in your uses clause 
without any issues.


The compiler should be able to find that unit (and others needed) 
automatically...


{code}
Uses Classes, Process,SysUtils;
{code}

cheers,
Paul 


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


Re: [fpc-pascal] Re: creating a standalone executable(eg: applicationinstallation file)

2010-01-19 Thread Paul Nicholls
- Original Message - 
From: Graeme Geldenhuys graemeg.li...@gmail.com

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Tuesday, January 19, 2010 6:36 PM
Subject: Re: [fpc-pascal] Re: creating a standalone executable(eg: 
applicationinstallation file)




Paul Nicholls wrote:


http://www.franzone.com/2008/08/14/how-to-create-a-bash-install-script/


Thanks Paul. I guess the author of that website didn't know about 
Makeself,

which automates the exact same procedure he does manually.

Either way, that seems to be the popular way of distributing applications
in a distro independent manner.

The installer I'm working on will probably start as a script, unpack 
itself

and then figure out if it should run the Console setup or the GUI setup -
depending if X11 is available and running. This will also allow me to pick
the correct setup for the architecture (32bit or 64bit install, *BSD or
Linux binary etc).

So far my GUI setup is looking pretty neat and is completely configurable
at runtime using a setup.xml file. Later I'll create a install builder
which will generate that setup.xml file for the user/developer.

Regards,
 - Graeme -


Nice! I would be interested in this myself as I want to start Linux (Ubuntu) 
programming with freepascal/Lazarus, and some sort of install system would 
be great :)


I'm trying to get a game I've made working under Linux now (Is currently 
Win32 ATM).


cheers,
Paul 


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


[fpc-pascal] Re: creating a standalone executable (eg: applicationinstallation file)

2010-01-18 Thread Paul Nicholls

- Original Message - 
From: Graeme Geldenhuys 
graemeg.lists-re5jqeeqqe8avxtiumw...@public.gmane.org
Newsgroups: gmane.comp.compilers.free-pascal.general
To: FPC-Pascal users discussions 
fpc-pascal-pd4fty7x32k2wbthl531ywd2fqjk+...@public.gmane.org
Sent: Tuesday, January 12, 2010 11:37 PM
Subject: creating a standalone executable (eg: applicationinstallation file)


 Hi,

 I have seen a few Linux application that have standalone executables
 that are installation programs. Once run, it installs the application
 in the appropriate directory location, can run as root or normal user
 and creates a desktop and Application menu icon. Similar to Windows's
 setup.exe idea. An example of such a Linux application is
 'installpixel32' from the Pixel32 project, or Kylix 3 installation.

 * How does one create such a standalone application?
 * How do you include the application executable and other resources
 (text, image, sound files etc) inside such an installation executable?


 I'm trying to create (mainly for our company, but probably open-source
 in the end) such a standalone setup creation for our projects. This
 way it will be Linux distro independent. I also don't want to go the
 route of projects like AutoPackage that first requires a setup runtime
 to be installed. I want a installation file like what Pixel32 did. One
 installation executable without any installation runtime etc. and
 after the installation, I can simply click on 'uninstall' or run
 'setup -u' and a graphical uninstaller is launched.

 I'm going to look at Loki Games's setup program to see if I can port
 it to fpGUI Toolkit, or at least get some ideas of how to create such
 a setup application. Basically I'm trying to create a InstallShield
 Lite but for Linux. :-)  The nice thing of Loki Games is that it run
 run as a console installation or a GUI installation - again, no idea
 how they managed that, but it was possible (Kylix 3 installation did
 that).

 Anybody have pointers or internet links I can read up on the subject?

 -- 
 Regards,
  - Graeme -


 ___
 fpGUI - a cross-platform Free Pascal GUI toolkit
 http://opensoft.homeip.net/fpgui/
 ___
 fpc-pascal maillist  - 
 fpc-pascal-pd4fty7x32k2wbthl531ywd2fqjk+...@public.gmane.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Hi Graeme,
   perhaps this link might help - it shows you how to create a linux script 
with appended zip'd data, and then make it executable so it can be run as a 
normal program :)

http://www.franzone.com/2008/08/14/how-to-create-a-bash-install-script/

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

Re: [fpc-pascal] Forum merger

2009-12-21 Thread Paul Nicholls
- Original Message - 
From: Zaher Dirkey parm...@gmail.com

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Tuesday, December 22, 2009 10:47 AM
Subject: Re: [fpc-pascal] Forum merger



Are you discussing about build Forum or CMS using fpWeb/pascal?

It is need use also CSS and JavaScript and Database.

This kind of projects take a long time with many security bugs need to
fix it immediately, it is not like a local desktop application,
and after that what the real profits?

For me, i like to see Pascal generate good web application, especially
if it had Right To Left support :)

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


What is right to left support?

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


Re: [fpc-pascal] Compiler Warning: Constructor should be public

2009-11-10 Thread Paul Nicholls
- Original Message - 
From: Anthony Walter sys...@gmail.com
To: grae...@opensoft.homeip.net; FPC-Pascal users discussions 
fpc-pascal@lists.freepascal.org

Sent: Wednesday, November 11, 2009 1:07 AM
Subject: Re: [fpc-pascal] Compiler Warning: Constructor should be public


Your argument is flawed. Visibility rules apply to identifiers, not 
keywords.


Create // identifier
CreateFromLine // different identifier

No visibility is being changed by introducing a *new* identifier

raise EAssertError.Create(Msg); // still visible
raise EAssertError.CreateFromLine(Msg, FileName, LineNumber); // not 
visible



SNIP

Hi Anthony,
   Sorry, but you are incorrect; Create is a method, not an identifier, 
and like all methods, it is affected by visibility rules (public, private, 
protected).


cheers,
Paul 


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


Re: [fpc-pascal] X, Y co-ordinate system under OS/2

2009-10-28 Thread Paul Nicholls
- Original Message - 
From: Graeme Geldenhuys graemeg.li...@gmail.com

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Thursday, October 08, 2009 1:31 AM
Subject: [fpc-pascal] X, Y co-ordinate system under OS/2



Hi,

I'm porting an OS/2 application to Linux  Windows.  From what I can
see in the code, it looks like co-ordinates (0,0) is in the bottom
left corner of the screen. Whereas Windows and Linux, co-ordinates
(0,0) is in the Top Left of the screen.

Is my assumption correct?  If so, DAMN! This is going to cause a lot
of work. :-/


Regards,
 - Graeme -


Hi Graeme, I know this is a oldish post, but I had some thoughts on this 
just today :)


I'm making a simple GUI system for a game, and I needed to have screen 
origin independant input coordinates for the GUI (simpler to think about 
when using), and can be used in different world coordinate systems.


So, I have this in my GUI class:

properties
--
FOriginX : Integer;  // is the screen's top-left coordinate in final 'world' 
coordiantes

FOriginY : Integer;
FDownDir : Integer;  // is either +1, or -1 (+1 for world y coordinates 
increasing downwards, and -1 for increasing upwards


methods
-
Function  TIMGUI.ScreenToWorldX(Const sx : Integer) : Integer;
Begin
   Result := FOriginX + sx;
End;
{..}

{..}
Function  TIMGUI.ScreenToWorldY(Const sy : Integer) : Integer;
Begin
   Result := FOriginY + sy * FDownDir;
End;

with the GUI screen, I assume that the top left is 0,0 and the bottom right 
is (width,height) just like in windows.


Now if I want to draw a button, I just do this:

(x,y)
   +---+
   |   |
   |   |
   +---+
   (x+w,y+h)

Procedure FIMGUI.DrawRadioButton(x,y,w,h : Integer; text : AnsiString);
Begin
   mx := x + h Div 2;
   my := y + h Div 2;
   r  := h Div 2;

   x1 := ScreenToWorldX(mx-r);
   y1 := ScreenToWorldY(my-r);

   x2 := ScreenToWorldX(mx+r);
   y2 := ScreenToWorldY(my+r);
{...}
   // radio button background
   DrawRoundedRect(x1,y1,
   x2,y2,
   0,r,cLineWidth,
   FBackgroundColor.r,
   FBackgroundColor.g,
   FBackgroundColor.b,
   FBackgroundColor.a,
   True,5);

   // radio button border
   DrawRoundedRect(x1,y1,
   x2,y2,
   0,r,cLineWidth,
   FBorderColor.r,
   FBorderColor.g,
   FBorderColor.b,
   FBorderColor.a,
   False,5);

   r := Trunc(r * 0.65);

   x1 := ScreenToWorldX(mx-r);
   y1 := ScreenToWorldY(my-r);

   x2 := ScreenToWorldX(mx+r);
   y2 := ScreenToWorldY(my+r);

   // radio button active dot
   If active Then
   DrawRoundedRect(x1,y1,
   x2,y2,
   0,r,cLineWidth,
   FBorderColor.r,
   FBorderColor.g,
   FBorderColor.b,
   FBorderColor.a,
   True,5);

   If text = ''  Then Exit;
   If font = Nil Then Exit;

   FontH := font.MaxHeight;
   FontX := ScreenToWorldX(x+h+4);
   FontY := ScreenToWorldY(my - FontH Div 2);

   glEnable(GL_TEXTURE_2D);
   If FUIState.HotItem = id Then
   glColor4fv(@FHotColor)
   Else
   glColor4fv(@FFontColor);
   font.Draw(FontX,FontY,text,0);
{...}
End;

I hope this helps?

cheers,
Paul 


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


Re: [fpc-pascal] WORD (2 bytes) to String conversion

2009-10-25 Thread Paul Nicholls
- Original Message - 
From: Graeme Geldenhuys graemeg.li...@gmail.com

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Friday, October 23, 2009 11:10 PM
Subject: [fpc-pascal] WORD (2 bytes) to String conversion



Hi,

I'm reading in a WORD (2 bytes) from a binary file. I can display the
Hex format of that value without a problem, but I would also like to
display the String value of that WORD variable. It's the first 2 bytes
of a file, which contains the magic number of the file.

I would like my program to output the following:

-
Header Section
 header.ID(5348h = HS)
 ...
-


Hi Graeme,
   What about something like this (variant records, similar to C unions)? 
(untested, ie. from memory, but shoud work)


TMyHeader = Packed Record
   Case Integer Of
   0 : (ID : Word);
   1 : (IDStr : String[2]);
End;

You should then be able to file read/write it identically, and also do this:

Var
   Header : TMyHeader;
Begin
   WriteLn(Header.ID) ;// as a word
   WriteLn(Header.IDStr); // as a 2 byte string
End;

cheers,
Paul 


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


Re: [fpc-pascal] Parser combinator library

2009-09-03 Thread Paul Nicholls
- Original Message - 
From: leledumbo leledumbo_c...@yahoo.co.id

To: fpc-pascal@lists.freepascal.org
Sent: Thursday, September 03, 2009 6:25 PM
Subject: [fpc-pascal] Parser combinator library




Is there any parser combinator library for Pascal?
--


Hi :)
What exactly do you mean by parser combinator library?

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


[fpc-pascal] Re: SHA1 implementation

2009-06-28 Thread Paul Nicholls
Graeme Geldenhuys 
graemeg-7urf0cyadk+bldxiawxz59huzzzso...@public.gmane.org wrote in message 
news:4a47b06f.4030...@opensoft.homeip.net...
 Hi,

 Does FPC contain a cross-platform SHA1 algorithm implementation?  I used 
 Lazarus IDE's Search in files feature across the whole FPC 2.2.5 and saw 
 some references to the word sha1, but nothing that looks like the actual 
 implementation.


 Regards,
 - Graeme -


Hi Graeme,
Maybe this will help?

http://wiki.freepascal.org/DCPcrypt

cheers,
Paul 

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

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Paul Nicholls
2009/6/18 Graeme Geldenhuys grae...@opensoft.homeip.net

 Vincent Snijders wrote:
 
  Backwards compatibility with turbo pascal, which lacked initialized
  variables and writable constants were the alternative.

 Thanks Vincent. The Kylix 3 help mentioned early versions of Delphi and
 Borland Pascal, which made me think that it must have been some
 limitation in the older compilers. Thanks for confirming this.


 Regards,
  - Graeme -


I also find writable constants hand for things like this where I can define
the 'variable' + values too so I don't have to set the values at run time:

Const
{..}
cNote_Unknown = -1;
cNote_C   = 0;
cNote_Cs  = 1;  cNote_Db = 1;
cNote_D   = 2;
cNote_Ds  = 3;  cNote_Eb = 3;
cNote_E   = 4;
cNote_F   = 5;
cNote_Fs  = 6;  cNote_Gb = 6;
cNote_G   = 7;
cNote_Gs  = 8;  cNote_Ab = 8;
cNote_A   = 9;
cNote_As  = 10; cNote_Bb = 10;
cNote_B   = 11;
cNotes : Array[0..11,0..8] Of Single =
(
//Octave
//Note0 1 2
3 4 5 6
7 8
{C}  (16.3515978312874, 32.7031956625748, 65.4063913251497,
130.812782650299, 261.625565300599, 523.251130601197, 1046.50226120239,
2093.00452240479, 4186.00904480958),
{C#/Db}  (17.3239144360545, 34.647828872109 , 69.295657744218 ,
138.591315488436, 277.182630976872, 554.365261953744, 1108.73052390749,
2217.46104781498, 4434.92209562995),
{D}  (18.354047994838 , 36.7080959896759, 73.4161919793519,
146.832383958704, 293.664767917408, 587.329535834815, 1174.65907166963,
2349.31814333926, 4698.63628667852),
{D#/Eb}  (19.4454364826301, 38.8908729652601, 77.7817459305202,
155.56349186104 , 311.126983722081, 622.253967444162, 1244.50793488832,
2489.01586977665, 4978.03173955329),
{E}  (20.6017223070544, 41.2034446141088, 82.4068892282175,
164.813778456435, 329.62755691287 , 659.25511382574 , 1318.51022765148,
2637.02045530296, 5274.04091060592),
{F}  (21.8267644645628, 43.6535289291255, 87.307057858251 ,
174.614115716502, 349.228231433004, 698.456462866008, 1396.91292573202,
2793.82585146403, 5587.65170292806),
{F#/Gb}  (23.1246514194772, 46.2493028389543, 92.4986056779086,
184.997211355817, 369.994422711634, 739.988845423269, 1479.97769084654,
2959.95538169308, 5919.91076338615),
{G}  (24.4997147488593, 48.9994294977187, 97.9988589954373,
195.997717990875, 391.995435981749, 783.990871963499, 1567.981743927  ,
3135.96348785399, 6271.92697570799),
{G#/Ab}  (25.9565435987466, 51.9130871974931, 103.826174394986,
207.652348789973, 415.304697579945, 830.60939515989 , 1661.21879031978,
3322.43758063956, 6644.87516127912),
{A}  (27.5, 55  , 110 ,
220 , 440 , 880 , 1760,
3520, 7040),
{A#/Bb}  (29.1352350948806, 58.2704701897613, 116.540940379522,
233.081880759045, 466.16376151809 , 932.32752303618 , 1864.65504607236,
3729.31009214472, 7458.62018428944),
{B}  (30.8677063285078, 61.7354126570155, 123.470825314031,
246.941650628062, 493.883301256124, 987.766602512248, 1975.5332050245 ,
3951.06641004899, 7902.13282009799)
);
{..}


Notice the cNotes array - it is already filled with values for me to use at
runtime :)

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

Re: [fpc-pascal] Problems with Debian and FP IDE

2009-05-11 Thread Paul Nicholls
What was the error message?
What was the version of FPC and Debian?
cheers,
Paul

- Original Message - 
  From: Andres Linares 
  To: Free Pascal Mail List 
  Sent: Tuesday, May 12, 2009 4:48 AM
  Subject: [fpc-pascal] Problems with Debian and FP IDE


Hi,When I run FP IDE on Debian I get an error message. Also I cannot use F8 to 
debug my program. How can I fix this?thanks

--
  Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy! Try it! 


--


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

Re: [fpc-pascal] TList: newbie question

2009-04-01 Thread Paul Nicholls
- Original Message - 
From: Bart bartjun...@gmail.com

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Wednesday, April 01, 2009 10:12 PM
Subject: [fpc-pascal] TList: newbie question



Hi,

I never used TList before, so I'm not sure if this is correct.

I constructed a TlcTextCache class that basically stores objects of
type TLcText in a TList.
A TlcText object is create with TLcText.Create(FileName).

My questions:
- I add my TlcText objects to the list by TList.Add(SomeTlcTextObject)
- I read from the list by SomeTlcTextObjetc :=
TlcText(TList.Items[Index]) (casting it at compiletime)
Is this the way I am supposed to do that and is it safe explicitly
casting the TList.Item[Index] to the TlcText type (I know I only add
this type of objects to the list).

Here's the relevant part of the code:

 TLcText = class
 [snip]

 TLcTextCache = class
 private
   FCacheList: TList;
 protected
   function IsCached(const FileName: String): Boolean;
   function CacheIndex(const FileName: String): Integer;
   function AddFile(const FileName: String): Boolean;
   function GetCacheCount: Integer;
   function GetLcText(const FileName: String): TLcText;
 public
   constructor Create; virtual;
   destructor Destroy; override;
   property Count: Integer read GetCacheCount;
 end;

{ TLcTextCache }

function TLcTextCache.IsCached(const FileName: String): Boolean;
begin
 Result := CacheIndex(FileName) = 0;
end;

function TLcTextCache.CacheIndex(const FileName: String): Integer;
var
 i: Integer;
 LcText: TLcText;
begin
 Result := -1;
 for i := 0 to FCacheList.Count - 1 do
 begin
   LcText := TLcText(FCacheList.Items[i]);
   if LcText.FileName = FileName then
   begin
 Result := i;
 Break;
   end;
 end;
end;

function TLcTextCache.AddFile(const FileName: String): Boolean;
begin
 Result := FCacheList.Add(TLcText.Create(FileName)) = 0;
end;

function TLcTextCache.GetCacheCount: Integer;
begin
 Result := FCacheList.Count;
end;

function TLcTextCache.GetLcText(const FileName: String): TLcText;
var Index: Integer;
begin
Index := CacheIndex(FileName);
if (Index = 0) then
  Result := TlcText(FCacheList.Items[Index])
else
  Result := nil;
end;

constructor TLcTextCache.Create;
begin
 inherited Create;
 FCacheList := TList.Create;
end;

destructor TLcTextCache.Destroy;
var
 i: Integer;
 LcText: TLcText;
begin
 for i := FCacheList.Count - 1 downto 0 do
 begin
   LcText := TLcText(FCacheList.Items[i]);
   LcText.Free;
   LcText := nil;
 end;
 FCacheList.Free;
 inherited Destroy;
end;


So far testing this construction gave no obvious errors (but as we all
know that is no garantee that the code is not flawed at some point)
and no memory leaks (using heaptrc).

Bart


As far as I can see it all looks A-OK :)
cheers,
Paul
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Pascal arrays vs TStringList.DelimitedText

2009-03-19 Thread Paul Nicholls
- Original Message - 
From: Francisco Reyes li...@stringsutils.com

To: FreePascal list fpc-pascal@lists.freepascal.org
Sent: Friday, March 20, 2009 2:32 PM
Subject: [fpc-pascal] Pascal arrays vs TStringList.DelimitedText



Getting back to Pascal.. Aren't pascal arrays 1 based?

As I get myself re-acquainted with pascal I am working on a small open 
source utility. Bumped into something that confused me.. It seems 
TStringList.DelimitedText produces an array that starts at zero, but from 
what I can tell regular arrays start at 1.



Is there a list anywhere of which classes in the FCL use arrays that start 
at zero?


Tried reading the Tstringlist documentation and the beginning of the 
classes unit for any indicator of arrays in that unit starting at zero, 
but did not see any. Did I miss it?


Hi Francisco, regular arrays can start at whatever index you want:

Var
   MyArray1 : Array[1..3] Of Integer;
   MyArray2 : Array[-3..21] Of String;

Dynamic Arrays :

Var
   MyDynamicArray : Array Of Integer;

These always start with a zero index.

TStringList and similar classes use a zero index too.

I don't know if there is any list like you want though...
cheers,
Paul 


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


[fpc-pascal] Re: DirectX applications crash

2009-03-17 Thread Paul Nicholls




Hi Felipe,
  Perhaps you should try setting the interfaces to Nil instead of calling 
their _release method...


// this is the function that cleans up Direct3D and COM
procedure cleanD3D();
begin
 d3ddev := Nil;// close and release the 3D device
 d3d   := Nil;// close and release Direct3D
end;

cheers,
Paul 




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


Re: [fpc-pascal] Sockets in FPC

2009-02-18 Thread Paul Nicholls

Hi

I need to write a daemon on Linux which will wait on a user defined
port (say 3) and parse the socket input to write into a Mysql
database. Can anybody suggest examples in FPC ?

Presently , I am using TCL for this. The problem is the behaviour of
Gets function in TCL.. It is buffered with EOF as newline.

But i need the socket to have a user defined char like ':' and it
should be  unbuffered too. I mean dont want an Enter keyed to be at
the end.

We use various GPRS modules on embedded devices, each with its own
nuances of terminating a string. So we can't afford to have a 'normal'
gets or readln behaviours.

Please help


regards

Nataraj



Hi Nataraj,
   I'm not sure about actual code examples, but you could try the Synapse 
Pascal TCP/IP library classes, they work on Win32, Linux and I'm pretty sure 
MAC OS too :-)


http://www.ararat.cz/synapse/doku.php

cheers,
Paul 


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


[fpc-pascal] Re: specifying the relative path to a file that is located in the same folder as the application bundle?

2009-02-05 Thread Paul Nicholls
Ken G. Brown kbrown-ee4meeah...@public.gmane.org wrote in message 
news:p06240407c5b049e88...@[10.0.1.199]...
 MacOS X, 10.5.6, fpc 2.2.2

 How can I find the directory path to the executable of the currently 
 executing program from within the program?

 Or alternately, how can I specify the relative path to a file that is 
 located in the same folder as the application bundle for my currently 
 executing program?

 Using ./filename does not appear to work for me.

 Are there file and directory type utilities available? Where can I read up 
 on them?

 Thx for any tips,
 Ken G. Brown
 ___
 fpc-pascal maillist  - 
 fpc-pascal-pd4fty7x32k2wbthl531ywd2fqjk+...@public.gmane.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Maybe I haven't understood you completely, but have you tried this?

MyProgramFolder := ExtractFilePath(ParamStr(0));

This should hopefully get you the folder of the currently running program 
from within the program (at least under Win32 and Linux).

cheers,
Paul 

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

[fpc-pascal] Re: crossplatform networking

2009-01-29 Thread Paul Nicholls
Bee bisma-96w4lwiwc1nexsysy73...@public.gmane.org wrote in message 
news:49817e1f.8080...@brawijaya.ac.id...
 Hi all,

 I need to build some crossplatform networking applications. It'd be 
 UDP-based. It should be able to support at least 3 mainstream OSes: 
 Windows, Linux, and Mac. It also should be able to run on 64bit 
 environment (at any OSes).

 Any suggestion what is the best crossplatform networking framework for 
 FPC? At least able to run on the above 3 OSes. Indy? Synapse? lNet? And 
 for what reasons?

 I don't need GUI/widget support as it would be only server-to-server 
 communication and mostly run as daemon/service.

 TIA.

 -Bee-

I would suggest Synapse, as that works under Windows, Linux and I think also 
Mac :-)
I'm not sure about 64bit OSes though - probably.

cheers,
Paul 

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

[fpc-pascal] Re: Using OpenCASCADE 3d tools with Pascal?

2008-12-18 Thread Paul Nicholls

Marc Santhoff m.santhoff-zqrnuxuvxa0b1svskn2...@public.gmane.org wrote
in message news:1229580231.333.8.ca...@localhost.das.netz...

Am Donnerstag, den 18.12.2008, 09:02 +1100 schrieb Paul Nicholls:

Hi all,
I am wondering if anyone here has ever managed to use the free
open-source OpenCASCADE 3d tools (www.opencascade.org) with Pascal
before?


I don't think so, but I remember two facts:

The toolkit is huge, porting will be a lot of work.
And it'll be complicated or maybe impossible because it is written in C
++. IIRC there are some problems related to C++ objects in libraries and
fpc.

An already developed ActiveX OCX control has been developed that may
work but it costs lots of money.


IIRC there was Java binding back in version 4 of opencascade (the
version I had to deal with). I'm not sure if that could be used as a
guideline for adapting to object pascal, though.

HTH anyhow,
Marc



I was thinking more along the lines of perhaps creating a compatible dll
that could be used for Pascal/Delphi, and if necessary, flattening when
necessary method calls to plain functions, etc.

I'm sure this sort of thing has been done before as you can use it under
Visual Basic, Java, C#, Python, Ruby.

I have seen various people create a single dll containing the OpenCASCADE 
routines, but I am not sure how.


One person has made

NaroCAD, a free open source parametric modeling CAD application with C#:
http://sourceforge.net/projects/narocad/. The project contains a 
.Net(C++/CLI) wrapper layer and also a wrapper code generator application, 
you can generate your own wrappers in the language you want.
The OCC 6.3.0 wrappers are compiled under one assembly named 
OCWrappers.dll.


See the thread below
http://www.opencascade.org/org/forum/thread_14766/

cheers,
Paul


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


[fpc-pascal] Re: Using OpenCASCADE 3d tools with Pascal?

2008-12-18 Thread Paul Nicholls
Marc Santhoff m.santhoff-zqrnuxuvxa0b1svskn2...@public.gmane.org wrote 
in message news:1229657957.329.5.ca...@localhost.das.netz...
SNIP I was thinking more along the lines of perhaps creating a 
compatible dll
 that could be used for Pascal/Delphi, and if necessary, flattening when
 necessary method calls to plain functions, etc.

 I'm sure this sort of thing has been done before as you can use it under
 Visual Basic, Java, C#, Python, Ruby.

 I *think* that could be doable, I'm not so sure currently if there were
 general problems using C++ or if it had to do with ref-counted objects,
 memory management, or maybe only forms and graphical objects.

 Hopefully someone else can speak up here ...

 I have seen various people create a single dll containing the OpenCASCADE
 routines, but I am not sure how.

 One person has made

 NaroCAD, a free open source parametric modeling CAD application with C#:
 http://sourceforge.net/projects/narocad/. The project contains a
 .Net(C++/CLI) wrapper layer and also a wrapper code generator 
 application,
 you can generate your own wrappers in the language you want.
 The OCC 6.3.0 wrappers are compiled under one assembly named
 OCWrappers.dll.

 See the thread below
 http://www.opencascade.org/org/forum/thread_14766/

 There is FreeCAD, too. If all people starting a CAD program on sf.net
 would unite, that would be quite enough manpower to build a complete
 free CAD application in three months. ;)

 Something similar, hopefully explaning what you need:

 http://info.borland.com/borlandcpp/papers/bc360/

 HTH,
 Marc

Hi Marc,
To be honest, I am really only interested in the 3d STEP model 
import/export, and how to create the underlying meshes, etc. prior to the 
export, and back again from the import operation.

I am hoping this will simplify things quite a bit :-)

cheers,
Paul 

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

Re: [fpc-pascal] {$R file} support on non-Windows targets

2008-07-15 Thread Paul Nicholls
- Original Message - 
From: Graeme Geldenhuys [EMAIL PROTECTED]

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Tuesday, July 15, 2008 5:44 PM
Subject: Re: [fpc-pascal] {$R file} support on non-Windows targets



On Tue, Jul 15, 2008 at 2:23 AM, Luiz Americo Pereira Camara 

I still can not access the website or the news server


Sorry Luiz and Paul for the inconvenience...

Our new building is plagued with issues, plus the electritian we have
really sucks!!!  He can't seem to get things done in one go, so he
seems to work in the evenings when we close (17:00), and does little
bits at a time. :-(  And according to our time zone differences
(looking at your emails), that's your guys day time or something.  :-(

Hopefully our electricity issues will be resolved by the end of the
week. But as I mentioned before, fpGUI code is available on
SourceForge, so is not affected by our office outages.



That's ok Graeme, I was just letting you know about your site not working 
incase it helped :-)

cheers,
Paul 


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


Re: [fpc-pascal] {$R file} support on non-Windows targets

2008-07-14 Thread Paul Nicholls
- Original Message - 
From: Luiz Americo Pereira Camara [EMAIL PROTECTED]

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Tuesday, July 15, 2008 10:23 AM
Subject: Re: [fpc-pascal] {$R file} support on non-Windows targets



Graeme Geldenhuys wrote:

On Sun, Jul 13, 2008 at 11:47 PM, German Gentile
[EMAIL PROTECTED] wrote:


fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/


Big OT, your site is not working. I wanna try fpgui on lazarus.



They were working on our backup generator over the weekend, so we had
to power everything down. All is back to normal again.  The SubVersion
repository is on SourceForge, so you could still have gotten a copy.
Sorry for any inconvenience.




I still can not access the website or the news server

Luiz


Hi Graeme, for your info, I can't access the page either (I'm in Australia, 
if this helps)

cheers,
Paul 


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


Re: [fpc-pascal] code speed and size on various platforms

2008-06-17 Thread Paul Nicholls
Lourival Mendes [EMAIL PROTECTED] 
wrote in message 
news:[EMAIL PROTECTED]

Dear all users,

  I'm looking for an unity for calculus of some more complex
functions in Pascal than those avaiable in the Delphi math.pas unity.
For a more specific case I would like to calculate FFT and IFFT of
some signal data. Does the FPC has some? Is it possible to use it in
Delphi ? Does someone knows if there is the translation of numerical
recipes from C to Pascal??

Thanks

Lourival
___


Hi Lourival,
   perhaps this link below will help.  It is a free Delphi/Pascal 
implementation (source included) for a complext FFT and inverse FFT released 
under the Mozilla Public License Version 1.1.


http://www.simdesign.nl/fft.html

cheers,
Paul 


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


Re: [fpc-pascal] Building-Block Design - or putting it all together ; -)

2008-04-09 Thread Paul Nicholls
- Original Message - 
From: MPDJ [EMAIL PROTECTED]

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Wednesday, April 09, 2008 10:56 PM
Subject: [fpc-pascal] Building-Block Design - or putting it all together 
;-)




I've been following this list for sometime, but I'm not a professional
coder like most of you guys here so forgive me if this is obvious or
long-winded..

I've been writing small apps for many years, but am now working on by
far my largest yet and I'm having trouble working out the best way to
piece everything together as I've not had this number of parts in a
program before. All the pieces are currently working as small
test-components in their own right, but now need to go together.

For example, on the output-device side I'm not sure which modules
should communicate with which to make the neatest solution eg.

[Input modules] - [Individual Drawing Blocks] - [Main Output]

or

[Input modules] - [Main Output] - [Individual Drawing Blocks]

Should I have direct data access to each drawing module (they draw
menus, clocks etc.) which in turn have a link to the main output
control unit, or should everything go through one main output
control unit which passes the data on and has the control over each
module or is that bad coding / a bottle neck etc.?


Is there a tutorial or place that could help with the whole,
'knitting-together' aspect of Pascal (though I guess it would equally
apply to other languages)? All the tutorials I've used over the years
teach the language / classes / objects but don't tackle the issue of
piecing a much larger project together in a sensible, maintainable
manner.

Cheers.


I can't help you with your problem directly, but perhaps this newsgroup for 
object orient programming could help:


News server:newsgroups.borland.com
news group:borland.public.delphi.oodesign

It is for Delphi, but it would be equally valid for freepascal as both use 
object pascal...


cheers,
Paul 


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


Re: [fpc-pascal] ARM and graphic libraries

2008-02-24 Thread Paul Nicholls
- Original Message - 
From: Weyert de Boer [EMAIL PROTECTED]

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Saturday, February 23, 2008 9:40 AM
Subject: [fpc-pascal]  ARM and graphic libraries


Does anyone here have any experience with using FreePascal using ARM 
microprocessor and drawing graphics?

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


I have been using freepascal compiled programs on a arm-linux powered 
handheld called the GP2X.
I have been doing graphics using the JEDI-SDL units, and also with the raw 
frame buffer on the device.


http://fpc4gp2x.eonclash.com/
http://wiki.freepascal.org/GP2X

cheers,
Paul Nicholls 


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


Re: [fpc-pascal] problem with interface (OOP not widget)

2008-01-24 Thread Paul Nicholls
Hi Bee, perhaps you could try using {$MODE Delphi} instead of {$MODE OBJFPC}
since you seem to want Delphi compatibility.

cheers,
Paul

On 23/01/2008, Bee [EMAIL PROTECTED] wrote:

 Hi all,

 I got problem with the code below.

 ---8--- begin code ---8---

 program test_intf_query;

 {$IFDEF FPC}
{$MODE OBJFPC}{$H+}
 {$ENDIF}

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

Re: [fpc-pascal] fpc 2.2.0 win32_arm-linux cross-compiler issue

2007-09-27 Thread Paul Nicholls
On 26/09/2007, Peter Vreman [EMAIL PROTECTED] wrote:

  Hi all,
  I have downloaded the freepascal 2.2.0 fpc source code (
  fpcbuild-2.2.0.zip) and attempted to create a arm-linux cross-compiler
 that
  runs under win32.  I have done this previously with the fpcbuild-2.0.4.zip
  file ok using this batch file:
 
  **START OF BATCH FILE
  set path=G:\fpc\2.2.0\bin\i386-win32
  make distclean
 
  make all install CPU_TARGET=arm OS_TARGET=linux
  CROSSBINDIR=G:\fpc-crossbinutils\arm-linux BINUTILSPREFIX=arm-linux-
  INSTALL_PREFIX=G:\fpc_win32_arm-linux COMPILER_OPTIONS=cpufpemu
 
  pause
  END OF BATCH FILE**
 
 
  After I build the cross-compiler and tried using 'ppcrossarm.exe' to
 build a
  pascal program I was having errors in the output and noticed this:
 
  Free Pascal Compiler version 2.2.0 [2007/09/24] for arm
  Copyright (c) 1993-2007 by Florian Klaempfl
  Target OS: WinCE for ARM
 
  I am using the same batch file to compile my pascal program that I used
  before so I am unsure why it is saying that the Target OS: WinCE for ARM
 is
  coming up :(

 WinCE is the default ARM target if a cross compiler is build under
 Windows. You need to specify
 -Tlinux on the commandline or add it to fpc.cfg to make it the default:

 #ifdef cpuarm
 -Tlinux
 #endif

 Thanks Peter that addition to the fpc.cfg worked! :)
I am not sure why I didn't need that before thoughI was previously
using:

-XParm-linux- in the fpc.cfg file like so:

#IFDEF GP2X
#  -Ce
#  -CfSOFT
#  -CfLIBGCC
  -XS
#  -XD
  -Xd
  -XParm-linux-
#ifdef cpuarm
-Tlinux
#endif
  -Fug:\FPC_win32_arm-linux\units\arm-linux\*
  -Flg:\devkitGP2X\arm-linux\lib
  -Flg:\devkitGP2X\arm-linux\lib\ldscripts
  -Flg:\devkitGP2X\lib
  -Flg:\devkitGP2X\lib\gcc\arm-linux\4.0.2
  -Flg:\devkitGP2X\lib\pkgconfig
  -Flg:\devkitGP2X\sysroot\lib
  -Flg:\devkitGP2X\sysroot\usr\lib
  -Flg:\devkitGP2X\sysroot\usr\lib\gconv

#  -Flg:\Fpc\2.0.4\lib\arm-linux\lib
#  -Flg:\Fpc\2.0.4\lib
#  -Flg:\Fpc\2.0.4\lib\sysroot\lib
#  -Flg:\Fpc\2.0.4\lib\sysroot\usr\lib
# SOFT LIBGCC FPA FPA10 FPA11 VFP
#ENDIF


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

Re: [fpc-pascal] fpc 2.2.0 win32_arm-linux cross-compiler issue

2007-09-27 Thread Paul Nicholls
On 26/09/2007, Peter Vreman [EMAIL PROTECTED] wrote:


 WinCE is the default ARM target if a cross compiler is build under
 Windows. You need to specify
 -Tlinux on the commandline or add it to fpc.cfg to make it the default:

 #ifdef cpuarm
 -Tlinux
 #endif




Sorry, ignore the

#ifdef cpuarm
-Tlinux
#endif

 in my previous post...I was using the fpc.cfg without that new addtion :)

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

[fpc-pascal] fpc 2.2.0 win32_arm-linux cross-compiler issue

2007-09-26 Thread Paul Nicholls
Hi all,
I have downloaded the freepascal 2.2.0 fpc source code (
fpcbuild-2.2.0.zip) and attempted to create a arm-linux cross-compiler that
runs under win32.  I have done this previously with the fpcbuild-2.0.4 .zip
file ok using this batch file:

**START OF BATCH FILE
set path=G:\fpc\2.2.0\bin\i386-win32
make distclean

make all install CPU_TARGET=arm OS_TARGET=linux
CROSSBINDIR=G:\fpc-crossbinutils\arm-linux BINUTILSPREFIX=arm-linux-
INSTALL_PREFIX=G:\fpc_win32_arm-linux COMPILER_OPTIONS=cpufpemu

pause
END OF BATCH FILE**


After I build the cross-compiler and tried using 'ppcrossarm.exe' to build a
pascal program I was having errors in the output and noticed this:

Free Pascal Compiler version 2.2.0 [2007/09/24] for arm
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: WinCE for ARM

I am using the same batch file to compile my pascal program that I used
before so I am unsure why it is saying that the Target OS: WinCE for ARM is
coming up :(

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

Re: [fpc-pascal] Re: Re: Lua and Freepascal and ARM

2007-06-26 Thread Paul Nicholls

 Hi Paul,

SNIP

 I also need, as you, to call lua procedures from delphi/fpc and I need
Lua
 call procedures inside delphi/fpc.
 Should it posible to share with me your implementation in order to check
it
 works with fpc (linux-arm)?


Sure, I am not sure if I am allowed to add attachments to this mailing list
but I will attempt to add my Lua units and an example program for you to use
:)

EDIT: the previous post I sent hasn't appeared yet so I am assuming I can't 
post with attachments to the group so I have uploaded the files, you can 
download them here:


fpc4gp2x.eonclash.com/downloads/lua5.1.dll
fpc4gp2x.eonclash.com/downloads/luaobjects.pas
fpc4gp2x.eonclash.com/downloads/LuaPas.pas
fpc4gp2x.eonclash.com/downloads/LuaTest.dpr

Lua5.1.dll is the Windows Lua DLL for this version.
LuaTest.dpr is a Delphi program (also works under Freepascal) showing how to
use my TLuaScript class.
LuaPas.pas is the interface file for Lua version 5.1
LuaObjects.pas is the pascal file containing my TLuaScript class and other
helper functions, etc.

Enjoy, and I hope it helps you :-)
cheers,
Paul

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


[fpc-pascal] Re: Re: Lua and Freepascal and ARM

2007-06-24 Thread Paul Nicholls

Hi Paul,


Hi Jose :-)
I can't help you with your problem, but I am curious...


thanks anyway,


1)is your ARM system using Linux?

yes,

2)for Lua under ARM, are you using dynamic linking or static
linking?

i'm using dynamic linking but you can use static if you want.

For dynamic linking, where did you get your Lua 'DLL' from, and for
static
linking, how did you do this?

You only need to download lua sources to your arm-linux and make and make
install it's so easy


ok...


I would like to get into using Lua under arm-linux myself (already used
Lua
and freepacal under Win32 with no problems)


There is differences between freepascal for linux-i386 and linux-arm 
because

same program compiling for i386 work okey
but for ARM.

I'm testing with a wrapper (Pas2Lua) for freepascal and It work okey in
delphi-windows, freepascal-i386 but it does not
work in freepascal for ARM due some problem with heap implementation in
fpc-arm.

how are you using (in this way) lua and freepascal in windows? Are you 
also

using Pas2Lua?


I think I know the pas2lua you are talking about - created by jdarling 
(www.eonclash.com)? who lurks in the www.pascalgamedevelopment.com site...
I haven't used that myself, but I did make my own unit with helper 
functions, and a class that encapsulates a lua state so I can easily call 
lua procedures, etc. and also call Delphi procedures from Lua.


cheers,
Paul. 


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


[fpc-pascal] Re: Lua and Freepascal and ARM

2007-06-21 Thread Paul Nicholls

josepascual [EMAIL PROTECTED] wrote in
message news:[EMAIL PROTECTED]

Hi Everyone

I have made a example with lua inside freepascal. I have test it in i386
fpc
2.1.4 with no problem
ann in ARM with fpc 2.1.4. I hav a problem:

I have tried to debug it (gdb):



Hi Jose :-)
I can't help you with your problem, but I am curious...

1)is your ARM system using Linux?
2)for Lua under ARM, are you using dynamic linking or static linking?
For dynamic linking, where did you get your Lua 'DLL' from, and for static
linking, how did you do this?

I would like to get into using Lua under arm-linux myself (already used Lua
and freepacal under Win32 with no problems)
cheers,
Paul.


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