[Lazarus] SQLite Vacuum Error Cannot rollback - no transaction is active

2013-11-25 Thread mulcamd
At the end of some database maintenance where I drop several tables I want
to Vacuum the SQLite database.

 

I use the code below and this works fine, however when I close the program I
get the error:

Project project1 raised exception class 'EDatabaseError' with message:

Cannot rollback - no transaction is active.

 

Question: how can I Vacuum the database and close the program without
errors?

 

The code (which gives no error when run):

procedure TForm1.VacuumButtonClick(Sender: TObject);

begin

SQLite3Connection.DatabaseName:='A.db';

SQLTransaction1.Database:=SQLite3Connection;

SQLite3Connection.Open;

 

// Statement below must be issued, otherwise I get error
cannot VACUUM from within a transaction

SQLite3Connection.ExecuteDirect('End Transaction');  // End
the transaction started by SQLdb

SQLite3Connection.ExecuteDirect('Vacuum');

end;

 

Exit procedure which give the error message.

procedure TForm1.ExitMenuItemClick(Sender: TObject);

begin

 Application.terminate;

end;

 

BTW, when hitting the break button the cursor jumps to line 4828 
inherited Destroy; within the  destructor TControl.Destroy; in
control.inc.

I run on Windows 7 32 bits and use Lazarus 1.0.12 and FPC 2.6.2

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Writing a Lazarus program with its own display, RFB?

2013-11-25 Thread Danny Weldon
 -- Forwarded message --
 From: Michael Schnell mschn...@lumino.de
 To: Lazarus mailing list lazarus@lists.lazarus.freepascal.org
 Cc:
 Date: Wed, 20 Nov 2013 14:52:27 +0100
 Subject: Re: [Lazarus] Writing a Lazarus program with its own display, RFB?
 On 11/20/2013 01:29 PM, vfclists . wrote:



 My question was to see if the third option is possible with Lazarus, ie 
 whether it is possible to get Lazarus screen output to be targetted at a VNC 
 compatible system,

 ??? Handling the  Lazarus screen output is just the contrary of the third 
 option.

 but I think that is outside my knowledge and skill level.

 In fact the third option is the easiest to do (unless you find something 
 already functional for another option).

 So the option I have settled for is the first.

 This _is_ in fact already functional, in multiple ways of desktop remoting, 
 including native X11 via TCP/IP, NX, VNC, Windows Remote Desktop, ... (and 
 has nothing to do with Lazarus itself or the program you are doing at all).

 -Michael



I came across this really cool way to embed a vnc session on a web
page using flash:

  http://flashlight-vnc.sourceforge.net/

So it is an easy way to get lazarus apps running on a web page if that helps.

-- 
Regards

Danny

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there a syntax for displaying comments attached to variables in tooltips?

2013-11-25 Thread Mattias Gaertner
On Mon, 25 Nov 2013 12:14:17 +
vfclists . vfcli...@gmail.com wrote:

 Is there some way tooltips can be made to display comments linked with
 variables and constants?

The IDE shows comments in tooltips directly above and directly behind a
variable/constant.

var
  { comment about b }
  b: char;
  i: integer; // comment about i

Find declaration must work on the reference.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TForm.ModalResult := mrOk problem

2013-11-25 Thread FreeMan

Hello,
I have a strange problem.
I have last svn fpc and lazarus on kubuntu 13.10 x64

FRM_Log_In := TFRM_Log_In.Create(AOwner);
Result := FRM_Log_In.ShowModal;

FRM_Log_In.ModalResult := mrOk;  this code work on my system, work 
mean, form close and move to after FRM_Log_In.Showmodal;

FRM_Log_In.ModalResult := mrCancel;  working too.
I have a virtualbox and installed kubuntu 13.10 x64 there too. not 
install any fpc or lazarus.
when copy my application to virtualbox, form showing and all component 
(label, edit, etc) work fine. FRM_Log_In.ModalResult := mrCancel; 
working too but
FRM_Log_In.ModalResult := mrOk; never and ever working :)) no any 
exception, its work like this code not working. I mean for the test, I 
add showmessage('hello'); after this line, message not showing. But 
application is still working normal.

And this is just in virtualbox system, on my system everytking is okey.
Has anyone have idea ??
Thank you



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TForm.ModalResult := mrOk problem

2013-11-25 Thread FreeMan

on /lazarus/lcl/forms.pp
line 662:
property ModalResult : TModalResult read FModalResult write FModalResult;
TCustomForm class property. its just variable

on virtualbox system:
I add TButton on form and TButton.ModalResult set to MrOk. and click to 
Button then similar work TForm.ModalResult := MrOk.

I don't wanna use tbutton, How to run My code F.ModalResult := MrOk.


25-11-2013 16:45 tarihinde, FreeMan yazdı:

Hello,
I have a strange problem.
I have last svn fpc and lazarus on kubuntu 13.10 x64

FRM_Log_In := TFRM_Log_In.Create(AOwner);
Result := FRM_Log_In.ShowModal;

FRM_Log_In.ModalResult := mrOk;  this code work on my system, work 
mean, form close and move to after FRM_Log_In.Showmodal;

FRM_Log_In.ModalResult := mrCancel;  working too.
I have a virtualbox and installed kubuntu 13.10 x64 there too. not 
install any fpc or lazarus.
when copy my application to virtualbox, form showing and all component 
(label, edit, etc) work fine. FRM_Log_In.ModalResult := mrCancel; 
working too but
FRM_Log_In.ModalResult := mrOk; never and ever working :)) no any 
exception, its work like this code not working. I mean for the test, I 
add showmessage('hello'); after this line, message not showing. But 
application is still working normal.

And this is just in virtualbox system, on my system everytking is okey.
Has anyone have idea ??
Thank you



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TForm.ModalResult := mrOk problem

2013-11-25 Thread zeljko

On 11/25/2013 04:33 PM, FreeMan wrote:

on /lazarus/lcl/forms.pp
line 662:
property ModalResult : TModalResult read FModalResult write FModalResult;
TCustomForm class property. its just variable

on virtualbox system:
I add TButton on form and TButton.ModalResult set to MrOk. and click to
Button then similar work TForm.ModalResult := MrOk.
I don't wanna use tbutton, How to run My code F.ModalResult := MrOk.


It should work. Where do you exactly set ModalResult := mrOK ?

z.




25-11-2013 16:45 tarihinde, FreeMan yazdı:

Hello,
I have a strange problem.
I have last svn fpc and lazarus on kubuntu 13.10 x64

FRM_Log_In := TFRM_Log_In.Create(AOwner);
Result := FRM_Log_In.ShowModal;

FRM_Log_In.ModalResult := mrOk;  this code work on my system, work
mean, form close and move to after FRM_Log_In.Showmodal;
FRM_Log_In.ModalResult := mrCancel;  working too.
I have a virtualbox and installed kubuntu 13.10 x64 there too. not
install any fpc or lazarus.
when copy my application to virtualbox, form showing and all component
(label, edit, etc) work fine. FRM_Log_In.ModalResult := mrCancel;
working too but
FRM_Log_In.ModalResult := mrOk; never and ever working :)) no any
exception, its work like this code not working. I mean for the test, I
add showmessage('hello'); after this line, message not showing. But
application is still working normal.
And this is just in virtualbox system, on my system everytking is okey.
Has anyone have idea ??
Thank you



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] IDE problems

2013-11-25 Thread brian

Hi folks,

Something has spontaneously gone wrong with the IDE on my setup. I say 
spontaneously because I was in the middle of debugging a program when 
suddenly everything but the source window disappeared. I eventually 
had to abort Lazarus and re-start the program, but now I see some very 
strange behaviour :-


1) Pull-down menus stay pulled down, even when I've selected an entry.

2) Only the object inspector or the source editor can be visible at 
any one time - select one, and the other vanishes.


There are probably a few other quirks too, but those are the most 
annoying two.


In my Delphi days, there used to be a desktop configuration file which 
you deleted if the IDE got all screwed up, and then when you ran the 
program again you were back to all the defaults.


Is there such a file for Lazarus? I assume this isn't a 
version-specific question, but anyway, I'm running Lazarus under 
64-bit Debian multi-home, and the version is the latest as downloaded 
by fpcup_linux_x64 two days ago, SVN revision 43478.


