Re: [fpc-pascal] resourcestring and const arrays

2011-06-24 Thread Craig Peterson
On 6/24/2011 4:52 PM, Krzysztof wrote: I had similar problem, I think that this is because consts are "filled" when compiling and there is no way to change them at runtime. Try this trick with pointers: Thanks Krzysztof. That looks like the least invasive approach, so if I can't get them work

Re: [fpc-pascal] resourcestring and const arrays

2011-06-24 Thread Craig Peterson
On 6/24/2011 4:14 PM, Marco van de Voort wrote: No, this is a problem of gettext. It's a problem with FPC's resourcestring implementation, rather than something specific to gettext. I could use SetResourceStrings directly (objpas.pp) and it will have the same issue. For this to work you real

Re: [fpc-pascal] resourcestring and const arrays

2011-06-24 Thread Krzysztof
Hi, I had similar problem, I think that this is because consts are "filled" when compiling and there is no way to change them at runtime. Try this trick with pointers: resourcestring SSunday = "Sunday"; const SWeek: array[0..0] of PString = (@SSunday); begin WriteLn(SWeek[0]^); end; Regards

Re: [fpc-pascal] resourcestring and const arrays

2011-06-24 Thread Marco van de Voort
In our previous episode, Craig Peterson said: > In Delphi I can use resource strings with const arrays and everything > works correctly. For example, if I have a resource DLL with translated > strings and this will work: > > resourcestring >SSunday = "Sunday"; > > const >SWeek: array[0

[fpc-pascal] resourcestring and const arrays

2011-06-24 Thread Craig Peterson
In Delphi I can use resource strings with const arrays and everything works correctly. For example, if I have a resource DLL with translated strings and this will work: resourcestring SSunday = "Sunday"; const SWeek: array[0..0] of string = (SSunday); begin WriteLn(SWeek[0]); end; I'v

Re: [fpc-pascal] Re: Platform independent alternatives

2011-06-24 Thread Burkhard Carstens
Am Freitag, 24. Juni 2011 19:55 schrieb fluisgira...@gmail.com: > Some years ago, I started the port of my project (PascalSCADA) from > Windows to others platforms. I found some issues doing this. I used > all resources that the FPC RTL can offer. > > To thread, I used TThread class. The issues tha

Re: [fpc-pascal] Re: Platform independent alternatives

2011-06-24 Thread fluisgira...@gmail.com
Some years ago, I started the port of my project (PascalSCADA) from Windows to others platforms. I found some issues doing this. I used all resources that the FPC RTL can offer. To thread, I used TThread class. The issues that I found porting this, is that Suspend/Resume don't works on others plat

[fpc-pascal] Efficiency of generated code [x86_64]

2011-06-24 Thread Peter
Hi, I'm puzzled by some of the code generated for x64. Came across this earlier post; http://www.hu.freepascal.org/lists/fpc-pascal/2005-March/008175.html Compiling the simple example with the loop in a function I get much leaner & meaner than the [i386] assembler in the original post, but I

[fpc-pascal] Re: Platform independent alternatives

2011-06-24 Thread leledumbo
Rewrite the threading code with FPC one (i.e. BeginThread - EndThread, or the more beautiful TThread). WaitForSingleObject... I've never used this, perhaps SyncObjs and its critical section handler? CloseHandle: depending on how you open it, close with its correct pair. -- View this message in con

[fpc-pascal] Re: Kudos to the FPC team

2011-06-24 Thread leledumbo
> If that the reason you like FPC, then something is wrong :P Having a FAST compile time is one of the reason I like FPC (or any Pascal compiler in general, most of them also compiles fast). > Try to compile any C++ program using g++, and you'll figure it out > yourself. Yup, 40 minutes bootstra

Re: [fpc-pascal] porting to 64bit

2011-06-24 Thread Mattias Gaertner
On Fri, 24 Jun 2011 16:56:09 +0200 fred f wrote: > Hi, > > What's wrong on this condition to get the code running on 32 and 64bit: > > // Get pointer to varlength data. > function GetVarLengthData(AVarLength:PAnsiChar):PAnsiChar; > begin > Result:=PAnsiChar(AVarLength){$IFDEF > FPC}+SizeO

[fpc-pascal] porting to 64bit

2011-06-24 Thread fred f
Hi, What's wrong on this condition to get the code running on 32 and 64bit: // Get pointer to varlength data. function GetVarLengthData(AVarLength:PAnsiChar):PAnsiChar; begin Result:=PAnsiChar(AVarLength){$IFDEF FPC}+SizeOf(PtrInt){$ELSE}+4{$ENDIF}; end; Thanks in advance. F. _

Re: [fpc-pascal] Kudos to the FPC team

2011-06-24 Thread Felipe Monteiro de Carvalho
On Fri, Jun 24, 2011 at 2:42 PM, ik wrote: > If that the reason you like FPC, then something is wrong :P Clearly you didn't pay enough attention while reading his post and missinterpreted it. -- Felipe Monteiro de Carvalho ___ fpc-pascal maillist -

Re: [fpc-pascal] Kudos to the FPC team

2011-06-24 Thread ik
On Thu, Jun 23, 2011 at 10:09, Graeme Geldenhuys wrote: > Hi, > > I know I'm sometimes hard on some developers. I guess sometimes one has > to sit back and see the big picture too. While reading the following > text from the OpenWatcom newsgroups, it made me realize what a great > compiler and pro

Re: [fpc-pascal] 6 byte real

2011-06-24 Thread Jonas Maebe
On 24 Jun 2011, at 13:08, Alain Van Muylem wrote: I discovered Free Pascal yesterday and I am working at recompilying my old Turbo Pascal (5.0) files. The first problem (but probably not the last) I encountered is the reading of my old data files (files of record of real) because of the 6

[fpc-pascal] 6 byte real

2011-06-24 Thread Alain Van Muylem
Dear all, I discovered Free Pascal yesterday and I am working at recompilying my old Turbo Pascal (5.0) files. The first problem (but probably not the last) I encountered is the reading of my old data files (files of record of real) because of the 6 byte coding for real type in Turbo Pascal ver

RE : [fpc-pascal] Windows test program

2011-06-24 Thread Carsten Bager
That did the trick. Carsten > MSDN states that the first ShowWindow is ignored if a STARTUPINFO is > provided. > > winhello.pp has > ShowWindow(hWindow, CmdShow); > ShowWindow(hWindow, SW_SHOW); > This is the difference with your test program. > > Ludo > > > -Message d'origine- > >

[fpc-pascal] Kudos to the FPC team

2011-06-24 Thread Graeme Geldenhuys
Hi, I know I'm sometimes hard on some developers. I guess sometimes one has to sit back and see the big picture too. While reading the following text from the OpenWatcom newsgroups, it made me realize what a great compiler and programming language we are using. A big thanks to the FPC team for ma

Re: [fpc-pascal] Linking to library on Mac

2011-06-24 Thread Jonas Maebe
On 24 Jun 2011, at 00:06, Darius Blaszyk wrote: I'm porting an app from delphi to lazarus and now I reached a problem when trying to link to the library. The library comes with the .dynlib .a and all header files. I placed them somewhere under my homedir and added the following to my code:

RE : RE : [fpc-pascal] Windows test program

2011-06-24 Thread Ludo Brands
MSDN states that the first ShowWindow is ignored if a STARTUPINFO is provided. winhello.pp has ShowWindow(hWindow, CmdShow); ShowWindow(hWindow, SW_SHOW); This is the difference with your test program. Ludo > -Message d'origine- > De : fpc-pascal-boun...@lists.freepascal.org >