Re: [fpc-pascal] Developing a mini ERP / web based development

2019-07-03 Thread silvioprog
Hi Darius. On Thu, Jun 27, 2019 at 1:10 PM Darius Blaszyk wrote: > Hi all, > > I have been asked to write a limited functionality / mini ERP type of > software for an NGO that is setting up a hospital. I'm doing this in my own > time and free of charge. The compiler and IDE of choice are of

Re: [fpc-pascal] Feature Announcement: Support for multiple active helpers per type

2019-05-10 Thread silvioprog
On Fri, May 10, 2019 at 4:57 PM Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Hello together! > > We are pleased to announce that Free Pascal now supports the usage of > multiple active helper types per extended type. This feature has been > developed by Ryan Joseph, so

Re: [fpc-pascal] [OT] Mantis offline

2019-05-10 Thread silvioprog
Thanks for checking it dudes.  (maybe DNS issues) -- Silvio Clécio ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] [OT] Mantis offline

2019-05-10 Thread silvioprog
Hello. Could anyone check if Mantis is online? I've tried to access http://bugs.freepascal.org now (Fri 10 May 2019 11:30:37 AM BRT), but got "This site can’t be reached". Some hours ago it was OK. -- Silvio Clécio ___ fpc-pascal maillist -

Re: [fpc-pascal] Translating c records

2019-04-24 Thread silvioprog
On Wed, Apr 24, 2019 at 5:41 PM Rainer Stratmann < rainerstratm...@t-online.de> wrote: > struct sockaddr_ll { > unsigned short sll_family; > unsigned short sll_protocol; > intsll_ifindex; > unsigned short sll_hatype; > unsigned char sll_pkttype; >

Re: [fpc-pascal] Registers used by calling conventions

2019-03-08 Thread silvioprog
On Fri, Mar 8, 2019 at 6:34 PM Anthony Walter wrote: > What registers are used by default calling convention and where can I find > more information about Free Pascal asm details? > For linux64 the default C.C is sysv x64. Some links with info you are looking for: 1.

Re: [fpc-pascal] PMake a new build tool

2019-02-27 Thread silvioprog
On Wed, Feb 27, 2019 at 7:13 PM Darius Blaszyk wrote: > Hi, > Hi Darius. > I would like to inform everyone interested here that I just made a beta > release (v0.0.2) of a build tool I have been developing for some of my > projects which is called PMake. > PMake is inspired on FPMake and

Re: [fpc-pascal] How do I take the float type of a field from a record?

2018-12-13 Thread silvioprog
Oh, please ignore and sorry for noise. I found the solution as soon as I sent the e-mail. -.- var F: PManagedField; R: TTestRecord; T, T2: PTypeData; I: Integer; begin R := Default(TTestRecord); T := GetTypeData(TypeInfo(R)); F := PManagedField(PByte(@T^.TotalFieldCount) + 4); for

Re: [fpc-pascal] How do I take the float type of a field from a record?

2018-12-13 Thread silvioprog
Oops... On Fri, Dec 14, 2018 at 3:35 AM silvioprog wrote: [...] > WriteLn(F^.TypeRef^.Kind, ':tk', F^.TypeRef^.Name); > I meant "':*ft*', F^.TypeRef^.Name);". Anyway, still a very ugly workaround. -- Silvio Clécio ___ fpc-pascal

[fpc-pascal] How do I take the float type of a field from a record?

2018-12-13 Thread silvioprog
Hi. Please consider the following code: uses TypInfo; type TTestRecord = record Member1: LongInt; Member2: Double; Member3: string; Member4: Extended; end; var F: PManagedField; R: TTestRecord; T, T2: PTypeData; I: Integer; begin R := Default(TTestRecord); T :=

Re: [fpc-pascal] Ho to convert a special format of datetime?

2018-12-13 Thread silvioprog
On Thu, Dec 13, 2018 at 5:07 PM luciano de souza wrote: > Hello all, > I'd like to convert this date "2017-01-11T17:47:22.2912317-02:00" to > TDatetime. > uses restbase; var d: TDateTime; begin d := RFC3339ToDateTime('2017-01-11T17:47:22.2912317-02:00'); WriteLn(DateTimeToStr(d)); //

Re: [fpc-pascal] FPC-based http/s server

2018-12-11 Thread silvioprog
Hello dude, On Mon, Dec 10, 2018 at 8:09 AM Michael Van Canneyt wrote: [...] > It does not support https yet, but this is planned for the near future. > (I expect to work on it between this Christmas and new year) Please consider support for TLS 1.3 (all new

Re: [fpc-pascal] Dynamic array bug

2018-11-07 Thread silvioprog
On Thu, Nov 8, 2018 at 1:13 AM silvioprog wrote: > On Wed, Nov 7, 2018 at 11:06 PM Ryan Joseph > wrote: > >> I read the old thread and we need to add {$modeswitch arrayoperators} to >> make it work. a += [4] does work now. >> >> Also I found the thread where Sve

Re: [fpc-pascal] Dynamic array bug

2018-11-07 Thread silvioprog
On Wed, Nov 7, 2018 at 11:06 PM Ryan Joseph wrote: > I read the old thread and we need to add {$modeswitch arrayoperators} to > make it work. a += [4] does work now. > > Also I found the thread where Sven said he fixed the "Incompatible types: > got "Set Of Byte” bug in r39554 ( >

Re: [fpc-pascal] Dynamic array bug

2018-11-07 Thread silvioprog
On Wed, Nov 7, 2018 at 12:09 PM Ryan Joseph wrote: > > > On Nov 7, 2018, at 9:31 PM, silvioprog wrote: > > > > Yes, it works. But only on Delphi: > > > > That’s too bad, I don’t use Delphi mode. Should be in Objfpc mode also > right? Oops... I mea

Re: [fpc-pascal] Dynamic array bug

2018-11-07 Thread silvioprog
On Wed, Nov 7, 2018 at 3:39 AM Ryan Joseph wrote: > Good to know. I reported this before and Sven said it was fixed in an > update (after another user had submitted the original patch). > > Are you able to get a := a + [4]; to work? I’m looking Sven’s old message > titled "Feature announcement:

Re: [fpc-pascal] Dynamic array bug

2018-11-06 Thread silvioprog
Hi Ryan. On Wed, Nov 7, 2018 at 1:13 AM Ryan Joseph wrote: > I finally built the trunk today (version 3.3.1) to try new dynamic array > features and a bug fix Sven did a while ago but I’m still getting errors. > > Did I get the wrong version or something? I thought these things were > working

Re: [fpc-pascal] Listing the type (even as string) of the parameters and the return of a function

2018-11-03 Thread silvioprog
On Thu, Nov 1, 2018 at 2:11 AM silvioprog wrote: [...] > I took a look at some System V ABI manuals to start a draft based on them, > adapting the assembly to the InvokeKernelWin64() signature idea. The > draft works fine for six or more arguments and returns the function value > too

Re: [fpc-pascal] Listing the type (even as string) of the parameters and the return of a function

2018-10-31 Thread silvioprog
On Tue, Oct 9, 2018 at 5:56 PM Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > The main challenge is to find the time and motivation to implement the > whole extended RTTI shenanigans. Though I hope that after my birthday this > weekend I'll find the time to work on this as

Re: [fpc-pascal] Listing the type (even as string) of the parameters and the return of a function

2018-10-09 Thread silvioprog
On Mon, Oct 8, 2018 at 6:21 AM Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Short answer: No. > > Long answer: No. The extended RTTI required for that is currently only > generated for interfaces with $M+ set. > > Regards, > Sven > Hi Sven, thanks for replying. What are

[fpc-pascal] Listing the type (even as string) of the parameters and the return of a function

2018-10-08 Thread silvioprog
Hi. First, thanks for the great work in the invoke.inc for win64! ☺ So, consider the following example: uses RTTI; type TFoo = class public function Bar(const A: string; B: Integer): string; end; function TFoo.Bar(const A: string; B: Integer): string; begin end; var m:

[fpc-pascal] [FEATURE REQUEST] SysUtils.TMarshaller type

2017-12-15 Thread silvioprog
Hi. The TMarshaller record is a high-level aid for marshalling arguments to and from OS / native API or interfacing with external libraries APIs. This feature request was issued as #0032835 . If this feature can be useful for you too, please help at this link:

Re: [fpc-pascal] Call function in shared library from multiple threads

2017-03-31 Thread silvioprog
On Fri, Mar 31, 2017 at 1:15 PM, Henry Vermaak wrote: > On Fri, Mar 31, 2017 at 08:42:24AM -0700, fredvs wrote: > > > Z:\home\fred\uos\examples\uos.pas(7438,29) Warning: (4046) > Constructing a > > > class "TThread" with abstract method "Execute" > > > > Huh, is it Is it

Re: [fpc-pascal] Hash List

2017-03-17 Thread silvioprog
You're welcome. :-) Notice the first link I've passed is exactly showing the TDictionary, recently added to FPC: https://github.com/graemeg/freepascal/blob/master/packages/rtl-generics/src/inc/generics.dictionariesh.inc#L534 . You should take a look at that. :-) On Sat, Mar 18, 2017 at 12:54

Re: [fpc-pascal] Hash List

2017-03-17 Thread silvioprog
On Fri, Mar 17, 2017 at 8:29 PM, African Wild Dog wrote: > Hello, > > Ia there any hash list implementation in free Pascal? > Hello, Please take a look at these examples: https://github.com/graemeg/freepascal/tree/master/packages/rtl-generics/examples and in this

Re: [fpc-pascal] Feature announcement: Interface RTTI

2017-01-28 Thread silvioprog
On Sat, Jan 28, 2017 at 9:29 AM, Sven Barth wrote: > Hello together! > > I'm pleased to finally announce the addition of Interface RTTI to Free > Pascal. > > Interface RTTI essentially provides a list of all methods available in > an interface if it's declared is

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-26 Thread silvioprog
On Thu, Jan 26, 2017 at 11:52 PM, fredvs wrote: > Hello Silvio: > > Yes, we are on the good way. > Awesome. :-) > Following your advice, here from https-url-opus the result of : > > var > BufferURL: tbytes; > > setlength(BufferURL, PipeBufferSize); >

Re: [fpc-pascal] Pipe vs Memory buffer.

2017-01-26 Thread silvioprog
On Thu, Jan 26, 2017 at 8:20 PM, fredvs wrote: > Hello. > > Some news from the front: > > var > BufferURL : array of float; > > . > > PipeBufferSize := $4000 ; > > CreatePipeHandles(InHandle, OutHandle, PipeBufferSize); > > InPipe := TInputPipeStream.Create(InHandle); >

Re: [fpc-pascal] Array as result in function.

2017-01-21 Thread silvioprog
On Sat, Jan 21, 2017 at 11:11 AM, fredvs wrote: > Hello everybody. > > Do you agree with this ? : > > type > TOggOpusFile = ^OggOpusFile; > OggOpusFile = record > end; > > op_read: function(OpusFile: TOggOpusFile; pcm : pcfloat; SampleCount: > Integer; li: pointer):

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread silvioprog
On Fri, Jan 20, 2017 at 9:06 PM, silvioprog <silviop...@gmail.com> wrote: [...] > `_pcm` on original code is an `int16` buffer... consider to using `cint16`: > Damn Gmail's Ctrl+Enter. -.-' I meant: "`_pcm` on original code is an `int16` buffer... consider to using `*pcint1

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread silvioprog
On Fri, Jan 20, 2017 at 7:36 PM, fredvs wrote: > Re-hello. > > Ok, thanks Silvio, I will take this one from your advice, it works like > charm: > > type > TOggOpusFile = THandle; > Hm... you should keep the same C data types. :-) I took a look at `OggOpusFile` type, it is a

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread silvioprog
On Fri, Jan 20, 2017 at 7:11 PM, fredvs wrote: > Hello Silvio. > > Wow, thanks, I will study it deep. > > By the way, the Opus Pascal wrappers are working. > You may listen, seek, saving to file, apply dsp,.. to Opus files. > You may try SimplePlayer demo in uos (all libraries

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread silvioprog
On Fri, Jan 20, 2017 at 5:14 PM, silvioprog <silviop...@gmail.com> wrote: [...] > > It seems that function just increment the address of a (float) buffer, so: > I meant "It seems that function just fill a (float) buffer". ^^' -- Silvio Clécio __

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread silvioprog
On Fri, Jan 20, 2017 at 3:45 PM, fredvs wrote: > > Here, for example from OpusFile.h => > > OP_WARN_UNUSED_RESULT int op_read_float(OggOpusFile *_of, > float *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1); > > Translated in fpc with: > > op_read: function(OpusFile:

Re: [fpc-pascal] Array as result in function.

2017-01-20 Thread silvioprog
On Fri, Jan 20, 2017 at 1:12 PM, fredvs wrote: [...] Please look at Sven's warn regarding Pascal arrays mixed with C arrays. Could you show us the original C function? -- Silvio Clécio ___ fpc-pascal maillist -

Re: [fpc-pascal] Array as result in function.

2017-01-19 Thread silvioprog
On Thu, Jan 19, 2017 at 6:50 PM, fredvs wrote: > Hello. > > With this code, the result of the function does not have same format as the > array input: > > Why ? > > type > TArFloat = array of cfloat; > > function array_in_out(arrayin: TArFloat): TArFloat; > begin > result :=

Re: [fpc-pascal] Missing messages

2016-11-03 Thread silvioprog
On Thu, Nov 3, 2016 at 7:01 PM, Bo Berglund <bo.bergl...@gmail.com> wrote: > On Tue, 1 Nov 2016 23:44:09 -0300, silvioprog > <silviop...@gmail.com> wrote: > > >-begin off- > >Oh my, I remember a big problem I had in my email months ago... trying to > >reduc

Re: [fpc-pascal] Missing messages

2016-11-01 Thread silvioprog
On Sun, Oct 30, 2016 at 12:43 PM, José Mejuto wrote: > > Hello, > > Today I had detected that some emails does not reach me in this mailing list, in fact the last ones from "leledumbo" about JSON parsing, but Graeme and Michael ones arrive successfully I've had the same

Re: [fpc-pascal] Does MACRO work in this case?

2016-09-18 Thread silvioprog
On Thu, Sep 8, 2016 at 6:27 PM, David Emerson <dle...@angelbase.com> wrote: > On 09/08/2016 10:08 AM, silvioprog wrote: > >> Hello, >> >> Looking an alternative to solve the problem I've talked at this topic >> <http://lists.freepascal.org/piper

[fpc-pascal] Does MACRO work in this case?

2016-09-08 Thread silvioprog
Hello, Looking an alternative to solve the problem I've talked at this topic , I've tried to solve it declaring a macro named "TIStringComparer.Ordinal": === begin code === {$IFDEF FPC} function

Re: [fpc-pascal] Could someone explain me which the correct triggering of the BeforeDestruction method?

2016-09-06 Thread silvioprog
On Tue, Sep 6, 2016 at 5:10 PM, silvioprog <silviop...@gmail.com> wrote: > On Tue, Sep 6, 2016 at 5:18 AM, Maciej Izak <hnb.c...@gmail.com> wrote: > >> >> 2016-09-05 17:56 GMT+02:00 silvioprog <silviop...@gmail.com>: >> >>> FPC triggers 132, Del

Re: [fpc-pascal] Could someone explain me which the correct triggering of the BeforeDestruction method?

2016-09-06 Thread silvioprog
On Tue, Sep 6, 2016 at 5:18 AM, Maciej Izak <hnb.c...@gmail.com> wrote: > > 2016-09-05 17:56 GMT+02:00 silvioprog <silviop...@gmail.com>: > >> FPC triggers 132, Delphi 1342. :-/ > > > Please report on bug tracker. IMO in presented context - definitely bug.

Re: [fpc-pascal] Could someone explain me which the correct triggering of the BeforeDestruction method?

2016-09-05 Thread silvioprog
On Sun, Sep 4, 2016 at 5:23 PM, Luiz Americo Pereira Camara < luizameri...@gmail.com> wrote: > Seems that Delphi considers that the object is already created at the time > AfterConstruction is called, so it understands that when it gets into > AfterConstruction is sucessfully created.

Re: [fpc-pascal] GZip - Stream decompress only in memory

2016-09-05 Thread silvioprog
On Mon, Sep 5, 2016 at 2:50 AM, Michael Van Canneyt wrote: [...] > As far as I know these things can be done with all the FPC classes as well > ? > The implementation in base64 unit can perfectly do everything in memory. > And ZUncompressStream can be done with

Re: [fpc-pascal] GZip - Stream decompress only in memory

2016-09-04 Thread silvioprog
On Sep 4, 2016 5:29 PM, "Marcos Douglas" wrote: > > Ok, it works now. Great! > For the records, I've used the lib http://www.gocher.me/GZIP (Silvio's > tip) and the function Base64Decode from WST framework > http://svn.code.sf.net/p/lazarus-ccr/svn/wst/trunk/ > > For some

[fpc-pascal] Could someone explain me which the correct triggering of the BeforeDestruction method?

2016-09-03 Thread silvioprog
Hello, My question at title seems stupid, but the reason why I've get this doubt is just because it get different results between Free Pascal and Delphi in the following example: === begin code === program project1; {$IFDEF FPC} {$MODE DELPHI} {$ENDIF} {$IFDEF MSWINDOWS} {$APPTYPE CONSOLE}

Re: [fpc-pascal] Doubt related to the issue #30498

2016-08-23 Thread silvioprog
On Tue, Aug 23, 2016 at 2:57 AM, Sven Barth wrote: [...] > See here: http://bugs.freepascal.org/view.php?id=30503 > > Regards, > Sven > Thank you! :-) I did: ... {$IFDEF FPC} var VPairs: TArray>; {$ENDIF} begin ... {$IFDEF FPC} // issues

Re: [fpc-pascal] Free Delphi 10.1 Berlin Starter Edition

2016-08-23 Thread silvioprog
On Tue, Aug 23, 2016 at 6:43 AM, Maciej Izak wrote: > > Hi, > > finally we have simple way to test new syntax to improve FPC quality / $MODE DELPHI without spending $ on Delphi :) > > Probably limited time offer: > >

[fpc-pascal] Doubt related to the issue #30498

2016-08-22 Thread silvioprog
Hello, A possible inline way (without declaring specialized local variables) to compile the attached test at the issue #30498 is: ... procedure Test(const AItems: TArray); begin end; begin // Test(['foo', 'bar']); issue #30498

Re: [fpc-pascal] rtl-generics: TIStringComparer.Ordinal -> Access violation

2016-08-17 Thread silvioprog
On Wed, Aug 17, 2016 at 12:20 PM, Maciej Izak <hnb.c...@gmail.com> wrote: > > 2016-08-17 16:05 GMT+02:00 silvioprog <silviop...@gmail.com>: > >> I need to find the values using case-insensitive keys (I'm using it in a >> class registry of my app), so unfortunate

Re: [fpc-pascal] rtl-generics: TIStringComparer.Ordinal -> Access violation

2016-08-17 Thread silvioprog
On Wed, Aug 17, 2016 at 3:04 AM, Maciej Izak <hnb.c...@gmail.com> wrote: > > 2016-08-17 7:05 GMT+02:00 silvioprog <silviop...@gmail.com>: > >> Just try it: >> > > related to > > http://bugs.freepascal.org/view.php?id=28911 > > Sven comment:

[fpc-pascal] rtl-generics: TIStringComparer.Ordinal -> Access violation

2016-08-16 Thread silvioprog
Hello, Just try it: var list: TDictionary; begin list := TDictionary.Create(TIStringComparer.Ordinal); Error: An unhandled exception occurred at $0043A2F8: EAccessViolation: Access violation $0043A2F8 $004084B3 DOADD, line 277

Re: [fpc-pascal] Does FPC supports the `delayed` directive?

2016-08-13 Thread silvioprog
On Sat, Aug 13, 2016 at 2:31 PM, Sven Barth <pascaldra...@googlemail.com> wrote: > On 13.08.2016 18:38, silvioprog wrote: > > My test ({$mode delphi}; FPC from trunk): > > > > procedure foo(); cdecl; external 'foo' name 'foo' delayed; > > > > The compi

Re: [fpc-pascal] Does FPC supports the `delayed` directive?

2016-08-13 Thread silvioprog
Oops, I meant: "Does FPC support the `delayed` directive?". ^^' -- Silvio Clécio ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Does FPC supports the `delayed` directive?

2016-08-13 Thread silvioprog
Hello, Firstly, a quot from Dr.Bob's site: The basic idea of the solution is the fact that the DLL will not be loaded > right away (which is the case for implicit linking), but only when needed. > So potentially “delayed”, and hence the name “delay loading”. The main idea is the similar to the

Re: [fpc-pascal] rtl-generics: Suggestion and question

2016-08-12 Thread silvioprog
On Fri, Aug 12, 2016 at 5:03 PM, silvioprog <silviop...@gmail.com> wrote: > On Fri, Aug 12, 2016 at 3:51 PM, Maciej Izak <hnb.c...@gmail.com> wrote: > [...] > >> Using WARN OFF for whole module is rather bad, but might be (temporary) >> the only solution. IIRC FP

Re: [fpc-pascal] rtl-generics: Suggestion and question

2016-08-12 Thread silvioprog
On Fri, Aug 12, 2016 at 3:51 PM, Maciej Izak wrote: [...] > Using WARN OFF for whole module is rather bad, but might be (temporary) > the only solution. IIRC FPC has many bugs for switching off warnings / > hints especially for generics. Compiler likes to report

[fpc-pascal] rtl-generics: Suggestion and question

2016-08-12 Thread silvioprog
Hello, I've spend some time adapting my beta project to use the new rtl-generics classes, however, I have some issues regarding to TDictionary class. Let's go to a test using the example below: === begin code === var hash: TDictionary; begin hash := TDictionary

Re: [fpc-pascal] Are the TEncoding singletons thread-safe?

2016-08-11 Thread silvioprog
On Thu, Aug 11, 2016 at 3:33 PM, Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > On 11/08/16 20:25, silvioprog wrote: > >> But now I have a question: many Free Pascal programmers are Delphi >> programmers too, having code that can be compiled in both compilers, an

Re: [fpc-pascal] Are the TEncoding singletons thread-safe?

2016-08-11 Thread silvioprog
On Thu, Aug 11, 2016 at 12:54 PM, Jonas Maebe wrote: > > Yes, but we cannot integrate any code that has been written by you based > on the Delphi code you looked at, because the license does not allow you to > rewrite that code into something that is licensed under the

Re: [fpc-pascal] Are the TEncoding singletons thread-safe?

2016-08-11 Thread silvioprog
On Thu, Aug 11, 2016 at 11:07 AM, Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > On 11/08/16 15:38, silvioprog wrote: > >> No, I didn't. Sorry if I made some misunderstood, I look at Delphi >> source just for check why it doesn't raise memory leak, I'm fully >> a

Re: [fpc-pascal] Are the TEncoding singletons thread-safe?

2016-08-11 Thread silvioprog
On Thu, Aug 11, 2016 at 10:21 AM, Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > On 11/08/16 15:17, silvioprog wrote: > >> I've opened a new issue sending a possible >> patch: http://bugs.freepascal.org/view.php?id=30462 >> <http://bugs.freepascal.org/view.p

Re: [fpc-pascal] Are the TEncoding singletons thread-safe?

2016-08-11 Thread silvioprog
On Thu, Aug 11, 2016 at 5:02 AM, Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > Bart wrote: > > On 8/11/16, silvioprog <silviop...@gmail.com> wrote: > > > >> ... so I decided to research how Delphi > >> implements it, because I can't get any error on

[fpc-pascal] Are the TEncoding singletons thread-safe?

2016-08-10 Thread silvioprog
Hello, I've used the useful singletons available in the TEncoding class, and I don't get any problem with them, unless using threads. I have an application that does many tests in a code compilable in FPC and Delphi, however, the FPC's tests raise memory leak at the finalization tests. The

Re: [fpc-pascal] TArray.Sort(array) returns 'Error: Identifier not found "TArray" '

2016-08-07 Thread silvioprog
On Aug 4, 2016 3:08 AM, "Maciej Izak" <hnb.c...@gmail.com> wrote: > > 2016-08-04 3:16 GMT+02:00 silvioprog <silviop...@gmail.com>: >> >> So, is this the best way to solve this problem? > > TArrayHelper is marked as experimental structure and exist

Re: [fpc-pascal] TArray.Sort(array) returns 'Error: Identifier not found "TArray" '

2016-08-07 Thread silvioprog
On Thu, Aug 4, 2016 at 3:07 AM, Sven Barth <pascaldra...@googlemail.com> wrote: > > Am 04.08.2016 03:17 schrieb "silvioprog" <silviop...@gmail.com>: > > So, is this the best way to solve this problem? > > For now, yes. Maciej still needs to adjust th

[fpc-pascal] TArray.Sort(array) returns 'Error: Identifier not found "TArray" '

2016-08-03 Thread silvioprog
Hello, First, thanks a lot for the rtl-generics units, this really was a great contribution to the Free Pascal community! So, sometimes, I need to sort the values of a specialized key/value list, but I can't compile the adapted Delphi XE code below (I'm using MODE DELPHI): === begin code ===

Re: [fpc-pascal] FCL maskutils incompatible with Delphi

2016-04-19 Thread silvioprog
On Tue, Apr 19, 2016 at 4:14 PM, Bart <bartjun...@gmail.com> wrote: > On 4/19/16, silvioprog <silviop...@gmail.com> wrote: > > > The expected value: H1H357-K808K-44616-YK8720. > > > > The returned value: H1H357-K808K-44616-**. > > > &g

[fpc-pascal] STATIC can only be used on non-virtual class methods

2016-04-15 Thread silvioprog
Hello, Consider the following code: === test begin === {$MODE DELPHI} TStaticVirtualTest = class sealed(TObject) public class procedure Test; virtual; static; end; class procedure TStaticVirtualTest.Test; begin end; === test end === You can compile it in FPC (trunk), but, when you

[fpc-pascal] Any chance to add the TStringBuilder to FCL?

2016-04-14 Thread silvioprog
Hello, Is there any chance to add a class like Delphi's TStringBuilder to FCL? It would be very useful to port Delphi code libraries to Free Pascal. Thank you! -- Silvio Clécio

[fpc-pascal] TStringHelper with SysUtils functions

2016-04-12 Thread silvioprog
Hello, How do I use the TStringHelper with SysUtils functions? When I've tried to compile this code: === code === program Project1; {$mode objfpc}{$H+} uses SysUtils; begin WriteLn(ExtractFileExt(ParamStr(0)).Substring(1)); ReadLn; end. === /code === I've got: project1.lpr(9,39)

Re: [fpc-pascal] Class constructor called unconditionally

2016-03-31 Thread silvioprog
On Thu, Mar 31, 2016 at 11:28 AM, Michael Van Canneyt < mich...@freepascal.org> wrote: [...] > I suspect the problem is not in the mode, but in detecting whether a class > is used > or not in a program. It becomes very complicated when you use e.g. > run-time packages. > Hm... so FPC class

Re: [fpc-pascal] Class constructor called unconditionally

2016-03-31 Thread silvioprog
On Thu, Mar 31, 2016 at 10:58 AM, Vojtěch Čihák wrote: > IMO compilers should be dogmatic otherwise one cannot rely on them. This > looks to me like advocating wrong optimization. > > > > Blaazen > Thanks for reply Vojtěch, but are you referring to Delphi or FPC

Re: [fpc-pascal] Class constructor called unconditionally

2016-03-31 Thread silvioprog
On Thu, Mar 31, 2016 at 10:49 AM, Sven Barth <pascaldra...@googlemail.com> wrote: > Am 31.03.2016 15:33 schrieb "silvioprog" <silviop...@gmail.com>: > > After read this explanations, is there some compiler option to make FPC > with this same Delph

[fpc-pascal] Class constructor called unconditionally

2016-03-31 Thread silvioprog
Hello, First, take a look at this small project: === code === program Project1; {$IFDEF FPC} {$MODE DELPHI} {$ENDIF} {$IFDEF MSWINDOWS} {$APPTYPE CONSOLE} {$ENDIF} type TFoo = class public class constructor Create; end; class constructor TFoo.Create; begin

Re: [fpc-pascal] Codepage + class helper raises "Error identifier idents no member ..."

2016-03-19 Thread silvioprog
On Wed, Mar 16, 2016 at 8:53 PM, Bart wrote: [...] > @Silvio: Sven fixed it in trunk. > Can you test and report back in > http://bugs.freepascal.org/view.php?id=29745 > (I don't have fpc trunk) Now it is working like a charm. Thank you Bart and Sven! :-D (you can close

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-18 Thread silvioprog
On Tue, Mar 15, 2016 at 4:38 AM, Michael Van Canneyt wrote: [...] > I have (hopefully) fixed this. rev. 33255. The crash was fixed after upgrade my FPC. But it still generating five empty pages even applying the Jesus Reyes' patch. :-/ -- Silvio Clécio

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-14 Thread silvioprog
On Fri, Mar 11, 2016 at 4:35 AM, Michael Van Canneyt <mich...@freepascal.org > wrote: > > On Thu, 10 Mar 2016, silvioprog wrote: > > On Sat, Mar 5, 2016 at 3:38 PM, silvioprog <silviop...@gmail.com> wrote: >> [...] >> >> ... however, when

Re: [fpc-pascal] Primitive Record Wrappers

2016-03-10 Thread silvioprog
On Sun, Mar 6, 2016 at 7:21 PM, Mazola Winstrol wrote: [...] > Please see the code in attachments and send your suggestions / remarks. > Thanks for share. How do I use the the NullableTypes.String unit? Tried: program project1; {$mode objfpc}{$H+} uses

Re: [fpc-pascal] CMem issue?

2016-03-10 Thread silvioprog
On Tue, Mar 8, 2016 at 12:10 PM, Michael Van Canneyt <mich...@freepascal.org > wrote: > On Tue, 8 Mar 2016, silvioprog wrote: > >> On Tue, Mar 8, 2016 at 9:29 AM, Bart <bartjun...@gmail.com> wrote: >> >> On 3/8/16, silvioprog <silviop...@gmail.com> w

Re: [fpc-pascal] CMem issue?

2016-03-10 Thread silvioprog
On Tue, Mar 8, 2016 at 1:12 PM, Bart <bartjun...@gmail.com> wrote: > On 3/8/16, silvioprog <silviop...@gmail.com> wrote: > > Can you test this attached program? > > Builds and runs fine, both 64 and 32 bit, inside and outside the debugger. > Tested on Win7-64. S

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-10 Thread silvioprog
On Sat, Mar 5, 2016 at 3:38 PM, silvioprog <silviop...@gmail.com> wrote: [...] > ... however, when I try to run the project, I get a SIGSEGV: > This patch (by Gilson Nunes) fix the SIGSEGV: http://bugs.freepascal.org/view.php?id=29812. However, the example still making empty page

Re: [fpc-pascal] TStringHelper.Split() issue?

2016-03-08 Thread silvioprog
On Tue, Mar 8, 2016 at 12:09 PM, Michael Van Canneyt wrote: [...] > Please report a bug ! Done as #29798 . -- Silvio Clécio ___ fpc-pascal maillist -

Re: [fpc-pascal] TStringHelper.Split() issue?

2016-03-08 Thread silvioprog
On Tue, Mar 8, 2016 at 12:03 PM, Michael Van Canneyt wrote: [...] > > Yes. Quite strange, because I have testcases for this ? It happens only when the second part of string has only one character, two or more (eg "content: string = 'x:yy'") it works. -- Silvio Clécio

Re: [fpc-pascal] CMem issue?

2016-03-08 Thread silvioprog
On Tue, Mar 8, 2016 at 9:48 AM, Michael Van Canneyt wrote: [...] > Linux, 64 bit. I'll check it on my Xubuntu ... -- Silvio Clécio ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] TStringHelper.Split() issue?

2016-03-08 Thread silvioprog
Hello, Just test this code below: === code === program Project1; {$mode delphi} uses SysUtils; var content: string = 'x:y'; splited: TArray; begin splited := content.Split([':']); WriteLn(Length(splited)); ReadLn; end. === /code === On FPC, it returns 1, on Delphi, it returns

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-08 Thread silvioprog
On Sun, Mar 6, 2016 at 6:30 AM, Luca Olivetti wrote: > El 06/03/16 a les 10:15, Michael Van Canneyt ha escrit: > >> Strange, because if I recall correctly it was tested with Cyrillic, and >> that worked ? >> >> Later I will try with other readers. >>> >> >> Please do, I'd

Re: [fpc-pascal] CMem issue?

2016-03-08 Thread silvioprog
On Tue, Mar 8, 2016 at 8:42 AM, Michael Van Canneyt wrote: [...] > I tried that and the code runs fine on my system. Linux? (my environment: Lazarus 1.7 rUnknown FPC 3.1.1 i386-win32-win32/win64) -- Silvio Clécio ___

Re: [fpc-pascal] CMem issue?

2016-03-08 Thread silvioprog
On Tue, Mar 8, 2016 at 5:54 AM, Michael Van Canneyt wrote: [...] > First paragraph. > > http://freepascal.org/docs-html/current/rtl/cmem/index.html This Sven explanation below should be added there too: 'Also don't use -gh with alternate memory managers. They are

Re: [fpc-pascal] CMem issue?

2016-03-08 Thread silvioprog
the units as: === code === uses cmem, Classes, SysUtils; === /code === And the problem was: === error === C:\Users\silvioprog\Desktop\av>project1.exe An unhandled exception occurred at $0040B8E2: EAccessViolation: Access violation $0040B8E2 === /

Re: [fpc-pascal] CMem issue?

2016-03-08 Thread silvioprog
On Mon, Mar 7, 2016 at 10:09 PM, Bart <bartjun...@gmail.com> wrote: > On 3/8/16, silvioprog <silviop...@gmail.com> wrote: > > I got an AV in the CMem unit. To reproduce the problem just compile and > run > > this code below: > > > > === code === >

[fpc-pascal] CMem issue?

2016-03-07 Thread silvioprog
:= TEncoding.UTF8.GetBytes('abc'); VStream.WriteBuffer(VBuffer[0], Length(VBuffer)); finally VStream.Free; end; end. === /code === === error === C:\Users\silvioprog\Desktop\av>project1.exe An unhandled exception occurred at $00410479: EAccessViolation: Access violation $00410479 $00410

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
On Sat, Mar 5, 2016 at 5:24 PM, Ralf Quint wrote: > On 3/5/2016 12:03 PM, Michael Van Canneyt wrote: > >> >> This is what I get with the normal test font: >> http://www.freepascal.org/~michael/test.pdf >> >> FYI, > > Opening up this document with the latest Adobe Reader DC

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
On Sat, Mar 5, 2016 at 5:03 PM, Michael Van Canneyt <mich...@freepascal.org> wrote: > > On Sat, 5 Mar 2016, silvioprog wrote: > > Hm. I tried many PDF readers on the file. All unix based (okular, >>> openoffice), but also the Google docs PDF viewer and Firefox PDF reader

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
On Sat, Mar 5, 2016 at 3:58 PM, Michael Van Canneyt <mich...@freepascal.org> wrote: > On Sat, 5 Mar 2016, silvioprog wrote: > >> On Sat, Mar 5, 2016 at 3:38 PM, silvioprog <silviop...@gmail.com> wrote: >> >>> Hello, >>> >>> I just create

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
On Sat, Mar 5, 2016 at 3:56 PM, Michael Van Canneyt <mich...@freepascal.org> wrote: > > On Sat, 5 Mar 2016, silvioprog wrote: > >> Hello, >> >> I just created the folder "fonts" and copied the >> "C:\Windows\Fonts\arial.ttf" into that, so

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
On Sat, Mar 5, 2016 at 3:38 PM, silvioprog <silviop...@gmail.com> wrote: > Hello, > > I just created the folder "fonts" and copied the > "C:\Windows\Fonts\arial.ttf" into that, so I changed the line > "D.AddFont('FreeSans.ttf', 'FreeSans-12' to &quo

[fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
Hello, I just created the folder "fonts" and copied the "C:\Windows\Fonts\arial.ttf" into that, so I changed the line "D.AddFont('FreeSans.ttf', 'FreeSans-12' to "D.AddFont('arial.ttf', 'Arial", however, when I try to run the project, I get a SIGSEGV: #0

Re: [fpc-pascal] Access violation in an empty project declaring heaptrc

2016-03-03 Thread silvioprog
On Thu, Mar 3, 2016 at 4:05 AM, Sven Barth wrote: [...] > That is the memory that had been used before the memory manager of the > heaptrc unit had been setup. Remember that there's first the System unit > initialization and only then the initialization of the

Re: [fpc-pascal] Primitive Record Wrappers

2016-03-03 Thread silvioprog
On Thu, Mar 3, 2016 at 10:16 AM, Mazola Winstrol <mazofei...@gmail.com> wrote: > 2016-03-02 23:12 GMT-03:00 silvioprog <silviop...@gmail.com>: > >> On Tue, Mar 1, 2016 at 12:08 AM, Mazola Winstrol <mazofei...@gmail.com> >> wrote: >> [...] >>> &g

  1   2   3   4   5   6   >