Thanks,

Brian.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] IDE problems

2013-11-25 Thread Mattias Gaertner
On Mon, 25 Nov 2013 18:26:48 -0500
brian br...@meadows.pair.com wrote:

 Hi folks,
 
 Something has spontaneously gone wrong with the IDE on my setup. I say 
 spontaneously because I was in the middle of debugging a program when 
 suddenly everything but the source window disappeared. I eventually 
 had to abort Lazarus and re-start the program, but now I see some very 
 strange behaviour :-
 
 1) Pull-down menus stay pulled down, even when I've selected an entry.

What Lazarus version do you use?

 
 2) Only the object inspector or the source editor can be visible at 
 any one time - select one, and the other vanishes.
 
 There are probably a few other quirks too, but those are the most 
 annoying two.
 
 In my Delphi days, there used to be a desktop configuration file which 
 you deleted if the IDE got all screwed up, and then when you ran the 
 program again you were back to all the defaults.
 
 Is there such a file for Lazarus? I assume this isn't a 
 version-specific question, but anyway, I'm running Lazarus under 
 64-bit Debian multi-home, and the version is the latest as downloaded 
 by fpcup_linux_x64 two days ago, SVN revision 43478.

The config files are under Linux in $HOME/.lazarus.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] IDE problems

2013-11-25 Thread Martin Frb

On 25/11/2013 23:26, brian wrote:

Hi folks,

Something has spontaneously gone wrong with the IDE on my setup. I say 
spontaneously because I was in the middle of debugging a program when 
suddenly everything but the source window disappeared. I eventually 
had to abort Lazarus and re-start the program, but now I see some very 
strange behaviour :-


1) Pull-down menus stay pulled down, even when I've selected an entry.



This does not sound like a config issue to me.

However, I have seen some Linux, or maybe some of the Destops/Window 
managers getting in trouble, if gdb pauses an application in the wrong 
moment. e.g. in a paint event, or other events (mouse, kbd).


In that case you may have to restart your  desktop session, potentially 
the entire system.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] SQLite Vacuum Error Cannot rollback - no transaction is active

2013-11-25 Thread K. P.
As the error message indicates, do:

SQLite3Connection.ExecuteDirect('Begin Transaction');
 
after the vacuum and you should be fine. Works for me. 
 
From: mulc...@hotmail.com
To: lazarus@lists.lazarus.freepascal.org
Date: Mon, 25 Nov 2013 09:31:24 +0100
Subject: [Lazarus] SQLite Vacuum  Error Cannot rollback - no transaction is
active

At the end of some database maintenance where I drop several tables I want to 
Vacuum the SQLite database. I use the code below and this works fine, however 
when I close the program I get the error:“Project project1 raised exception 
class ‘EDatabaseError’ with message:Cannot rollback – no transaction is active. 
Question: how can I Vacuum the database and close the program without errors? 
The code (which gives no error when run):procedure 
TForm1.VacuumButtonClick(Sender: TObject);begin
SQLite3Connection.DatabaseName:='A.db';
SQLTransaction1.Database:=SQLite3Connection;
SQLite3Connection.Open; // Statement below must be issued, 
otherwise I get error “cannot VACUUM from within a transaction”
SQLite3Connection.ExecuteDirect('End Transaction');  // End the transaction 
started by SQLdbSQLite3Connection.ExecuteDirect('Vacuum');end; 
Exit procedure which give the error message.procedure 
TForm1.ExitMenuItemClick(Sender: TObject);begin Application.terminate;end; 
BTW, when hitting the “break” button the cursor jumps to line 4828 “  inherited 
Destroy;” within the  “destructor TControl.Destroy;” in “control.inc”.I run on 
Windows 7 32 bits and use Lazarus 1.0.12 and FPC 2.6.2
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
  --
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] IDE problems

2013-11-25 Thread brian

On 11/25/2013 06:58 PM, Martin Frb wrote:

On 25/11/2013 23:26, brian wrote:

Hi folks,

