Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-08 Thread Jonas Maebe
MARCOU Gilles wrote on Tue, 08 Mar 2016: Sorry for my last post, I missed some reply. I think that I understood now the problem. Using TStringList.Sort, it uses AnsiCompareStr which needs a specific widestring manager to be defined. This is done adding the unit cwstring in the program unit

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-08 Thread MARCOU Gilles
Sorry for my last post, I missed some reply. I think that I understood now the problem. Using TStringList.Sort, it uses AnsiCompareStr which needs a specific widestring manager to be defined. This is done adding the unit cwstring in the program unit (the .lpr using Lazarus). A better option, if

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-07 Thread Marcou Gilles
Thanks for your answer Jonas. > One probably includes cwstring, while the other one doesn't. > AnsiCompareStr can be intercepted/replaced by widestring manages such as > cwstring. Is it what is meant into the manual by: "A widestring manager must be installed in order for this function to work

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Tomas Hajny
On Sat, March 5, 2016 23:51, Bart wrote: > On 3/5/16, Jonas Maebe wrote: > >> One probably includes cwstring, while the other one doesn't. >> AnsiCompareStr can be intercepted/replaced by widestring manages such as >> cwstring. > > Sample from above on Linux 32-bit: > [bart@localhost ConsoleProjec

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Bart
On 3/5/16, Jonas Maebe wrote: > One probably includes cwstring, while the other one doesn't. > AnsiCompareStr can be intercepted/replaced by widestring manages such as > cwstring. Sample from above on Linux 32-bit: [bart@localhost ConsoleProjecten]$ ./test AnsiCompareStr('C-C','C=C') = -16 Same

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Jonas Maebe
On 05/03/16 20:27, Marcou Gilles wrote: this is strange. Using you example I got the value -16. I am using fpc 2.6.4 on a Linux 64 bits machine. I do not get why I got a different value than you. And in my case, the strange behavior is that AnsiCompareStr in the same unit but in two different app

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Marcou Gilles
Thanks Bart, this is strange. Using you example I got the value -16. I am using fpc 2.6.4 on a Linux 64 bits machine. I do not get why I got a different value than you. And in my case, the strange behavior is that AnsiCompareStr in the same unit but in two different application gave two different

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Bart
On 3/5/16, Marcou Gilles wrote: > I checked the AnsiCompareStr value between these two string and found > that the same unit compiled into one application give the value 16 and > compiled into the other application, it return the value -28. {$apptype console} {$ifdef fpc} {$mode objfpc} {$h+} /

[fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Marcou Gilles
Hi, in an application, I use a TStringList.Sort to sort a list of these two words "(C-C)" and "(C=C)". When I use the same unit in another project, the Sort function sort those two strings in revert order (on the same computer, same system). I checked the AnsiCompareStr value between these two st