Am 18.10.2011 21:59, schrieb Jonas Maebe:
On 18 Oct 2011, at 21:55, Sven Barth wrote:
type
TGenArrayT = array of T; // this should work in trunk already
function ConcatT(Arr1, Arr2: TGenArrayT): TGenArrayT;
begin
SetLength(Result, Length(aArray1) + Length(aArray2));
if
Am 18.10.2011 23:08, schrieb Andrew Pennebaker:
Barth, something's not quite right. I've compiled and installed the
trunk version of fpc, but it won't recognize this syntax.
paycheck.pas:
unit Paycheck;
interface
type
TArrayT = array of T;
...
Trace:
fpc example.pas
Compiling example.pas
On 18/10/2011 16:51, Michael Van Canneyt wrote:
You can always search for powtils, but as far as I know it is unmaintained.
I use powtils (aka pwu), and it works very well. We have 3 CGI apps
developed with powtils, connecting to a database backend etc. It is easy
to use and relatively easy
On 18/10/2011 21:44, Michael Van Canneyt wrote:
use DBUS to query HAL. Normally you should get most of the info.
I wrote an article on how to do this in FPC. if you want, I can send it to
you.
Would you mind sending me that article too, please.
I'm using Turbo Power's OnGuard in our
Hello,
Usually when we work with PChars we do things like this to set the
final terminator:
var
ansistr: ansistring;
begin
// Copy the originating string taking into account the specified length
SetLength(ansistr, len+1);
System.Move(source^, ansistr[1], len);
ansistr[len+1] := #0;
Am 18.10.2011 21:42, schrieb Sven Barth:
For anonymous functions you can take a look at Embarcadero's Delphi help
here:
http://docwiki.embarcadero.com/RADStudio/en/Anonymous_Methods_in_Delphi
The Embarcadero style of anonymous functions does not satify me.
myFunc := function(x, y: Integer):
On 19/10/2011 00:31, Den Jean wrote:
read the output of lshw or read its source on how to do it yourself.
problems with that is that to get most of the information you must run
lshw as super-user (root).
eg: Serial numbers, product codes, vendor names etc are all missing from
the output if you
Am 19.10.2011 09:13, schrieb Felipe Monteiro de Carvalho:
Hello,
Usually when we work with PChars we do things like this to set the
final terminator:
var
ansistr: ansistring;
begin
// Copy the originating string taking into account the specified length
SetLength(ansistr, len+1);
On Wed, October 19, 2011 09:13, Felipe Monteiro de Carvalho wrote:
Hi,
Usually when we work with PChars we do things like this to set the
final terminator:
var
ansistr: ansistring;
begin
// Copy the originating string taking into account the specified length
SetLength(ansistr,
In our previous episode, Sven Barth said:
This implementation will result in crashes if T is a reference-counted type.
Right... I tend to forget about these... what would the correct way to
copy an array of ref counted types? E.g. an array of string?
copy () ? :-)
Sven, I added the {$mode delphi} macro and prefaced each type with the
generic specification. I'm still getting errors.
paycheck.pas:
unit Paycheck;
{$mode delphi}
interface
type
generic TArrayT = array of T;
generic TFnT = function() : T;
...
Trace:
fpc example.pas
Compiling
2011/10/19 Tomas Hajny xhaj...@hajny.biz:
Sorry for a silly question, but why the difference between the two
implementations (i.e. why not addressing the WideStr element directly
without the typecast)?
Actually it should be a pointer operation in the ansistring version
too, because setting
Am 19.10.2011 09:31, schrieb Michael Fuchs:
I would prefer a style like
myfunc := @function(x, y: Integer): Integer Result := x + y;
And how would you create more complex functions? In Pascal code blocks
are started with begin and ended with end. I don't see a reason why
anonymous methods
Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com hat am 19.
Oktober 2011 um 09:13 geschrieben:
Hello,
Usually when we work with PChars we do things like this to set the
final terminator:
var
ansistr: ansistring;
begin
// Copy the originating string taking into
Hello,
On 2011-10-18 22:44, Michael Van Canneyt wrote:
use DBUS to query HAL. Normally you should get most of the info.
I wrote an article on how to do this in FPC. if you want, I can send
it to you.
Could you send it to me as well?
Regards,
Žilvinas Ledas
On Wed, Oct 19, 2011 at 10:11 AM, Mattias Gaertner
nc-gaert...@netcologne.de wrote:
I never saw such code for ansistring. Only for shortstring.
Indeed, I copied some code from the RTL and it seams that I
inadvertedly copied code for shortstring instead of ansistring =o
I fixed this in rev 32977
Hi Andrew,
first of all my /first/ name is Lukasz. Would you /like/ me to use your
surname to refer to yourself ?
Second you seem to be sending the same message twice in one post (once as
plain text the other as HTML) and quoted/printable encoding to make matters
even worse. Please teach your
On 19 Oct 2011, at 09:59, Marco van de Voort wrote:
In our previous episode, Sven Barth said:
This implementation will result in crashes if T is a reference-
counted type.
Right... I tend to forget about these... what would the correct way
to
copy an array of ref counted types? E.g. an
Am 19.10.2011 09:59, schrieb Marco van de Voort:
In our previous episode, Sven Barth said:
This implementation will result in crashes if T is a reference-counted type.
Right... I tend to forget about these... what would the correct way to
copy an array of ref counted types? E.g. an array of
Am 19.10.2011 10:01, schrieb Andrew Pennebaker:
Sven, I added the {$mode delphi} macro and prefaced each type with the
generic specification. I'm still getting errors.
Either add {$mode delphi} XOR generic
E.g.
Solution 1:
unit Foo;
interface
type
generic TGenArrayT = array of T;
...
Am 19.10.2011 10:16, schrieb Sven Barth:
I would prefer a style like
myfunc := @function(x, y: Integer): Integer Result := x + y;
And how would you create more complex functions? In Pascal code blocks
are started with begin and ended with end. I don't see a reason why
anonymous methods should
In our previous episode, Jonas Maebe said:
Right... I tend to forget about these... what would the correct way
to
copy an array of ref counted types? E.g. an array of string?
For-loops.
copy () ? :-)
copy() cannot be used to concatenate two arrays, because it is a
function
Am 18.10.2011 12:06, schrieb brian:
The first problem I see is that there are actually two makefiles in the
fpc directory, Makefile dated 31st Aug 2011 and Makefile.fpc dated 13th
Aug 2011.
This is normal. The Makefile.fpc basically contain the important parts
of the makefile (which units are
Am 19.10.2011 10:27, schrieb Jonas Maebe:
On 19 Oct 2011, at 09:59, Marco van de Voort wrote:
In our previous episode, Sven Barth said:
This implementation will result in crashes if T is a
reference-counted type.
Right... I tend to forget about these... what would the correct way to
copy
In our previous episode, Sven Barth said:
Right... I tend to forget about these... what would the correct way to
copy an array of ref counted types? E.g. an array of string?
copy () ? :-)
I thought about copy, too, but how would you implement a generic
concat using copy (or even
brian wrote:
I assume there's an expectation that the sources downloaded from trunk
should compile on all platforms?
I've just updated to 19505, and attempting to build on Linux Mint 9
64-bit causes a few problems.
The first problem I see is that there are actually two makefiles in the
fpc
Sven Barth wrote:
This seems to be related to building the textmode IDE.
If you don't need the textmode IDE you can try the following workaround:
Open the Makefile in the base directory and search for IDE=1. Remove
the 1 so that it reads IDE=. Save the file and try again. This
should stop the
Hi,
Just over 3 years ago I asked about FPC support for creating 3-tier
database applications. The answer was basically: it's not possible
(unless you roll your own Midas / Datasnap code).
TClientDataset also missed some vital features, and the state of
WebServices was also not complete.
Here
19.10.2011 12:16, Sven Barth пишет:
E.g.
TIntegerFunc = reference to function: Integer;
procedure SomeOtherProc(aFunc: TIntegerFunc);
...
procedure Foo;
var
x: Integer;
begin
x := 42;
SomeOtherProc(function: Integer; begin Result := x; end;);
end;
I haven't tested that, but from the
In our previous episode, Graeme Geldenhuys said:
Just over 3 years ago I asked about FPC support for creating 3-tier
database applications. The answer was basically: it's not possible
(unless you roll your own Midas / Datasnap code).
- kbmMW http://components4developers.com/
the author was
In function `GDBINT$_$TGDBINTERFACE_$__$$_GDB__INIT':
gdbint.pp:(.text+0xfde): undefined reference to
`deprecated_create_breakpoint_hook'
/data2/sources/subversion/fpc/packages/gdbint/units/x86_64-linux/gdbint.o:
In function `GDBINT$_$TGDBINTERFACE_$__$$_GDB_DONE':
gdbint.pp:(.text+0x103f):
On Wed, 19 Oct 2011, Graeme Geldenhuys wrote:
Hi,
Just over 3 years ago I asked about FPC support for creating 3-tier
database applications. The answer was basically: it's not possible
(unless you roll your own Midas / Datasnap code).
TClientDataset also missed some vital features, and the
On 18-10-2011 7:13, Reinier Olislagers wrote:
On 17-10-2011 20:57, Michael Van Canneyt wrote:
Would it make sense to reopen this bug?
? Eh ? If indeed it is accepted, then yes please.
Quite strange, because I implemented the SQL parser based on the
official Firebird server docs. And it
On 2011-10-19 11:23, Marco van de Voort wrote:
- kbmMW http://components4developers.com/
the author was on the Lazarus day in 2010.
Thanks, I'll take a look.
I take 3-tier above as a general framework for 3-tier, not necessarily a
Datasnap compatible layer.
Correct, it doesn't need to
On 2011-10-19 11:36, michael.vancann...@wisa.be wrote:
Out of the box: no.
OK, thanks. Do you know if TClientDataset has improved at all?
Midas is written in C++, so that's not going to happen.
I didn't know that.
OTOH the web-development part has resulted in a ready-to-use packet
On 2011-10-19 11:23, Marco van de Voort wrote:
- kbmMW http://components4developers.com/
the author was on the Lazarus day in 2010.
Strange, nowhere on the kbmMW website do I see any mention of Free
Pascal Compiler or Lazarus IDE support.
On Wed, 19 Oct 2011, Graeme Geldenhuys wrote:
On 2011-10-19 11:36, michael.vancann...@wisa.be wrote:
Out of the box: no.
OK, thanks. Do you know if TClientDataset has improved at all?
Midas is written in C++, so that's not going to happen.
I didn't know that.
OTOH the
On Wed, 19 Oct 2011, Graeme Geldenhuys wrote:
On 2011-10-19 11:23, Marco van de Voort wrote:
- kbmMW http://components4developers.com/
the author was on the Lazarus day in 2010.
Strange, nowhere on the kbmMW website do I see any mention of Free
Pascal Compiler or Lazarus IDE support.
On 2011-10-19 13:34, michael.vancann...@wisa.be wrote:
factor 6 when switching from XML to binary messaging. Not using HTTP but a
self-made TCP/IP protocol gets you another factor.
Are both the binary message format and self-made TCP/IP protocol
publicly available? Maybe that might be worth
From: Graeme Geldenhuys graemeg.li...@gmail.com
To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Wednesday, October 19, 2011 8:25 AM
Subject: Re: [fpc-pascal] 3-tier database applications with FPC
On 2011-10-19 11:36,
On Wed, 19 Oct 2011, Leonardo M. Ramé wrote:
From: Graeme Geldenhuys graemeg.li...@gmail.com
To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Wednesday, October 19, 2011 8:25 AM
Subject: Re: [fpc-pascal] 3-tier database applications with
- Original Message -
From: michael.vancann...@wisa.be michael.vancann...@wisa.be
To: Leonardo M. Ramé martinr...@yahoo.com; FPC-Pascal users discussions
fpc-pascal@lists.freepascal.org
Cc:
Sent: Wednesday, October 19, 2011 11:03 AM
Subject: Re: [fpc-pascal] 3-tier database
Hello,
I am using sqldb to connect to a postgres database. Using wiki
instructions, my final object is a TSQLQuery for each table. So, this
basically is a TDataset and to read fields I know that I can use
First(), Next(), EOF() and RecNo
But these are rather slow. Many fields in the tables refer
On Wednesday 19 October 2011 16.53:00 Felipe Monteiro de Carvalho wrote:
Hello,
I am using sqldb to connect to a postgres database. Using wiki
instructions, my final object is a TSQLQuery for each table. So, this
basically is a TDataset and to read fields I know that I can use
First(),
On 10/19/2011 07:05, Leonardo M. Ramé wrote:
- Original Message -
...snip...
I created a FastCGI based server that handles JSON requests from a
Win32/Linux GUI app, that uses a custom made ORM similar to tiOPF
and it
works really fast, even on slow-long distance networks. I
Hmm... I'm not really sure though, but I guess you could make use of array
of const feature. See the documentation here:
http://www.freepascal.org/docs-html/ref/refsu60.html
--
View this message in context:
Am 19.10.2011 10:16, schrieb Sven Barth:
Am 19.10.2011 09:31, schrieb Michael Fuchs:
I would prefer a style like
myfunc := @function(x, y: Integer): Integer Result := x + y;
And how would you create more complex functions? In Pascal code blocks
are started with begin and ended with end. I
Right, I tried just {$mode delphi} and just generic, and when both failed I
tried them at the same time.
Maybe I'm not using a recent enough version?
Free Pascal Compiler version 2.4.4 [2011/05/01] for i386
Cheers,
Andrew Pennebaker
www.yellosoft.us
On Wed, Oct 19, 2011 at 4:34 AM, Sven Barth
Am 19.10.2011 10:49, schrieb Sven Barth:
Am 19.10.2011 10:27, schrieb Jonas Maebe:
On 19 Oct 2011, at 09:59, Marco van de Voort wrote:
In our previous episode, Sven Barth said:
This implementation will result in crashes if T is a
reference-counted type.
Right... I tend to forget about
Practical uses for referencable anonymous functions:
(map f collection)
This is the prototypical way to run a function over each element in a
collection, returning the results.
Example:
(map (lambda (x) (+ x 1)) '(1 2 3))
- (2 3 4)
(sort compare collection)
When dealing with complex data
Am 19.10.2011 20:23, schrieb Andrew Pennebaker:
Practical uses for referencable anonymous functions:
For such applications one uses procedure variables in pascal.
(map f collection)
This is the prototypical way to run a function over each element in a
collection, returning the results.
Am 19.10.2011 20:30, schrieb Florian Klämpfl:
I still don't see why this cannot be done by procedure variables: one
can easily pass a procedure reference to a compare function to any sort
library call.
It is maybe easier to write a anonymous function inline than declaring a
function and
From what I gather, procedure variables can indeed be referenced and passed
around, etc.
However, procedures do not return anything, so it's hard to chain them. In
functional languages, it's handy to do several nested map(map(map f ...
calls.
Cheers,
Andrew Pennebaker
www.yellosoft.us
On Wed,
53 matches
Mail list logo