[Lazarus] Delphi On Rails
Osvaldo Filho
arquivostcf at gmail.com
Sat Nov 28 19:27:26 CET 2009
On Windows XP
With lazarus 0.9.28.3 and fpc 2.2.4 i do not have this error;
But with 0.9.29 and 2.3.1 i have!
Any idea?
==========================
C:\componentes\UserControl\package\lazarus\UCBase.pas(1180,68) Error:
Can't take the address of constant expressions
function TUserControl.AddUser(Login, Password, _Name, Mail: String;
Profile: Integer; PrivUser: Boolean) : Integer;
var
Key : String;
begin
with DataConnector.UCGetSQLDataset('Select
Max('+TableUsers.FieldUserID+') as IdUser from ' +
TableUsers.TableName) do
begin
if FieldByName('idUser').AsString = '' then Result := 1
else Result := Fieldbyname('idUser').AsInteger + 1;
Close;
Free;
end;
Key := Encrypt( IntToStr(Result)+Login+Password, EncryptKey );
with TableUsers do
DataConnector.UCExecSQL(Format('Insert into %s( %s, %s, %s, %s,
%s, %s, %s, %s, %s) VALUES(%d, %s, %s, %s, %s, %s, %d, %s, %s)',
[ TableName,
FieldUserID, FieldUserName, FieldLogin, FieldPassword,
FieldEmail, FieldPrivileged, FieldProfile, FieldTypeRec, FieldKey,
Result, QuotedStr(Name), QuotedStr(Login),
QuotedStr(Encrypt(Password, EncryptKey)),
QuotedStr(Mail), BoolToStr(PrivUser), Profile,
QuotedStr('U'), QuotedStr(Key)]));
if Assigned(OnAddUser) then OnAddUser(Self, Login, Password, Name,
Mail, Profile, Privuser);
end;
=======================================================
unit UCBase;
{$mode DELPHI}
{.$mode objfpc}{$H+}
interface
uses
LCLIntf, LResources, UCDataInfo, SysUtils, Classes, Menus, ActnList,
UCMessages, Controls, UCConsts, Graphics, DB, Forms;
More information about the Lazarus
mailing list