Re: [lazarus] utf8toansi
Am Samstag, 13. Januar 2007 18:18 schrieb Florian Klaempfl: > Sebastian Kraft schrieb: > > Hello, > > > > have a problem with the function utf8toansi. > > > > I'm using kubuntu 6.10 with german utf8 locale. I get an input from a > > Gtk2 TEdit component including special characters like "äöü". I save this > > input to an ansistring. > > Then I want to write this string to a file in ansi format. But also when > > I do utf8toansi before writing the ansitring to file all special > > characters are encoded with 2 bytes as I see with hexedit. > > > > What am I doing wrong here? > > Ansistring means actually use system locale. > ok, but how can I convert the utf8 string to something iso8859 like where every character is encoded by one(!) byte. _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] utf8toansi
Am Samstag, 13. Januar 2007 20:45 schrieb Felipe Monteiro de Carvalho: > On 1/13/07, Sebastian Kraft <[EMAIL PROTECTED]> wrote: > > Then I want to write this string to a file in ansi format. But also when > > I do utf8toansi before writing the ansitring to file all special > > characters are encoded with 2 bytes as I see with hexedit. > > There are some functions that convert string formats. There is a > UTF8ToAnsi if I remember correctly. I don´t remember the unit it > belongs too, however. as I wrote... utf8toansi is not doing what I want :) _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Form streaming error
>> I'm porting a delphi app to lazarus. But when I try to run the app >> it keeps crashing with the below message. >> >> I suspect the LRS file is corrupt, but I have no idea how to check >> or better fix this. I tried removing the LRS file several times >> and save the project which recreates the LRS file. But that does >> not help unfortunately. Does anyone have an idea? I'm using >> lazarus 0.9.20 and fpc 2.0.4. > > The .lrs file is simply a converted .lfm file. I doubt it is > 'corrupt', but it can contain properties/values that does not > exist/make sense. see below > > >> Darius >> >> >> [InitComponent] TMainForm True >> [InitComponent] TForm True >> [InitComponent] CompResource found for TMainForm >> Form Stream "TMainForm" Signature=TPF0 >> Form streaming "TMainForm" error: Class " " not found > > 'Class " " not found' is a TReader error. > TReader seldom gives helpful error messages. > Can you open the form in the IDE? Yes, I can. The converted form containted indeed several invalid properties like OldCreateOrder, but this is well known and I never had problems with it before. It's strange though that if I save the project after compiling the form is not able to open anymore. I get the following error: "unable to convert text form data of file c:\etc\etc\main.lfm into binary stream. (Identifier expected on line 3191)". Then the .lfm is corrupt. What is at (in front of) line 3191? This is indeed the case. There is an empty "object end" on that line. When I remove it the problem is still not solved. I get the error: "Unable to transform binary component stream of Mainform: TMainForm into text. Division by zero." What I find strange is that after converting the dfm to lfm I need to remove several invalid properties from the LFM (automatically proposed). Then I can open the LFM file without problems in the IDE. But when I save the LFM file it's corrupt and a lot of components on the form are gone. I tried saving the form as XML file and it appears that the error starts with the ImageList. Somehow saving the imagelist seems to have a bug. When I check the imagelist from the IDE I seen nothing strange. Next is the definition of the imagelist where the error occurs. Darius Mattias > >> [FORMS.PP] ExceptionOccurred >> Sender=EAccessViolation >> Exception=Access violation >> Stack trace: >> $00453A59 TCUSTOMACTION__SETCHECKED, line 102 of >> ./include/customaction.inc >> $0040E189 TMAINFORM__SETMODE, line 856 of main.pas >> $00412F2A TMAINFORM__FORMCREATE, line 1955 of main.pas >> $00404DB9 TCUSTOMFORM__DOCREATE, line 614 >> of ./include/customform.inc $0040656C TCUSTOMFORM__CREATE, line >> 1297 of ./include/customform.inc $0040C0D2 >> TAPPLICATION__CREATEFORM, line 1523 of ./include/application.inc >> $004010AB main, line 32 of LpSolveIDE.lpr >> TApplication.HandleException Access violation >> Stack trace: >> $00453A59 TCUSTOMACTION__SETCHECKED, line 102 of >> ./include/customaction.inc >> $0040E189 TMAINFORM__SETMODE, line 856 of main.pas >> $00412F2A TMAINFORM__FORMCREATE, line 1955 of main.pas >> $00404DB9 TCUSTOMFORM__DOCREATE, line 614 >> of ./include/customform.inc $0040656C TCUSTOMFORM__CREATE, line >> 1297 of ./include/customform.inc $0040C0D2 >> TAPPLICATION__CREATEFORM, line 1523 of ./include/application.inc >> $004010AB main, line 32 of LpSolveIDE.lpr >> [InitComponent] TPromptDialog True >> [InitComponent] TForm True >> Runtime error 217 at $0055FA22 >> $0055FA22 DOUNHANDLEDEXCEPTION, line 156 of >> C:/lazarus/source/fpcbuild/2.0.4/fpcsrc/rtl/inc/except.inc >> $0055B80C fpc_reraise, line 266 of >> C:/lazarus/source/fpcbuild/2.0.4/fpcsrc/rtl/inc/except.inc >> $00401134 main, line 26 of LpSolveIDE.lpr >> $0055B59E EXE_ENTRY, line 420 of system.pp _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] TSemaphorGrid in lastest Lazarus (svn)
Graeme Geldenhuys wrote: On 1/11/07, Jesus Reyes <[EMAIL PROTECTED]> wrote: Some forms were designed before 2.1.1 when readonly properties used to be stored in lfm files. In revision 10426 I removed these properties form some lfm files including the semaphore grid example. Please try again. Thanks, it's fixed now! > Just to confirm - Custom drawing in the TStringGrid is supported on > Linux (gtk) and Windows? yes it's supported, now it works even under QT (readonly thought, and Excellent, thanks. Custom drawing howto is yet to be written, will try to find some time next weekend. Is the Semaphor Grid just an example of custom drawing on a TStringGrid, plus a few other examples like sorting, etc? I don't actually understand what the TSemaphorGrid is used for? For instance (see the screenshot), a user must receive and register a series of contrib (quota condominium for month) with semaphorgrid he can see early if people is full payer (€10.42/€10.42 Si green) Mr. Owner 1 and Mrs. Owner 2 partially defaulting payer (€12.00/€24.27 In parte yellow) Mr. Owner 3 for RATA 1 full defaulting payer (No red) Mrs. Proprietor B for RATA 1 and 2 for each month Hope you can understand my poor english Salvatore ImageSG.png Description: Binary data
[lazarus] Range check error
Hi, By compiling Lazarus with GTK1.2 (and actually on any other interface) I'm getting the following exception: An unhandled exception occurred at $004F0108 : ERangeError : Range check error $004F0108 INTERNALINIT, line 850 of graphtype.pp $004F022D GRAPHTYPE_init, line 861 of graphtype.pp $0041F440 $0040FBAC main, of lazarus.pp I'm using the revision 10439 over FPC 1.0.4 on Linux 64 bit. Ido -- http://ik.homelinux.org/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] utf8toansi
On 1/13/07, Sebastian Kraft <[EMAIL PROTECTED]> wrote: Then I want to write this string to a file in ansi format. But also when I do utf8toansi before writing the ansitring to file all special characters are encoded with 2 bytes as I see with hexedit. There are some functions that convert string formats. There is a UTF8ToAnsi if I remember correctly. I don´t remember the unit it belongs too, however. -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] utf8toansi
Sebastian Kraft schrieb: Hello, have a problem with the function utf8toansi. I'm using kubuntu 6.10 with german utf8 locale. I get an input from a Gtk2 TEdit component including special characters like "äöü". I save this input to an ansistring. Then I want to write this string to a file in ansi format. But also when I do utf8toansi before writing the ansitring to file all special characters are encoded with 2 bytes as I see with hexedit. What am I doing wrong here? Ansistring means actually use system locale. _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Form streaming error
On Sat, 13 Jan 2007 17:55:34 +0100 "Darius Blaszijk" <[EMAIL PROTECTED]> wrote: > > - Original Message - > From: "Mattias Gaertner" <[EMAIL PROTECTED]> > To: > Sent: Saturday, January 13, 2007 4:36 PM > Subject: Re: [lazarus] Form streaming error > > > > On Fri, 12 Jan 2007 16:46:54 +0100 (CET) > > [EMAIL PROTECTED] wrote: > > > >> I'm porting a delphi app to lazarus. But when I try to run the app > >> it keeps crashing with the below message. > >> > >> I suspect the LRS file is corrupt, but I have no idea how to check > >> or better fix this. I tried removing the LRS file several times > >> and save the project which recreates the LRS file. But that does > >> not help unfortunately. Does anyone have an idea? I'm using > >> lazarus 0.9.20 and fpc 2.0.4. > > > > The .lrs file is simply a converted .lfm file. I doubt it is > > 'corrupt', but it can contain properties/values that does not > > exist/make sense. see below > > > > > >> Darius > >> > >> > >> [InitComponent] TMainForm True > >> [InitComponent] TForm True > >> [InitComponent] CompResource found for TMainForm > >> Form Stream "TMainForm" Signature=TPF0 > >> Form streaming "TMainForm" error: Class " " not found > > > > 'Class " " not found' is a TReader error. > > TReader seldom gives helpful error messages. > > Can you open the form in the IDE? > > Yes, I can. The converted form containted indeed several invalid > properties like OldCreateOrder, but this is well known and I never > had problems with it before. > It's strange though that if I save the project after compiling the > form is not able to open anymore. I get the following error: "unable > to convert text form data of file c:\etc\etc\main.lfm into binary > stream. (Identifier expected on line 3191)". Then the .lfm is corrupt. What is at (in front of) line 3191? Mattias > > Darius > > > > > > > Mattias > > > > > > > >> [FORMS.PP] ExceptionOccurred > >> Sender=EAccessViolation > >> Exception=Access violation > >> Stack trace: > >> $00453A59 TCUSTOMACTION__SETCHECKED, line 102 of > >> ./include/customaction.inc > >> $0040E189 TMAINFORM__SETMODE, line 856 of main.pas > >> $00412F2A TMAINFORM__FORMCREATE, line 1955 of main.pas > >> $00404DB9 TCUSTOMFORM__DOCREATE, line 614 > >> of ./include/customform.inc $0040656C TCUSTOMFORM__CREATE, line > >> 1297 of ./include/customform.inc $0040C0D2 > >> TAPPLICATION__CREATEFORM, line 1523 of ./include/application.inc > >> $004010AB main, line 32 of LpSolveIDE.lpr > >> TApplication.HandleException Access violation > >> Stack trace: > >> $00453A59 TCUSTOMACTION__SETCHECKED, line 102 of > >> ./include/customaction.inc > >> $0040E189 TMAINFORM__SETMODE, line 856 of main.pas > >> $00412F2A TMAINFORM__FORMCREATE, line 1955 of main.pas > >> $00404DB9 TCUSTOMFORM__DOCREATE, line 614 > >> of ./include/customform.inc $0040656C TCUSTOMFORM__CREATE, line > >> 1297 of ./include/customform.inc $0040C0D2 > >> TAPPLICATION__CREATEFORM, line 1523 of ./include/application.inc > >> $004010AB main, line 32 of LpSolveIDE.lpr > >> [InitComponent] TPromptDialog True > >> [InitComponent] TForm True > >> Runtime error 217 at $0055FA22 > >> $0055FA22 DOUNHANDLEDEXCEPTION, line 156 of > >> C:/lazarus/source/fpcbuild/2.0.4/fpcsrc/rtl/inc/except.inc > >> $0055B80C fpc_reraise, line 266 of > >> C:/lazarus/source/fpcbuild/2.0.4/fpcsrc/rtl/inc/except.inc > >> $00401134 main, line 26 of LpSolveIDE.lpr > >> $0055B59E EXE_ENTRY, line 420 of system.pp > >> > >> > >> > >> _ > >> To unsubscribe: mail [EMAIL PROTECTED] with > >> "unsubscribe" as the Subject > >>archives at http://www.lazarus.freepascal.org/mailarchives > > > > _ > > To unsubscribe: mail [EMAIL PROTECTED] with > >"unsubscribe" as the Subject > > archives at http://www.lazarus.freepascal.org/mailarchives > > _ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject >archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Form streaming error
- Original Message - From: "Mattias Gaertner" <[EMAIL PROTECTED]> To: Sent: Saturday, January 13, 2007 4:36 PM Subject: Re: [lazarus] Form streaming error On Fri, 12 Jan 2007 16:46:54 +0100 (CET) [EMAIL PROTECTED] wrote: I'm porting a delphi app to lazarus. But when I try to run the app it keeps crashing with the below message. I suspect the LRS file is corrupt, but I have no idea how to check or better fix this. I tried removing the LRS file several times and save the project which recreates the LRS file. But that does not help unfortunately. Does anyone have an idea? I'm using lazarus 0.9.20 and fpc 2.0.4. The .lrs file is simply a converted .lfm file. I doubt it is 'corrupt', but it can contain properties/values that does not exist/make sense. see below Darius [InitComponent] TMainForm True [InitComponent] TForm True [InitComponent] CompResource found for TMainForm Form Stream "TMainForm" Signature=TPF0 Form streaming "TMainForm" error: Class " " not found 'Class " " not found' is a TReader error. TReader seldom gives helpful error messages. Can you open the form in the IDE? Yes, I can. The converted form containted indeed several invalid properties like OldCreateOrder, but this is well known and I never had problems with it before. It's strange though that if I save the project after compiling the form is not able to open anymore. I get the following error: "unable to convert text form data of file c:\etc\etc\main.lfm into binary stream. (Identifier expected on line 3191)". Darius Mattias [FORMS.PP] ExceptionOccurred Sender=EAccessViolation Exception=Access violation Stack trace: $00453A59 TCUSTOMACTION__SETCHECKED, line 102 of ./include/customaction.inc $0040E189 TMAINFORM__SETMODE, line 856 of main.pas $00412F2A TMAINFORM__FORMCREATE, line 1955 of main.pas $00404DB9 TCUSTOMFORM__DOCREATE, line 614 of ./include/customform.inc $0040656C TCUSTOMFORM__CREATE, line 1297 of ./include/customform.inc $0040C0D2 TAPPLICATION__CREATEFORM, line 1523 of ./include/application.inc $004010AB main, line 32 of LpSolveIDE.lpr TApplication.HandleException Access violation Stack trace: $00453A59 TCUSTOMACTION__SETCHECKED, line 102 of ./include/customaction.inc $0040E189 TMAINFORM__SETMODE, line 856 of main.pas $00412F2A TMAINFORM__FORMCREATE, line 1955 of main.pas $00404DB9 TCUSTOMFORM__DOCREATE, line 614 of ./include/customform.inc $0040656C TCUSTOMFORM__CREATE, line 1297 of ./include/customform.inc $0040C0D2 TAPPLICATION__CREATEFORM, line 1523 of ./include/application.inc $004010AB main, line 32 of LpSolveIDE.lpr [InitComponent] TPromptDialog True [InitComponent] TForm True Runtime error 217 at $0055FA22 $0055FA22 DOUNHANDLEDEXCEPTION, line 156 of C:/lazarus/source/fpcbuild/2.0.4/fpcsrc/rtl/inc/except.inc $0055B80C fpc_reraise, line 266 of C:/lazarus/source/fpcbuild/2.0.4/fpcsrc/rtl/inc/except.inc $00401134 main, line 26 of LpSolveIDE.lpr $0055B59E EXE_ENTRY, line 420 of system.pp _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Form streaming error
On Fri, 12 Jan 2007 16:46:54 +0100 (CET) [EMAIL PROTECTED] wrote: > I'm porting a delphi app to lazarus. But when I try to run the app it > keeps crashing with the below message. > > I suspect the LRS file is corrupt, but I have no idea how to check or > better fix this. I tried removing the LRS file several times and save > the project which recreates the LRS file. But that does not help > unfortunately. Does anyone have an idea? I'm using lazarus 0.9.20 and > fpc 2.0.4. The .lrs file is simply a converted .lfm file. I doubt it is 'corrupt', but it can contain properties/values that does not exist/make sense. see below > Darius > > > [InitComponent] TMainForm True > [InitComponent] TForm True > [InitComponent] CompResource found for TMainForm > Form Stream "TMainForm" Signature=TPF0 > Form streaming "TMainForm" error: Class " " not found 'Class " " not found' is a TReader error. TReader seldom gives helpful error messages. Can you open the form in the IDE? Mattias > [FORMS.PP] ExceptionOccurred > Sender=EAccessViolation > Exception=Access violation > Stack trace: > $00453A59 TCUSTOMACTION__SETCHECKED, line 102 of > ./include/customaction.inc > $0040E189 TMAINFORM__SETMODE, line 856 of main.pas > $00412F2A TMAINFORM__FORMCREATE, line 1955 of main.pas > $00404DB9 TCUSTOMFORM__DOCREATE, line 614 > of ./include/customform.inc $0040656C TCUSTOMFORM__CREATE, line > 1297 of ./include/customform.inc $0040C0D2 > TAPPLICATION__CREATEFORM, line 1523 of ./include/application.inc > $004010AB main, line 32 of LpSolveIDE.lpr > TApplication.HandleException Access violation > Stack trace: > $00453A59 TCUSTOMACTION__SETCHECKED, line 102 of > ./include/customaction.inc > $0040E189 TMAINFORM__SETMODE, line 856 of main.pas > $00412F2A TMAINFORM__FORMCREATE, line 1955 of main.pas > $00404DB9 TCUSTOMFORM__DOCREATE, line 614 > of ./include/customform.inc $0040656C TCUSTOMFORM__CREATE, line > 1297 of ./include/customform.inc $0040C0D2 > TAPPLICATION__CREATEFORM, line 1523 of ./include/application.inc > $004010AB main, line 32 of LpSolveIDE.lpr > [InitComponent] TPromptDialog True > [InitComponent] TForm True > Runtime error 217 at $0055FA22 > $0055FA22 DOUNHANDLEDEXCEPTION, line 156 of > C:/lazarus/source/fpcbuild/2.0.4/fpcsrc/rtl/inc/except.inc > $0055B80C fpc_reraise, line 266 of > C:/lazarus/source/fpcbuild/2.0.4/fpcsrc/rtl/inc/except.inc > $00401134 main, line 26 of LpSolveIDE.lpr > $0055B59E EXE_ENTRY, line 420 of system.pp > > > > _ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject >archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] illegal qualifier problem arose to a newbie
Oh, I fixed it. Compiler couldn't find TDate class because it is in a different unit. I added that unit to uses clause where I am using and everything is ok now. Thanks for everything. Happy coding... Darius Blaszijk yazmış: I just checked the sources and there is no TDate class available in FPC/Lazarus, and I doubt (as Joost did) that Delphi has it but I'm not shure. You never actually mentioned what exact error message you get. Can you post it here? Darius - Original Message - From: "Sönmez Kartal" <[EMAIL PROTECTED]> To: Sent: Saturday, January 13, 2007 4:03 PM Subject: Re: [lazarus] illegal qualifier problem arose to a newbie Hi, Yeah, I forgot to write it. TheDay is a field in the form class. Anyway, this doesn't matter. I wondered about why I cannot assign an object or access a field. But, Delphi code from the book's source is compiled well. I will lookup that pages Lee sent links before you. Thanks, Joost. Joost van der Sluis yazmış: On Sat, 2007-01-13 at 14:24 +0200, Sönmez Kartal wrote: Hello, I am new to Lazarus. I have a book named Mastering Delphi 7 by Marco Cantu. I got an error when I tried to compile an example. procedure TDateForm.FormCreate(Sender: TObject); begin TheDay := TDate.Create(); TheDay.SetValue(2007,1,13); end; Well, this won't compile in Delphi either. First of all you'll need to define the TheDay variable. Secondly, I don't know any object-type (so that you can call it's constructor create) which is called TDate. So probably Marco Cantu has defined his own class TDate, and defined a variable TheDay somewhere. (Probably somewhere in TDateForm?) Joost _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] illegal qualifier problem arose to a newbie
I just checked the sources and there is no TDate class available in FPC/Lazarus, and I doubt (as Joost did) that Delphi has it but I'm not shure. You never actually mentioned what exact error message you get. Can you post it here? Darius - Original Message - From: "Sönmez Kartal" <[EMAIL PROTECTED]> To: Sent: Saturday, January 13, 2007 4:03 PM Subject: Re: [lazarus] illegal qualifier problem arose to a newbie Hi, Yeah, I forgot to write it. TheDay is a field in the form class. Anyway, this doesn't matter. I wondered about why I cannot assign an object or access a field. But, Delphi code from the book's source is compiled well. I will lookup that pages Lee sent links before you. Thanks, Joost. Joost van der Sluis yazmış: On Sat, 2007-01-13 at 14:24 +0200, Sönmez Kartal wrote: Hello, I am new to Lazarus. I have a book named Mastering Delphi 7 by Marco Cantu. I got an error when I tried to compile an example. procedure TDateForm.FormCreate(Sender: TObject); begin TheDay := TDate.Create(); TheDay.SetValue(2007,1,13); end; Well, this won't compile in Delphi either. First of all you'll need to define the TheDay variable. Secondly, I don't know any object-type (so that you can call it's constructor create) which is called TDate. So probably Marco Cantu has defined his own class TDate, and defined a variable TheDay somewhere. (Probably somewhere in TDateForm?) Joost _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] illegal qualifier problem arose to a newbie
Hi, Yeah, I forgot to write it. TheDay is a field in the form class. Anyway, this doesn't matter. I wondered about why I cannot assign an object or access a field. But, Delphi code from the book's source is compiled well. I will lookup that pages Lee sent links before you. Thanks, Joost. Joost van der Sluis yazmış: On Sat, 2007-01-13 at 14:24 +0200, Sönmez Kartal wrote: Hello, I am new to Lazarus. I have a book named Mastering Delphi 7 by Marco Cantu. I got an error when I tried to compile an example. procedure TDateForm.FormCreate(Sender: TObject); begin TheDay := TDate.Create(); TheDay.SetValue(2007,1,13); end; Well, this won't compile in Delphi either. First of all you'll need to define the TheDay variable. Secondly, I don't know any object-type (so that you can call it's constructor create) which is called TDate. So probably Marco Cantu has defined his own class TDate, and defined a variable TheDay somewhere. (Probably somewhere in TDateForm?) Joost _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] illegal qualifier problem arose to a newbie
On Sat, 2007-01-13 at 14:24 +0200, Sönmez Kartal wrote: > Hello, > > I am new to Lazarus. I have a book named Mastering Delphi 7 by Marco > Cantu. I got an error when I tried to compile an example. > > procedure TDateForm.FormCreate(Sender: TObject); > begin >TheDay := TDate.Create(); >TheDay.SetValue(2007,1,13); > end; Well, this won't compile in Delphi either. First of all you'll need to define the TheDay variable. Secondly, I don't know any object-type (so that you can call it's constructor create) which is called TDate. So probably Marco Cantu has defined his own class TDate, and defined a variable TheDay somewhere. (Probably somewhere in TDateForm?) Joost _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] illegal qualifier problem arose to a newbie
Hi, thanks for reply back. That code part was an example that is intented to understand encapsulation. EncodeDate method was used in an inner method in the class. I asked that because there is a problem that I cannot access a member of an object and wondered why I can't access it. TheDay is declared in the private area of class. Thanks Lee. Lee Jenkins yazmış: Sönmez Kartal wrote: Hello, I am new to Lazarus. I have a book named Mastering Delphi 7 by Marco Cantu. I got an error when I tried to compile an example. procedure TDateForm.FormCreate(Sender: TObject); begin TheDay := TDate.Create(); TheDay.SetValue(2007,1,13); end; What not something like this? procedure TDateForm.FormCreate(sender: TObject); begin TheDay := EncodeDate(2007,1,13); end; This is assuming that the "TheDay" var is declared in the form where it is accessible. This may help as well: http://www.taoyue.com/tutorials/pascal/contents.html http://packetstormsecurity.nl/programming-tutorials/Pascal/pascal-tutorial/paslist.htm _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] illegal qualifier problem arose to a newbie
Sönmez Kartal wrote: Hello, I am new to Lazarus. I have a book named Mastering Delphi 7 by Marco Cantu. I got an error when I tried to compile an example. procedure TDateForm.FormCreate(Sender: TObject); begin TheDay := TDate.Create(); TheDay.SetValue(2007,1,13); end; What not something like this? procedure TDateForm.FormCreate(sender: TObject); begin TheDay := EncodeDate(2007,1,13); end; This is assuming that the "TheDay" var is declared in the form where it is accessible. This may help as well: http://www.taoyue.com/tutorials/pascal/contents.html http://packetstormsecurity.nl/programming-tutorials/Pascal/pascal-tutorial/paslist.htm -- Warm Regards, Lee _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] illegal qualifier problem arose to a newbie
Hello, I am new to Lazarus. I have a book named Mastering Delphi 7 by Marco Cantu. I got an error when I tried to compile an example. procedure TDateForm.FormCreate(Sender: TObject); begin TheDay := TDate.Create(); TheDay.SetValue(2007,1,13); end; At first line of body of the method, compiler says there is an illegal qualifier. I looked to old archieves, wiki and forums but couldn't notice a post. At a forum, someone told there is a pointer type variable for same error but little different code. I noticed that guy meant to use ^. as qualifier but It didn't work. Also, he/she told about reference types and Delphi dereferences variables automically which is not going same for Lazarus or FPC. I read, coders have to add parenthesis to every method call, even if it doesn't has any parameters, that is why I added parenthesis when calling Create. Is this right? I have knowledge about C# and Java. If you tell me what I miss, maybe giving example from C# and Java could make it easier to understand. Thanks _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] utf8toansi
Hello, have a problem with the function utf8toansi. I'm using kubuntu 6.10 with german utf8 locale. I get an input from a Gtk2 TEdit component including special characters like "äöü". I save this input to an ansistring. Then I want to write this string to a file in ansi format. But also when I do utf8toansi before writing the ansitring to file all special characters are encoded with 2 bytes as I see with hexedit. What am I doing wrong here? Sebastian _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Compile Error for TiOPF components
Graeme Geldenhuys wrote: > On 1/13/07, Al Boldi <[EMAIL PROTECTED]> wrote: > > If you are verse in OOP, there is really no need for an OPF, as an OPF > > only aids you in plumbing up your classes, while limiting you to the > > extent of the specific BusinessObject. > > I think you are missing the point of a OPF framework completely! The > OPF framework is there to persist (save) you objects to permanent > storage. Be that a text file (XML, CSV, TAB, etc) or a relational > database (Firebird, Oracle, DB2, etc). And if the OPF framework is > design correctly (as in the case of tiOPF) you can change the back-end > database even at runtime and nothing else needs to change in your > business objects or application. One of the demos in tiOPF is where > you load data from a CSV file, change the backend persistence layer > while the app is running and then save the data again, but this time > into a Firebird DB. All with 3 lines of code. > > You should be able to say APerson.Save and not care how it gets saved, > but knowing that it has been done. You can do that with TTable/TQuery too, and with TClientDataSet you can even do it in a disconnected way, and then reconnect to the backend of your choice with less than 3 lines of code. OPF is really meant as a glue between OOP and the DBMS, to yield an ODBMS interface on the client side, for seamless OOP to DBMS integration. This may save you some coding, but only for the price of an additional setup of object properties, as OFP introduces yet another layer. > The tiOPF base classes also do not limit you in any way regarding your > Business Object design. For example the tiOPF framework doesn't use > Interfaces at all. I wanted that, so created my own > TInterfacedTIObject descending from the tiOPF's base TtiObject class. > This helped me implement Event Listeners like Java does. I implemented > the Observer pattern based on Interfaces instead of Objects. Sure, you can always extend, but what did you gain from using the OPF? > Also an OPF normally has some really useful helper functions you can > use. In the case of tiOPF, have a look in Core/tiUtils.pas or > GUI/tiGUIUtils.pas Ok, you gained these helpers, but if they are specific to the OPF, they cause you to be locked into TiOPF. A standardized OPF interface could probably address these shortcomings. > I'm not done converting the documentation to fpdoc format, but the > full documentation is in the .pas units. Have a look at: > http://opensoft.homeip.net/tiopf/core/tiutils/index-5.html > > > I would rather see some work put into a powerful Class-Editor, inlined > > into > > InstantObjects is know for there GUI class editors, but the > InstantObjects framework has other limitations I cannot live with, > where tiOPF doesn't have that problem. I have thought of creating GUI > class editors for Lazarus and the tiOPF framework but decided it > wasn't needed. I have an extensive set of "code templates" in Lazarus > which allows me to build my business objects in seconds. > > For example. > I type: poa > > and get a complete class layout. I have the same for the > implementation section of my classes and for my SQL visitors. By the > way, poa stands for "Persistent Object Abstract" :-) Yes, good example. We need more code helpers. > > the IDE, while being able to import/export UML. > > I spoke to someone at the end of last year in this mailing list or in > the fpc-pascal mailing list (can't remember), where they started UML > support in Lazaras. Exporting UML from code, etc.. Great! Thanks! -- Al _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Compile Error for TiOPF components
On 1/13/07, Al Boldi <[EMAIL PROTECTED]> wrote: If you are verse in OOP, there is really no need for an OPF, as an OPF only aids you in plumbing up your classes, while limiting you to the extent of the specific BusinessObject. I think you are missing the point of a OPF framework completely! The OPF framework is there to persist (save) you objects to permanent storage. Be that a text file (XML, CSV, TAB, etc) or a relational database (Firebird, Oracle, DB2, etc). And if the OPF framework is design correctly (as in the case of tiOPF) you can change the back-end database even at runtime and nothing else needs to change in your business objects or application. One of the demos in tiOPF is where you load data from a CSV file, change the backend persistence layer while the app is running and then save the data again, but this time into a Firebird DB. All with 3 lines of code. You should be able to say APerson.Save and not care how it gets saved, but knowing that it has been done. The tiOPF base classes also do not limit you in any way regarding your Business Object design. For example the tiOPF framework doesn't use Interfaces at all. I wanted that, so created my own TInterfacedTIObject descending from the tiOPF's base TtiObject class. This helped me implement Event Listeners like Java does. I implemented the Observer pattern based on Interfaces instead of Objects. Also an OPF normally has some really useful helper functions you can use. In the case of tiOPF, have a look in Core/tiUtils.pas or GUI/tiGUIUtils.pas I'm not done converting the documentation to fpdoc format, but the full documentation is in the .pas units. Have a look at: http://opensoft.homeip.net/tiopf/core/tiutils/index-5.html I would rather see some work put into a powerful Class-Editor, inlined into InstantObjects is know for there GUI class editors, but the InstantObjects framework has other limitations I cannot live with, where tiOPF doesn't have that problem. I have thought of creating GUI class editors for Lazarus and the tiOPF framework but decided it wasn't needed. I have an extensive set of "code templates" in Lazarus which allows me to build my business objects in seconds. For example. I type: poa and get a complete class layout. I have the same for the implementation section of my classes and for my SQL visitors. By the way, poa stands for "Persistent Object Abstract" :-) the IDE, while being able to import/export UML. I spoke to someone at the end of last year in this mailing list or in the fpc-pascal mailing list (can't remember), where they started UML support in Lazaras. Exporting UML from code, etc.. -- Graeme Geldenhuys There's no place like S34° 03.168' E018° 49.342' _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Compile Error for TiOPF components
On 1/13/07, Nataraj S Narayan <[EMAIL PROTECTED]> wrote: The point is that I havent till now developed any code using 3 tier approach. Even during my Delphi days. I remember having used 'Raize Not sure if I'm understanding what you mean my 3-tier approach. I write client/server applications. Is anybody using actual object model in Lazarus ? I mean, classes for say 'Purchase Orders' - which will have the modules for persistance like TQuery /TTable ,defined inside the PO class? Having TTable inside you business object. Hell, that doesn't sound like a good design at all! If you want to use standard database components like a TDBGrid etc you can do that as well with tiOPF. There is a unit called tiDataset that maps you business objects to a TDataset that the database components can understand. Maybe you should browse through the Demos available in the tiOPF repository. http://tiopf.svn.sourceforge.net/viewvc/tiopf/tiOPF2_Demos/ To get the source use: svn co https://svn.sourceforge.net/svnroot/tiopf/tiOPF2_Demos tiOPF2_Demos If you can't find what you are looking for, please post your question in the tiopf.support newsgroup. More details can be found at: http://www.techinsite.com.au/tiOPF/Support.htm The tiOPF documentation is also very good. http://www.techinsite.com.au/tiOPF/Doc/Default.htm It still refers to v1 instead of v2 so a few class names have changed, but the functionality is still there. I hear that biggest issue is to map object model to relational model. Which tool is the best to be used with lazarus/fpc? Again, tiOPF supports this 100%. You can even use the "automapping" feature where tiOPF will generate the SQL statements for you. The SQL in not always the most optimised (a general problem most SQL generating frameworks) but will get you going fast. You can then later fix the bottleneck areas with "hard-coded visitors" which means you can write the SQL yourself to improve performance. -- Graeme Geldenhuys There's no place like S34° 03.168' E018° 49.342' _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Compile Error for TiOPF components
Nataraj S Narayan wrote: > > Is anybody using actual object model in Lazarus ? I mean, classes for > say 'Purchase Orders' - which will have the modules for persistance like > TQuery /TTable ,defined inside the PO class? > > I hear that biggest issue is to map object model to relational model. > Which tool is the best to be used with lazarus/fpc? Try this: http://www.instantobjects.org If you are verse in OOP, there is really no need for an OPF, as an OPF only aids you in plumbing up your classes, while limiting you to the extent of the specific BusinessObject. I would rather see some work put into a powerful Class-Editor, inlined into the IDE, while being able to import/export UML. Thanks! -- Al _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives