I understand Assigned as being the same as nil, so Assigned(Object)
= Object nil
I vaguely remember that it could be safer in some corner case, but I
don't remember ever meting that.
Free is how you release the memory allocated for a object. Free calls
Destroy. Never call Destroy manually.
22.10.2011 10:20, Felipe Monteiro de Carvalho пишет:
I understand Assigned as being the same as nil, so Assigned(Object)
= Object nil
I vaguely remember that it could be safer in some corner case, but I
don't remember ever meting that.
Method pointers?
On 22 October 2011 07:20, Felipe Monteiro de Carvalho
felipemonteiro.carva...@gmail.com wrote:
I understand Assigned as being the same as nil, so Assigned(Object)
= Object nil
I vaguely remember that it could be safer in some corner case, but I
don't remember ever meting that.
Free is
Nil is not a routine, it is a value, it means that the object
is empty, it does not exist / is not allocated. Nil in
existing implementations that I know is represented by the value zero.
The typical life-cycle of a object is:
MyObject := TMyObject.Create;
try
When the loop runs again Assigned in InitVars is false so as soon as those
FBreakStrings and SCStrings are accessed within the loop a SIGSEGV occurs.
So what I want to know is whether Assigned remains true when Free is
executed.
See my previous answer.
There is a helper function
On 22 October 2011 08:14, Ludo Brands ludo.bra...@free.fr wrote:
Nil is not a routine, it is a value, it means that the object
is empty, it does not exist / is not allocated. Nil in
existing implementations that I know is represented by the value zero.
The typical life-cycle of a object
Hello,
Instead of .Free in your FreeVars routine, you should use FreeAndNil(
theobject).
The correct lifecycle for class objects is :
var
anObject : TMyObject;
begin
anObject := nil; //not needed for class attributes. Required for local
function or global unit variables.
anObject :=
Does that mean that Free itself reclaims the memory used by the object's
fields and properties but does not release the memory used by the TObject or
pointer itself, where as setting it to nil or executing Destroy does, or
does Destroy do something different?
All memory is released
On Sat, Oct 22, 2011 at 9:36 AM, Frank Church vfcli...@gmail.com wrote:
Does that mean that Free itself reclaims the memory used by the object's
fields and properties but does not release the memory used by the TObject or
pointer itself, where as setting it to nil or executing Destroy does, or
2011/10/22 Gregory M. Turner g...@malth.us
Taking these terms in the broadest sense possible, wouldn't we say that OOP
is mostly a functional development paradigm?
Not a rhetorical question, I seriously am not sure.
OP's somewhat idiosyncratic requirement to put all the OOP metadata in a
Felipe Monteiro de Carvalho wrote:
Free is how you release the memory allocated for a object. Free calls
Destroy. Never call Destroy manually. When you implement the
destructor you always implement Destroy, never change Free.
A number of years ago, Matthew Jones's wife looked over his
In our previous episode, Felipe Monteiro de Carvalho said:
Nil is not a routine, it is a value, it means that the object is
empty, it does not exist / is not allocated. Nil in existing
implementations that I know is represented by the value zero.
Look better in, euh, Free Pascal, and see what
Hello,
Yet another chapter of my database problems =)
Ok, now I want to insert a record in my table and I would like to
obtain the auto-generated PrimaryKey
I tryed a number of options:
SQLGameSession.Insert();
SQLGameSession.Edit;
SQLGameSession.FieldByName('GameEvent').AsInteger :=
Hello,
Ok, searching some more I see that select scope_identity() could
return the generated primary key. But how to get the value?
DBComm.PQConnection.ExecuteDirect(SQLText);
The method above has no return value =(
--
Felipe Monteiro de Carvalho
On Sat, 22 Oct 2011, Felipe Monteiro de Carvalho wrote:
Hello,
Yet another chapter of my database problems =)
Ok, now I want to insert a record in my table and I would like to
obtain the auto-generated PrimaryKey
I tryed a number of options:
SQLGameSession.Insert();
SQLGameSession.Edit;
In our previous episode, Felipe Monteiro de Carvalho said:
Ok, now I want to insert a record in my table and I would like to
obtain the auto-generated PrimaryKey
This is a classic problem, since SQL simply doesn't support this.
So all DBs do something else, for postgresql there are sequence
On Sat, 22 Oct 2011, Marco van de Voort wrote:
In our previous episode, Felipe Monteiro de Carvalho said:
Ok, now I want to insert a record in my table and I would like to
obtain the auto-generated PrimaryKey
This is a classic problem, since SQL simply doesn't support this.
So all DBs do
On Sat, 22 Oct 2011, Felipe Monteiro de Carvalho wrote:
Hello,
Ok, searching some more I see that select scope_identity() could
return the generated primary key. But how to get the value?
DBComm.PQConnection.ExecuteDirect(SQLText);
The method above has no return value =(
Use a TSQLQuery
Ok, searching some more I see that select scope_identity() could
return the generated primary key. But how to get the value?
Better use the RETURNING* clause** as it clearly state the column
value you are expecting; The scope_identity() may be a source of
subtle bugs that are
difficult to
On Saturday 22 October 2011 15.21:40 Marco van de Voort wrote:
In our previous episode, Felipe Monteiro de Carvalho said:
Ok, now I want to insert a record in my table and I would like to
obtain the auto-generated PrimaryKey
This is a classic problem, since SQL simply doesn't support this.
On Sat, 22 Oct 2011, Martin Schreiber wrote:
On Saturday 22 October 2011 15.21:40 Marco van de Voort wrote:
In our previous episode, Felipe Monteiro de Carvalho said:
Ok, now I want to insert a record in my table and I would like to
obtain the auto-generated PrimaryKey
This is a classic
On Sat, Oct 22, 2011 at 3:33 PM, michael.vancann...@wisa.be wrote:
2. or sequences, which must be generated manually before the insert (DB2,
Oracle, Firebird) using a special
API, but which may or may not be generated in an AFTER INSERT trigger.
In which case it's impossible to retrieve
On Sat, 22 Oct 2011, Felipe Monteiro de Carvalho wrote:
On Sat, Oct 22, 2011 at 3:33 PM, michael.vancann...@wisa.be wrote:
2. or sequences, which must be generated manually before the insert (DB2,
Oracle, Firebird) using a special
API, but which may or may not be generated in an AFTER
In our previous episode, michael.vancann...@wisa.be said:
Ok, now I want to insert a record in my table and I would like to
obtain the auto-generated PrimaryKey
This is a classic problem, since SQL simply doesn't support this.
So all DBs do something else, for postgresql there are
On Saturday 22 October 2011 16.20:13 Michael Van Canneyt wrote:
Note that I did not invest this stuff ... I just copied from stuff to
create other tables which were already in the project.
You must get a value first, and pass it along to the insert statement.
Auto-generation is not
On Sat, 22 Oct 2011, Marco van de Voort wrote:
In our previous episode, michael.vancann...@wisa.be said:
Ok, now I want to insert a record in my table and I would like to
obtain the auto-generated PrimaryKey
This is a classic problem, since SQL simply doesn't support this.
So all DBs do
On Sat, 22 Oct 2011, Martin Schreiber wrote:
On Saturday 22 October 2011 16.20:13 Michael Van Canneyt wrote:
Note that I did not invest this stuff ... I just copied from stuff to
create other tables which were already in the project.
You must get a value first, and pass it along to the
Afaik Zeos manages to abstract this for all these dbs by having a
sequence object.
I fail to see how it can do that. E.g. the mechanism by
Martin is just a trick to update
a field value after an insert/update. That's a fine/useful
mechanism, but not what I'd call
'abstracting'.
On Sat, Oct 22, 2011 at 11:21 AM, michael.vancann...@wisa.be wrote:
DBComm.SQLTransaction.StartTransaction; -- Fails here with
transaction already active
Correct. The default transaction is made active after connecting.
You should call StartTransaction on this transaction only after a
On Sat, Oct 22, 2011 at 11:35 AM, Inoussa OUEDRAOGO inouss...@gmail.com wrote:
Ok, searching some more I see that select scope_identity() could
return the generated primary key. But how to get the value?
Better use the RETURNING* clause** as it clearly state the column
value you are
ugh, any ideas how I can obtain the next sequence value using sqldb
and postgres then?
I have never used sequence values before, and while I am googling I
only found either answers which are specific for a particular
framework (java, djambo, whatever) or people claiming that it should
generate
On Sat, Oct 22, 2011 at 1:33 PM, Felipe Monteiro de Carvalho
felipemonteiro.carva...@gmail.com wrote:
ugh, any ideas how I can obtain the next sequence value using sqldb
and postgres then?
I have never used sequence values before, and while I am googling I
only found either answers which are
On Sat, 22 Oct 2011, Felipe Monteiro de Carvalho wrote:
ugh, any ideas how I can obtain the next sequence value using sqldb
and postgres then?
I have never used sequence values before, and while I am googling I
only found either answers which are specific for a particular
framework (java,
On Sat, 22 Oct 2011, Ludo Brands wrote:
Afaik Zeos manages to abstract this for all these dbs by having a
sequence object.
I fail to see how it can do that. E.g. the mechanism by
Martin is just a trick to update
a field value after an insert/update. That's a fine/useful
mechanism, but not
On Saturday 22 October 2011 17.23:38 Marcos Douglas wrote:
On Sat, Oct 22, 2011 at 11:21 AM, michael.vancann...@wisa.be wrote:
DBComm.SQLTransaction.StartTransaction; -- Fails here with
transaction already active
Correct. The default transaction is made active after connecting.
You
On Sat, Oct 22, 2011 at 1:53 PM, Martin Schreiber mse00...@gmail.com wrote:
On Saturday 22 October 2011 17.23:38 Marcos Douglas wrote:
On Sat, Oct 22, 2011 at 11:21 AM, michael.vancann...@wisa.be wrote:
DBComm.SQLTransaction.StartTransaction; -- Fails here with
transaction already active
On Saturday 22 October 2011 17.33:11 Felipe Monteiro de Carvalho wrote:
ugh, any ideas how I can obtain the next sequence value using sqldb
and postgres then?
I have never used sequence values before, and while I am googling I
only found either answers which are specific for a particular
Ok, thanks a lot =)
On 10/22/11, Michael Van Canneyt mich...@freepascal.org wrote:
... And mainly the reason I think it is not abstractable... :-)
In this case I would suggest to abstract it like this:
// ASequenceName - The name of the sequence for usage in Postgres,
etc. Ignored for MSSQL,
On 22/10/2011, Felipe Monteiro de Carvalho wrote:
Yet another chapter of my database problems =)
As this message thread proves, there are many issues with Auto-inc
field, so simply DON'T USE THEM!
You have many alternatives, which will save you LOTS of grey hairs.
Auto-Inc field are just
Hi,
Is anybody here using the Indy 10 components with FPC? More
specifically, the HTTP Server component. My project compiles fine, but
when I activate the HTTP Server I get the following error.
Socket error # 98. Address already in use.
I know that under Linux, if you use a port 1024 you must
In our previous episode, Graeme Geldenhuys said:
Is anybody here using the Indy 10 components with FPC? More
specifically, the HTTP Server component. My project compiles fine, but
when I activate the HTTP Server I get the following error.
Socket error # 98. Address already in use.
I know
Error: bPreparation of query failed. (PostgreSQL: ERROR:
column GameSession_SessionId_seq does not exist LINE 1:
prepare prepst2 as SELECT nextval(GameSession_SessionId_se...
SQLGameSession.SQL.Text:='SELECT
nextval(GameSession_SessionId_seq) as res;';
Nextval takes a regclass as
On Sat, Oct 22, 2011 at 9:38 PM, Ludo Brands ludo.bra...@free.fr wrote:
Nextval takes a regclass as parameter, not an identifier (column). So, use
single quotes: SELECT nextval('GameSession_SessionId_seq') as res;
But Postgres requires double quotes or else it will lowercase the
entire
On 22/10/2011, Marco van de Voort wrote:
I haven't tried for years, but I can remember some strange problems
designtime that went away if you manually added a tidbinding in formcreate.
I'm not using design-time usage at all, everything is done manually via code.
I'm creating a TIdHTTPServer
In our previous episode, Graeme Geldenhuys said:
designtime that went away if you manually added a tidbinding in formcreate.
I'm not using design-time usage at all, everything is done manually via code.
I'm creating a TIdHTTPServer instance via code, set the port, one
basic event handler,
Hi,
I was looking through the FCL code and noticed that there seems to be
more than one HTTP server component. What is the difference between
them, and which one would be the better option as the basis for a HTTP
based n-tier application server (for use with tiOPF).
I found the recent one
46 matches
Mail list logo