[fpc-pascal] uses in 'filename'

2018-02-22 Thread Mattias Gaertner
Hi, FPC allows to use two different units with the same name: uses foo in 'unit1.pas', bar in 'sub/unit1.pas'; Which might fail with linking errors. Is this a feature or a bug? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] Replacing parts of a string with TRegexpr

2018-02-22 Thread luciano de souza
Hello all, I'd like to replace some part of a string acording to a pattern. I know how to search and print the matches of a ER: program test; {$mode objfpc}{$H+} uses regexpr; var r: TRegexpr; BEGIN r := TRegexpr.create('(\d+)'); try if r.exec('01 Brazil, 02 USA, 03 China') then begin repeat

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread Michael Van Canneyt
On Thu, 22 Feb 2018, Mattias Gaertner wrote: Hi, FPC allows to use two different units with the same name: uses foo in 'unit1.pas', bar in 'sub/unit1.pas'; Which might fail with linking errors. Is this a feature or a bug? A feature. First of all, normally it won't work either way,

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread wkitty42
On 02/22/2018 09:49 AM, Michael Van Canneyt wrote: On Thu, 22 Feb 2018, Mattias Gaertner wrote: On Thu, 22 Feb 2018 12:48:21 +0100 (CET) Michael Van Canneyt wrote: First of all, normally it won't work either way, because you must use "unit foo;" and "unit bar;" in the

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread Mattias Gaertner
On Thu, 22 Feb 2018 12:48:21 +0100 (CET) Michael Van Canneyt wrote: >[...] > home:~/source/testsub> fpc a.pp > unit1.pas(1,9) Error: Illegal unit name: foo (expecting FOO) > unit1.pas(7,1) Fatal: There were 1 errors compiling module, stopping > Fatal: Compilation

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread Mattias Gaertner
On Thu, 22 Feb 2018 17:04:25 +0100 Mattias Gaertner wrote: > On Thu, 22 Feb 2018 10:41:29 -0500 > wkitt...@windstream.net wrote: > > > On 02/22/2018 09:49 AM, Michael Van Canneyt wrote: > > > On Thu, 22 Feb 2018, Mattias Gaertner wrote: > > >> On Thu, 22 Feb

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread Mattias Gaertner
On Thu, 22 Feb 2018 10:41:29 -0500 wkitt...@windstream.net wrote: > On 02/22/2018 09:49 AM, Michael Van Canneyt wrote: > > On Thu, 22 Feb 2018, Mattias Gaertner wrote: > >> On Thu, 22 Feb 2018 12:48:21 +0100 (CET) > >> Michael Van Canneyt wrote: > >>> First of all,

Re: [fpc-pascal] Replacing parts of a string with TRegexpr

2018-02-22 Thread luciano de souza
I am blind and it's not so easy to read the source code with so many comments. Dispite this, I find the method "TRegexpr.replace", accepting as the first argument the input string and the second the template string. The return is what I want. In other words, the problem is solved and anything else

Re: [fpc-pascal] Is this the correct way to configure fpc for multiple arm-embedded subarchs?

2018-02-22 Thread Christo
On Mon, 2017-12-04 at 08:22 +0100, Michael Ring wrote: > Hi Florian! > > I would like to work on this patch, can you share it with me? > > Thank you, > > Michael > > > Am 03.12.17 um 19:05 schrieb Florian Klämpfl: > > > > Am 29.11.2017 um 06:36 schrieb Christo: > > > > > > On Sun,

[fpc-pascal] FCL-WEB HELP

2018-02-22 Thread African Wild Dog
Hello, After trying unsuccessfully, I decided to ask for help. I have a webmodule with five actions. The five actions share the same page layout (including globals css and js files). Each action can add action's specific css's and js's files and each action defines a specific content. How to

[fpc-pascal] Better way to convert short string to pchar?

2018-02-22 Thread Ryan Joseph
I would like short strings so I can do concatenation easily but I need to pass pchar to a C function. Is there anyway to do this on the stack instead of allocating a string each time? I feel like it was possible to do some type casting but I don’t remember how. pname := StrAlloc(Length(name) +

Re: [fpc-pascal] Is this the correct way to configure fpc for multiple arm-embedded subarchs?

2018-02-22 Thread Christo Crause
Michael, I have just noticed a target-subdir folder in svn.freepascal.org/svn/fpc/branches/target-subdir/ It seems as if rev 30766 contains Florian's first modifications to implementation the subarch subfolder option. On 4 Dec 2017 9:23 am, "Michael Ring" wrote: Hi

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread Mattias Gaertner
On Thu, 22 Feb 2018 12:48:21 +0100 (CET) Michael Van Canneyt wrote: >[...] > First of all, normally it won't work either way, because you must use "unit > foo;" and "unit bar;" in the files. No, I can use normal units. This works here: ---test1.pas--- uses foo in

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread Michael Van Canneyt
On Thu, 22 Feb 2018, Mattias Gaertner wrote: On Thu, 22 Feb 2018 12:48:21 +0100 (CET) Michael Van Canneyt wrote: [...] First of all, normally it won't work either way, because you must use "unit foo;" and "unit bar;" in the files. No, I can use normal units. This