Re: [fpc-pascal] Mozilla XPCOM
On 09/06/10 15:50, Marcos Douglas wrote: On Tue, Jun 8, 2010 at 3:44 PM, Luiz Americo Pereira Camara wrote: Marcos Douglas escreveu: Exactly. Therefore I always used 'const' only at 'strings' params. I thought it had changed, but not. ;-) It can be useful for record parameters also If the record have strings, I think. Surely it's for any parameter which the called procedure does not change, which would be more efficiently passed as a reference? That would include any record larger than a few bytes, and arrays. FP ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Missing GetLastOSError() in DOS and MacOS
On 10 Jun 2010, at 06:29, Bihar Anwar wrote: Also, I notice that SysUtils.GetLastOSError() in MacOS is defined but it's implementation is empty. I've no knowledge on MacOS, so my question is... Is this by designed? "MacOS" in the RTL stands for "System 7.5 - Mac OS 9.2.x", i.e., the "classic Mac OS" which preceded Mac OS X. I don't think the sysutils unit was ever completely ported for that platform. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] how to use odbc Allow multiple statements
On Thu, 10 Jun 2010, Graeme Geldenhuys wrote: Op 2010-06-10 08:23, Michael Van Canneyt het geskryf: Just use 2 TSQLQuery statements at once. Each will set up a connection to MySQL, as far as I remember. [...maybe he meant the following...] Is there a SQL Script component in SqlDB? So that you can pass it a DDL script file which will contain many sql statements to setup a DB or upgrade an existing one? In that case, the answer is: yes there is: TSQLScript. It will parse the script and send the SQL statements one by one to the connection. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Negative RTL Error Codes in Some Platforms
On June 10, 2010 1:46:39 PM, Tomas Hajny wrote: >If I remember correctly, it's been done in order to differentiate standard >error codes (supposedly cross-platform and mostly inherited from TP/BP) >from all other error codes which may be triggered there and which are >completely platform specific. It's well possible that this convention has >never been documented and possibly not followed in implementations for >other platforms either. However, you shouldn't rely on the returned values >too much anyway. They depend not only on the underlying platform, but >possibly partly also on the specific implementation for the particular >platform - i.e. one RTL function originally based on a single OS API call >in the DOS (TP) times may require several subsequent OS API calls in an >implementation for another platform and you wouldn't really know which of >the calls returned the value and why unless you trace the implementation. Thanks Tomas for your detail explanation. It's a logical reason. >However, you shouldn't rely on the returned values >too much anyway. No, I just rely on such a returned values in a very few cases. For example, In Windows/OS2/DOS, when FindNext() encounters the end of a directory content, it returns ERROR_NO_MORE_FILES (18 or -18); whereas in UNIX, it returns -1 and errno is not set. Thus UNIX doesn;t consider it as an error, and this is more acceptable by me. So, my file searching function will return 0 in this situation. I'm certainly sure such a convention for the basic operations will never be changed in those OSes, so I attempt to handle this. Thanks in advance. Cheers. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Missing GetLastOSError() in DOS and MacOS
June 10, 2010 3:03:45 PM, Jonas Maebe wrote: >"MacOS" in the RTL stands for "System 7.5 - Mac OS 9.2.x", i.e., the "classic >Mac OS" which preceded Mac OS X. I don't think the sysutils unit was ever completely ported for that platform. Thanks Jonas, your clarification strengthens my thought before. I saw other several defects in MacOS SysUtils, just mention the implementation of FindNext: Result:=DoFind (Rslt); // whereas DoFind() is declared as a procedure How can that be compiled? I think, I will increase the requirement of my base units to at least the MacOS X. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Missing GetLastOSError() in DOS and MacOS
On 10 Jun 2010, at 12:13, Bihar Anwar wrote: Thanks Jonas, your clarification strengthens my thought before. I saw other several defects in MacOS SysUtils, just mention the implementation of FindNext: Result:=DoFind (Rslt); // whereas DoFind() is declared as a procedure How can that be compiled? Maybe it was a function in the past. I think, I will increase the requirement of my base units to at least the MacOS X. That's definitely a good idea. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Negative RTL Error Codes in Some Platforms
On Thu, June 10, 2010 12:01, Bihar Anwar wrote: > On June 10, 2010 1:46:39 PM, Tomas Hajny wrote: . . >>However, you shouldn't rely on the returned values >>too much anyway. > > No, I just rely on such a returned values in a very few cases. For > example, In Windows/OS2/DOS, when FindNext() encounters the end of a > directory content, it returns ERROR_NO_MORE_FILES (18 or -18); whereas in > UNIX, it returns -1 and errno is not set. Thus UNIX doesn;t consider it as > an error, and this is more acceptable by me. So, my file searching > function will return 0 in this situation. I'm certainly sure such a > convention for the basic operations will never be changed in those OSes, > so I attempt to handle this. OK, this is a slightly different story then. Win32 API function FindFirst (and thus also the Delphi function FindFirst provided in SysUtils) returns the "search handle" (positive value) in case of a success and -1 in case of an error. The implementation for OS/2 and DOS passes the error information directly (rather than relying on a subsequent call to GetLastError, which is again a Win32 API call and not directly transferable, or using GetLastOSError and relying on the fact that no other OS API has been used by the RTL in the meantime), but it needs to use a negative value in order to differentiate from possitive values meaning success. The same logic is then in turn also used for FindNext (although that one does never return search handles even on Windows). Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Negative RTL Error Codes in Some Platforms
On June 10, 2010 6:12:42 PM, Tomas Hajny wrote: >OK, this is a slightly different story then. Win32 API function FindFirst >(and thus also the Delphi function FindFirst provided in SysUtils) returns >the "search handle" (positive value) in case of a success and -1 in case >of an error. The implementation for OS/2 and DOS passes the error >information directly (rather than relying on a subsequent call to >GetLastError, which is again a Win32 API call and not directly >transferable, or using GetLastOSError and relying on the fact that no >other OS API has been used by the RTL in the meantime), but it needs to >use a negative value in order to differentiate from possitive values >meaning success. The same logic is then in turn also used for FindNext >(although that one does never return search handles even on Windows). Thanks Tomas, that explanation even makes me understand this FPC decision better. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] would like to open source Ansi C parser
Hi, I've an Ansi C parser written in Delphi that has been lying around my HD for some time. It supports almost all language features and the preprocessor is almost complete too. I was wondering if there were any volunteers out there willing to continue development of this as an Open Source project. This tool may become a full fledged C Header to Pascal conversion tool. -albert ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] would like to open source Ansi C parser
On Fri, Jun 11, 2010 at 2:19 AM, Albert Almeida wrote: > I was wondering if there were any volunteers out there willing to > continue development of this as an Open Source project. This tool may > become a full fledged C Header to Pascal conversion tool. I've written an ObjC parser myself, but since it doesn't support all features of C-language, I'm interested in using other C parser. like the one here: http://sourceforge.net/projects/topas/ So, if you start the open source project, please let me know. thanks, dmitry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: how to use odbc Allow multiple statements
but can TSQLScript result as tdateset? 1: select top 1 * into #x from r_sale; select * from #x 2:declare @busno VARCHAR(10) select @busno='0001' CREATE TABLE #wareid .. select * from #wareid where bus...@busno ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] how to use odbc Allow multiple statements
but can TSQLScript result as tdateset? 1: select top 1 * into #x from r_sale; select * from #x 2:declare @busno VARCHAR(10) select @busno='0001' CREATE TABLE #wareid .. select * from #wareid where bus...@busno ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: how to use odbc Allow multiple statements
Op 2010-06-11 03:50, liuzg2 het geskryf: > > can TSQLScript result as tdateset? As far as I know, from experience with a similar component not from SqlDB, such SQLScript components do not return a result. They are there to execute DDL-type scripts. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal