Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-13 Thread Steve Williams
Marc Santhoff wrote: constructor TSingleton.create; begin if not(assigned(s)) then begin inherited; (*... do initializations ...*) s := self; writeln('creating new singleton'); end else begin s

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-09 Thread Steve Williams
>> > I found this by trying to implement a True Singleton in Free Pascal / >> > Delphi. For those that don't know, a Singleton is a Design Pattern >> > that allows only one instance of a class. It seems it is impossible >> > to do in Free Pascal / Delphi. :-( >> >> Try this. >> http://bdn.borlan

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Steve Williams
> I found this by trying to implement a True Singleton in Free Pascal / > Delphi. For those that don't know, a Singleton is a Design Pattern > that allows only one instance of a class. It seems it is impossible > to do in Free Pascal / Delphi. :-( Try this. http://bdn.borland.com/article/22576

Re: [fpc-pascal] Boolean case statement

2006-12-05 Thread Steve Williams
Terry Kemp wrote: Hi All how do you do a case statement on a record of booleans e.g... Type EngModeRec = Record ManualOp: Boolean; LeakTest: Boolean; DrainFlush: Boolean; end; var EngMode: EngModeRec; I want to have... Case True of EngMode.ManualOp: ManualOpRun; EngMode.LeakT

Re: [fpc-pascal] Eye Candy Contest

2006-11-01 Thread Steve Williams
Marc PERTRON wrote: Neil Graham a écrit : I'd recommend saying fullscreen in at least 640x480, 800x600 _OR_ 1024x768. If you are using 3d style rendering then resolution changes are not much of an issue. But if you are going for 2d and bitmap effects, often the best results come from des

Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Steve Williams
Steve Williams wrote: *begin* SubTask(x); *end* /{Sub}/; *var* arr = *array*[0 .. ] *of* Float; *begin* / // Main program/ Sub (arr); *end*. Damn Thunderbird. -- Sly This message and its attachments may contain legally privileged or confidential

Re: [fpc-pascal] Common OpenMP syntax?

2006-07-26 Thread Steve Williams
Michael Van Canneyt wrote: Which is why I think that it's better to have them as local functions, instead of having to introduce a lot of new functions. Local functions are very pascal-ish. C doesn't have it, which is why they can't use it. Let's use the language features to their full extent.

Re: [fpc-pascal] Compiling the compiler

2006-07-24 Thread Steve Williams
Andreas Berger wrote: I downloaded the latest snapshot and wish to recompile the fpc compiler for G032v2. I found an old doc that says to: cd compiler make cycle This obviously will not work since FPC has fpcmake and not make. There is also no makefile called cycle in the compiler folder.

Re: [fpc-pascal] Common OpenMP syntax?

2006-07-21 Thread Steve Williams
Vinzent Höfler wrote: Marco van de Voort wrote: Marco van de Voort wrote: new keywords. Other compilers will give you warnings about illegal compiler directives. Bad assumption, the only one that matters, Delphi errors on unknown compiler directives. So you

Re: [fpc-pascal] Common OpenMP syntax?

2006-07-20 Thread Steve Williams
Marc Weustink wrote: One of the pretexts behind OpenMP is that the code will still compile if OpenMP is not available or disabled on a particular compiler. Mwah... in that case you can still use the same keywords, only it won't be much parallel, since it's executed in one thread. And bee

Re: [fpc-pascal] Common OpenMP syntax?

2006-07-20 Thread Steve Williams
Marc Weustink wrote: Steve Williams wrote: I would suggest something along the lines of the C/C++ implementation, but using the Pascal form of compiler directives. Using some of the documented examples in the v2.5 spec: Example A.1.1: procedure a1(n: Integer; a: PSingleArray; b

Re: [fpc-pascal] Common OpenMP syntax?

2006-07-20 Thread Steve Williams
Florian Klaempfl wrote: I'am currently thinking about implementing OpenMP support in FPC. However, there is currently (to my knowledge) no pascal syntax defined for OpenMp support. Do you think we can find a common syntax to simplify things for users? I've some ideas how it be done, but I want to

Re: [fpc-pascal] Internal error 200203271

2006-07-13 Thread Steve Williams
Marco van de Voort wrote: D:/repo/fpcex/compiler/ppcrossarm.exe -Tlinux -Parm -XParm-linux- -Xc -Xr -XX -C X -Ur -Xs -O2 -n -Fuglib -Fuatk -Fupango -Fugtk+/gdk-pixbuf -Fugtk+/gdk -Fugtk+/ gtk -Fulibglade -Fugtkglext -FuD:/repo/fpcex/rtl/units/arm-linux -FDd:\repo\cros s\arm-linux -FE. -FUunits/ar

Re: [fpc-pascal] Internal error 200203271

2006-06-25 Thread Steve Williams
Steve Williams wrote: Without OPT='-darm', still get the internal error 200203271 on gtkspinbutton.inc(267,4). Trying again with OPT='-dGTK_DISABLE_DEPRECATED', but it will be about an hour before make gets to that point in the build again. It

Re: [fpc-pascal] Internal error 200203271

2006-06-22 Thread Steve Williams
Steve Williams wrote: Marco van de Voort wrote: Try make cycle instead rest the same. If you want to do it using make all that is all possible, but then you probably also need a OPT='-darm' There is no 'make cycle' target at the root of the fpc source tree.

Re: [fpc-pascal] Internal error 200203271

2006-06-22 Thread Steve Williams
Marco van de Voort wrote: Was there a solution for this? I've just come across this error now while trying to build fpc-svn for arm-linux as well. I'm using the following command line on Win32 from the root of the fpc source tree. make all OS_TARGET=linux CPU_TARGET=arm CROSSBINDIR=c:\devki

Re: [fpc-pascal] Internal error 200203271

2006-06-22 Thread Steve Williams
Steve Williams wrote: Koenraad Lelong wrote: Hi, When I ty to compile fpc-svn for arm-linux it stops with Internal error 200203271 when buildgtk2.pp/gtkspinbutton.inc is compiled. Was there a solution for this? I've just come across this error now while trying to build fp

Re: [fpc-pascal] Internal error 200203271

2006-06-21 Thread Steve Williams
Koenraad Lelong wrote: Hi, When I ty to compile fpc-svn for arm-linux it stops with Internal error 200203271 when buildgtk2.pp/gtkspinbutton.inc is compiled. Was there a solution for this? I've just come across this error now while trying to build fpc-svn for arm-linux as well. I'm using

Re: [fpc-pascal] Bit manipulation

2006-02-21 Thread Steve Williams
Florian Klaempfl wrote: Geno Roupsky wrote: it is as simple as this: function isset(value: dword; bit: byte): boolean; begin result := value and (1 shl pred(bit)) <> 0; end; Adding inline doesn't hurt speedwise ;) It is also assuming that bit counting starts at 1. I'd remove t

Re: [fpc-pascal] Pointers

2005-07-27 Thread Steve Williams
Daniel Franzini wrote: no, i didn't...but it worked and the program did compiled...now, it shows the following message Runtime error 216 at $00401034 $00401034 but i think that this is some windows (2000) issue not FPC one...so i ask: is there any way of running these simple examples or i wil

Re: [fpc-pascal] Pointers

2005-07-27 Thread Steve Williams
Daniel Franzini wrote: BEGIN InitGraph; Screen := MEM[$A000]; { Set up the screen buffer pointer } <---here is the error WHILE NOT KeyPressed DO SetPixel( RANDOM(320), { Random X (Range 0-319) } RANDOM(200), { Random Y (Range 0-199) } RAN

[fpc-pascal] make install error

2005-07-06 Thread Steve Williams
I got the latest FPC source using Subversion on Win32. Running make build in the root directory worked fine. Running make install fails because cp.exe does not ignore hidden directories, therefore it tries to delete the Subversion .svn directories, which is bad. c:/fpc/2.0.0/bin/i386-win32/

Re: [fpc-pascal] DLL Linking

2005-06-21 Thread Steve Williams
L505 wrote: | Note that this is not allowed on Windows XP if your application is in | the Program Files directory. Applications are not allowed or should not | write to their application directory due to security restrictions. | | -- | Sly Really? So MS encourages you to write everything to the

Re: [fpc-pascal] DLL Linking

2005-06-21 Thread Steve Williams
Pianoman wrote: Hi everyone, I have one question: Is it possible to link a Routine from DLL to my exe directly. Point is that I don't want distribute other files with the program and it would be nice to have only one executable nothing more. I use Bass audio library for playback and I

Re: [fpc-pascal] Customizing tply

2004-12-12 Thread Steve Williams
I cannot remember where I found that code. From the unit header, it was written by a Peter Below (a member of TeamB) and posted on UseNet a while back. So I guess it is up to you to include it or not, or if you want to try to track down Peter Below and ask his permission. Sly Michael Van Cann

Re: [fpc-pascal] Customizing tply

2004-12-10 Thread Steve Williams
> Actually, do you think you could extend this and > create a bridge between streams and text files ? > > I mean 2 calls like > > First: Text->Stream. > > Var > f : Text; > S : TSTream; > > begin > AssignTextStream(F,S); > Rewrite(F); > Writeln(F,'Something'); // Writes actually to stream

Re: [fpc-pascal] Customizing tply

2004-12-09 Thread Steve Williams
When I started to modify lexlib to work with streams instead of just files (I have to parse stuff that could be on memory) I dicovered some new issues: * How can I use standard input/ouput with streams? * Is there an easy way to do a ReadLn (or similar) with streams? The idea is instead of rewritin

[fpc-pascal] Can't create unique type from this type

2004-11-25 Thread Steve Williams
// // D3DXHANDLE: // --- // Handle values used to efficiently reference shader and effect parameters. // Strings can be used as handles. However, handles are not always strings. //--

Re: [fpc-pascal]Delphi/FPC cross-compile

2004-08-04 Thread Steve Williams
Delphi 7 comes in the box with Delphi 8 so you won't have to exchange it. That was Borland's way of saying sorry for not having Win32 support in Delphi 8. You should be able to make a class that compiles in all three (D7, D8, FPC). Just stick to the basics and it should all be fine. Sly > I've b

Re: [fpc-pascal]Best PASCAL for games

2004-06-28 Thread Steve Williams
> > > The Delphi compiler does not even support MMX, 3Dnow or any other enhanced > > > instruction sets (except through the built-in assembler). Does FPC's code > > > generator support the use of MMX, 3Dnow or other enhanced instruction sets > > > without us having to delve into assembly? > > > >

Re: [fpc-pascal]Best PASCAL for games

2004-06-27 Thread Steve Williams
> Delphi is still better performing, but there is not much chance that Delphi > will see any improvement in this field. The Delphi compiler does not even support MMX, 3Dnow or any other enhanced instruction sets (except through the built-in assembler). Does FPC's code generator support the use of

Re: [fpc-pascal]how to convert a string to pppchar

2004-03-04 Thread Steve Williams
To convert a PPPChar to a String, you should be able to do MyString := String(MyPPPChar^^); To convert from String to PPPChar, you will need some intermediate variables MyPChar := PChar(MyString); MyPPChar := @MyPChar; MyPPPChar := @MyPPChar; Sly - Original Message - From: "Gon

Re: [fpc-pascal]Suppressing the console window in Win32

2004-03-04 Thread Steve Williams
> But in general FPC is written more with portability in mind, and this > increases the library layer slightly. Also Delphi might have optimizations > on while FPC needs params to enabled them. (I assume you already use -XXs to compile the fpc > binary, you could also use -OG3p3 or so) I was using

Re: [fpc-pascal]Suppressing the console window in Win32

2004-03-04 Thread Steve Williams
> > The executable also got 23KB larger just from being compiled with 1.9.2, > > ie. > > from 82KB to 105KB. > > That is always the case... more functionality means a bigger size... for > example threadvar for multithreading support takes more space. Also > register calling takes more space, but it

Re: [fpc-pascal]Suppressing the console window in Win32

2004-03-03 Thread Steve Williams
> > Thanks. I've never had to use that in Delphi since it defaults to GUI if > > there is no $APPTYPE directive. Would it make sense for FPC to default to > > GUI if compiled in Delphi compatibility mode? I'm new to FPC so I don't > > know if that has been discussed before. > > That is a Win32 (

Re: [fpc-pascal]Suppressing the console window in Win32

2004-03-03 Thread Steve Williams
Thanks. I've never had to use that in Delphi since it defaults to GUI if there is no $APPTYPE directive. Would it make sense for FPC to default to GUI if compiled in Delphi compatibility mode? I'm new to FPC so I don't know if that has been discussed before. Incidentally, can there be a warning

[fpc-pascal]Suppressing the console window in Win32

2004-03-03 Thread Steve Williams
I'm building a graphical application using GameVision (http://www.jarroddavis.com/). The application compiled in FPC opens a console window whenever the application is executed. The application compiled in Delphi does not open a console window. How do I not have the console window automatically

Re: [fpc-pascal]Default parameters support?

2004-03-03 Thread Steve Williams
> >I cannot try FPC 1.9.2 since it is only offered through FTP and our work > >firewall blocks all FTP access. > > you could always try compiling the CVS ... :) The CVS port is blocked as well. :) If it doesn't work over port 80, it's a no-go. The network admins have locked down the firewall pr

[fpc-pascal]Default parameters support?

2004-03-03 Thread Steve Williams
Does FPC support default parameters in procedures/functions? I have FPC 1.0.10 and I cannot get it to compile Delphi code that has default parameters. I'm using the -Sd option, but I cannot find any mention of default parameters in the documentation. I cannot try FPC 1.9.2 since it is only offer