#1 2021-04-28 03:07:10

keinn
Member
Registered: 2014-10-20
Posts: 100

FormatUtf8 in core.json and core.text conflit

when both core.json and core.text in the uses cluase, compiler can not find the right FormatUtf8 func

function FormatUtf8(const Format: RawUtf8; const Args: array of const): RawUtf8; overload;

Last edited by keinn (2021-04-28 03:11:40)

Offline

#2 2021-04-28 10:31:34

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,225
Website

Re: FormatUtf8 in core.json and core.text conflit

I don't understand what you meant.

The two signature are different: one with Args and another with Args and Params.
So the compiler can make a difference between the two overloads.

Online

#3 2021-04-28 13:10:29

keinn
Member
Registered: 2014-10-20
Posts: 100

Re: FormatUtf8 in core.json and core.text conflit

i'd like to use

xx:=formatUtf8('abc%',[i])

but if the mormot.core.json and mormot.core.text both imported in the unit , u can't do so.  it can NOT be compiled .
i had to remove the mormot.core.json use from the unit.

Offline

#4 2021-04-28 13:24:59

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,225
Website

Re: FormatUtf8 in core.json and core.text conflit

Which compiler are you using?

I am not able to reproduce it.
There are a lot of places in mORMot where both units are used together, with no problem.

So I guess there is something wrong either with the source code you are using, or you are mixing some units.
Check your project paths - and on FPC use the mormot2.lpk package.

Online

#5 2021-04-28 13:41:11

sakura
Member
From: Germany
Registered: 2018-02-21
Posts: 225
Website

Re: FormatUtf8 in core.json and core.text conflit

keinn wrote:

but if the mormot.core.json and mormot.core.text both imported in the unit , u can't do so.  it can NOT be compiled.

Most of my units have both and I am using FormatUtf8 all over the place, no problems at all.

Delphi 10.4.2 W32/W64

Offline

Board footer

Powered by FluxBB