Re: [fpc-pascal] Warning: Variable xxx does not seem to be initialized

2013-12-30 Thread Dmitry Boyarintsev
Some new syntax has to be introduced to avoid the warning. Something like: type TMyRec = record record procedure Print; end; record procedure TMyRec.Print; begin writeln('foo'); end; thanks, Dmitry P.S. this message is not as straight forward as it might seem.

Re: [fpc-pascal] Warning: Variable xxx does not seem to be initialized

2013-12-30 Thread Sven Barth
Am 30.12.2013 20:08 schrieb "Marcos Douglas" : > > Hi, > > I'm using FPC 2.6.2 and {advancedrecords}. > The compiler shows a warning when I use a record variable. IMO this is > a bug because record variables need not be initialized, right? Managed types (strings, interfaces, dynamic arrays) inside

[fpc-pascal] Free Pascal 2.6.4-rc1 - IDE crashes

2013-12-30 Thread Ched
Hello All, I don't know if I'm the only people having problems with the fp IDE of the rc1 from the win32 package under winxp 32 bits... The complier works fine. But when I have an error in the source code of a program, I can't jump to the location of the error after the compilation attempt us

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Michael Van Canneyt
On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: On 2013-12-30 14:33, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: Bug reported as: http://bugs.freepascal.org/view.php?id=25469 Including patch a

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Michael Van Canneyt
On Tue, 31 Dec 2013, Juha Manninen wrote: On Mon, Dec 30, 2013 at 9:17 PM, Mattias Gaertner wrote: if FindInvalidUTF8Character(PChar(Pointer(s)),length(s))<0 then // UTF-8 Uhhh! I will be totally screwed when I must do a unicode conversion myself. What was this "PChar(Pointer(s))" again?

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Juha Manninen
On Mon, Dec 30, 2013 at 9:17 PM, Mattias Gaertner wrote: > if FindInvalidUTF8Character(PChar(Pointer(s)),length(s))<0 then > // UTF-8 Uhhh! I will be totally screwed when I must do a unicode conversion myself. What was this "PChar(Pointer(s))" again? PChar is a pointer, why does it need a doubl

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Ralf Quint
On 12/30/2013 4:55 AM, Marco van de Voort wrote: In our previous episode, Michael Van Canneyt said: procedure t(S : String); begin if typeinfo(s)=typeinfo(shortstring) then Writeln('ShortString') else Writeln('Ansistring'); end; begin t(''); end. Thank you, I saved it

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Torsten Bonde Christiansen
On 2013-12-30 14:33, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: Bug reported as: http://bugs.freepascal.org/view.php?id=25469 Including patch and program with test. Thank you, I will have a look ASAP.

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Mattias Gaertner
On Mon, 30 Dec 2013 19:19:20 +0200 Juha Manninen wrote: > On Mon, Dec 30, 2013 at 2:35 PM, Marcos Douglas wrote: > > Is possible to know what string type of a variable (AnsiString, > > UTF8String, RawByteString, etc)? > > When UTF-8 encoded string is stored in AnsiString (as in LCL), this > tes

[fpc-pascal] Warning: Variable xxx does not seem to be initialized

2013-12-30 Thread Marcos Douglas
Hi, I'm using FPC 2.6.2 and {advancedrecords}. The compiler shows a warning when I use a record variable. IMO this is a bug because record variables need not be initialized, right? project1.lpr(20,3) Warning: Variable "r" does not seem to be initialized === BEGIN === program Project1; {$mode ob

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Marcos Douglas
On Mon, Dec 30, 2013 at 2:19 PM, Juha Manninen wrote: > On Mon, Dec 30, 2013 at 2:35 PM, Marcos Douglas wrote: >> Is possible to know what string type of a variable (AnsiString, >> UTF8String, RawByteString, etc)? > > When UTF-8 encoded string is stored in AnsiString (as in LCL), this > test shou

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Juha Manninen
On Mon, Dec 30, 2013 at 2:35 PM, Marcos Douglas wrote: > Is possible to know what string type of a variable (AnsiString, > UTF8String, RawByteString, etc)? When UTF-8 encoded string is stored in AnsiString (as in LCL), this test should tell you if it actually is UTF-8 string: if Length(s) <> UT

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Marcos Douglas
On Mon, Dec 30, 2013 at 11:47 AM, Michael Van Canneyt wrote: > > >>> No. You make a wrong assumption. >>> >>> TypeInfo will return the DECLARED type of S. >>> >>> Not the type that was actually passed when calling the routine: >>> That has been converted to the declared type of S by the compiler e

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Michael Van Canneyt
No. You make a wrong assumption. TypeInfo will return the DECLARED type of S. Not the type that was actually passed when calling the routine: That has been converted to the declared type of S by the compiler even before the routine ShowType is called. You're right. Well is there another way

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Marcos Douglas
On Mon, Dec 30, 2013 at 11:08 AM, Michael Van Canneyt wrote: > > > On Mon, 30 Dec 2013, Marcos Douglas wrote: > >> On Mon, Dec 30, 2013 at 9:48 AM, Marcos Douglas wrote: >>> >>> On Mon, Dec 30, 2013 at 9:41 AM, Michael Van Canneyt >>> wrote: On Mon, 30 Dec 2013, Marcos Douglas wro

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Michael Van Canneyt
On Mon, 30 Dec 2013, Marcos Douglas wrote: On Mon, Dec 30, 2013 at 9:48 AM, Marcos Douglas wrote: On Mon, Dec 30, 2013 at 9:41 AM, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Marcos Douglas wrote: Hi, Is possible to know what string type of a variable (AnsiString, UTF8String, RawB

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Torsten Bonde Christiansen
On 2013-12-30 14:33, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: And if you provide fixes, make sure the testsuite still runs OK. I am not sure this case was tested at all - should i try implementing a

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Marcos Douglas
On Mon, Dec 30, 2013 at 9:48 AM, Marcos Douglas wrote: > On Mon, Dec 30, 2013 at 9:41 AM, Michael Van Canneyt > wrote: >> >> >> On Mon, 30 Dec 2013, Marcos Douglas wrote: >> >>> Hi, >>> >>> Is possible to know what string type of a variable (AnsiString, >>> UTF8String, RawByteString, etc)? >> >>

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Michael Van Canneyt
On Mon, 30 Dec 2013, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: And if you provide fixes, make sure the testsuite still runs OK. I am not sure this case was tested at all - should i try implementing a new test or just advide what must be tested. I a

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Michael Van Canneyt
On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: And if you provide fixes, make sure the testsuite still runs OK. I am not sure this case was tested at all - should i try implementing a new test or just advide what must be tested. I ask because i'm not at all familiar with the testing

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Torsten Bonde Christiansen
On 2013-12-30 13:26, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: On 2013-12-30 13:01, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: On 2013-12-19 21:23, Marco van de Voort wrote: Hello We have placed the first re

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said: > > procedure t(S : String); > > begin >if typeinfo(s)=typeinfo(shortstring) then > Writeln('ShortString') >else > Writeln('Ansistring'); > end; > > begin >t(''); > end. Thank you, I saved it to my obfuscated Pascal mailf

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Marcos Douglas
On Mon, Dec 30, 2013 at 9:41 AM, Michael Van Canneyt wrote: > > > On Mon, 30 Dec 2013, Marcos Douglas wrote: > >> Hi, >> >> Is possible to know what string type of a variable (AnsiString, >> UTF8String, RawByteString, etc)? > > > You can try > > if TypeInfo(S)=TypeInfo(AnsiString) then > > etc. >

Re: [fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Michael Van Canneyt
On Mon, 30 Dec 2013, Marcos Douglas wrote: Hi, Is possible to know what string type of a variable (AnsiString, UTF8String, RawByteString, etc)? You can try if TypeInfo(S)=TypeInfo(AnsiString) then etc. The following program procedure t(S : String); begin if typeinfo(s)=typeinfo(short

[fpc-pascal] How to know the string type of a variable?

2013-12-30 Thread Marcos Douglas
Hi, Is possible to know what string type of a variable (AnsiString, UTF8String, RawByteString, etc)? Eg: === BEGIN === procedure foo(s: string); begin // if S is AnsiString then do something; // if S is UTF8String then do something; end; var AStr: AnsiString; U8Str: UTF8String; foo(ASt

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Michael Van Canneyt
On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: On 2013-12-30 13:01, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: On 2013-12-19 21:23, Marco van de Voort wrote: Hello We have placed the first release candidate of the Free Pascal Compiler versi

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Torsten Bonde Christiansen
On 2013-12-30 13:01, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: On 2013-12-19 21:23, Marco van de Voort wrote: Hello We have placed the first release candidate of the Free Pascal Compiler version 2.6.4 on our ftp servers. You can help improve the upco

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Michael Van Canneyt
On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: On 2013-12-19 21:23, Marco van de Voort wrote: Hello We have placed the first release candidate of the Free Pascal Compiler version 2.6.4 on our ftp servers. You can help improve the upcoming 2.6.4 release by downloading and testing thi

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Torsten Bonde Christiansen
On 2013-12-30 12:54, Torsten Bonde Christiansen wrote: On 2013-12-19 21:23, Marco van de Voort wrote: Hello We have placed the first release candidate of the Free Pascal Compiler version 2.6.4 on our ftp servers. You can help improve the upcoming 2.6.4 release by downloading and testing this r

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-30 Thread Torsten Bonde Christiansen
On 2013-12-19 21:23, Marco van de Voort wrote: Hello We have placed the first release candidate of the Free Pascal Compiler version 2.6.4 on our ftp servers. You can help improve the upcoming 2.6.4 release by downloading and testing this release. If you want you can report what you have done he