Something has spontaneously gone wrong with the IDE on my setup. I
say spontaneously because I was in the middle of debugging a program
when suddenly everything but the source window disappeared. I
eventually had to abort Lazarus and re-start the program, but now I
see some very strange behaviour :-

1) Pull-down menus stay pulled down, even when I've selected an entry.



This does not sound like a config issue to me.

However, I have seen some Linux, or maybe some of the Destops/Window
managers getting in trouble, if gdb pauses an application in the wrong
moment. e.g. in a paint event, or other events (mouse, kbd).

In that case you may have to restart your  desktop session,
potentially the entire system.



The problem has survived a full reboot.


Brian.



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] IDE problems

2013-11-25 Thread brian

On 11/25/2013 06:45 PM, Mattias Gaertner wrote:

On Mon, 25 Nov 2013 18:26:48 -0500
brian br...@meadows.pair.com wrote:


Hi folks,

Something has spontaneously gone wrong with the IDE on my setup. I say
spontaneously because I was in the middle of debugging a program when
suddenly everything but the source window disappeared. I eventually
had to abort Lazarus and re-start the program, but now I see some very
strange behaviour :-

1) Pull-down menus stay pulled down, even when I've selected an entry.


What Lazarus version do you use?



2) Only the object inspector or the source editor can be visible at
any one time - select one, and the other vanishes.

There are probably a few other quirks too, but those are the most
annoying two.

In my Delphi days, there used to be a desktop configuration file which
you deleted if the IDE got all screwed up, and then when you ran the
program again you were back to all the defaults.

Is there such a file for Lazarus? I assume this isn't a
version-specific question, but anyway, I'm running Lazarus under
64-bit Debian multi-home, and the version is the latest as downloaded
by fpcup_linux_x64 two days ago, SVN revision 43478.


The config files are under Linux in $HOME/.lazarus.



Thanks, Mattias. I tried renaming .lazarus and then ran lazarus up 
again, but no change in the behaviour. Let me show you the sort of 
thing I see, screenshot attached. Any time I click a pulldown menu, 
the source window disappears, and as you will see, the pulldown menus 
stay there.


P.S. Didn't know about the 100 KB size triggering a moderator review. 
OK, the .png is here.



http://www.meadows.pair.com/Screenshot - 11252013 - 06:57:09 PM.png



Brian.





--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] IDE problems

2013-11-25 Thread Junior

Fixing the link:

http://www.meadows.pair.com/Screenshot%20-%2011252013%20-%2006:57:09%20PM.png

Em 25-11-2013 21:49, brian escreveu:

On 11/25/2013 06:45 PM, Mattias Gaertner wrote:

On Mon, 25 Nov 2013 18:26:48 -0500
brian br...@meadows.pair.com wrote:


Hi folks,

Something has spontaneously gone wrong with the IDE on my setup. I say
spontaneously because I was in the middle of debugging a program when
suddenly everything but the source window disappeared. I eventually
had to abort Lazarus and re-start the program, but now I see some very
strange behaviour :-

1) Pull-down menus stay pulled down, even when I've selected an entry.


What Lazarus version do you use?



2) Only the object inspector or the source editor can be visible at
any one time - select one, and the other vanishes.

There are probably a few other quirks too, but those are the most
annoying two.

In my Delphi days, there used to be a desktop configuration file which
you deleted if the IDE got all screwed up, and then when you ran the
program again you were back to all the defaults.

Is there such a file for Lazarus? I assume this isn't a
version-specific question, but anyway, I'm running Lazarus under
64-bit Debian multi-home, and the version is the latest as downloaded
by fpcup_linux_x64 two days ago, SVN revision 43478.


The config files are under Linux in $HOME/.lazarus.



Thanks, Mattias. I tried renaming .lazarus and then ran lazarus up 
again, but no change in the behaviour. Let me show you the sort of 
thing I see, screenshot attached. Any time I click a pulldown menu, 
the source window disappears, and as you will see, the pulldown menus 
stay there.


P.S. Didn't know about the 100 KB size triggering a moderator review. 
OK, the .png is here.



http://www.meadows.pair.com/Screenshot - 11252013 - 06:57:09 PM.png



Brian.





--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus