Re: [fpc-pascal] MSSQL and ftAutoInc: FPC 2.6.5 changes the behavior of 2.6.2 but AutoInc not works yet

2014-04-25 Thread Martin Schreiber
On Friday 25 April 2014 07:46:23 LacaK wrote:
 Do you have tried for ftAutoInc field simply set ReadOnly:=False; ?
 -Laco.
 P.S. there is feature request about automatic fetching of new values of
 idnetity columns, but implementing it in generic way for all supported
 SQLConnections is not trivial ;-)

In MSEgui I used flags in tfield.providerflags1 
(pf1_refreshinsert,pf1_refreshupdate) which trigger the use of 
the returning clause in insert or update statement if the DB supports it. 
Additionally there is tcustomsqlconnection.updateprimarykeyfield() which is 
called after insert, it automatically updates the primary key field field 
with the last insert id if the DB supports it.
The third option is to use tsequencelink which automatically fetches sequence 
values from the DB before inserting.

Martin
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] CustHttpApp again, error: Missing HTTP protocol version in request

2014-04-25 Thread Michael Van Canneyt



On Thu, 24 Apr 2014, silvioprog wrote:


Hello,
I've tested the CustHttpApp unit in new released FPC 2.6.4 on Windows, and the error 
Missing HTTP protocol version in request still
continues.

I'll show detailed steps (including my tools) to reproduce it:

1. on Windows (I'm using 8), download and install the latest Lazarus/FPC 
version:
http://downloads.sourceforge.net/project/lazarus/Lazarus%20Windows%2032%20bits/Lazarus%201.2.2/lazarus-1.2.2-fpc-2.6.4-win32.exe;;
2. download this source code (the project to reproduce the bug) from link 
https://www.dropbox.com/s/rmfitgh7b58cf1g/es_bug.zip; or in
attachment;
3. in Tools | Options ... menu, got to the Debugger  Language Exceptions page, and 
check the Notify on Lazarus Exceptions
option; 
4. run the project with F9 (notice that I left a breakpoint);
5. using the Advanced REST client Chrome plugin
https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo;,
 fill the URL with
http://localhost:1025; and click in Send button;
6. push F9 until the Lazarus exits from breakpoint;
7. wait a few moments, that Lazarus will go to the breakpoint after some 
secounds;


When Lazarus go to the breakpoint again, push F8 several times, and notice that in line 
363, the R variable will receive the zero
value:

...
  Procedure FillBuffer;

  Var
    R : Integer;

  begin
    SetLength(FBuffer,ReadBufLen);
    r:=FSocket.Read(FBuffer[1],ReadBufLen);  HERE!
    If r0 then
      Raise EHTTPServer.Create(SErrReadingSocket);
    if (rReadBuflen) then
      SetLength(FBuffer,r);
  end;


Damn windows returning 0 on read... 
Can you please test with the following change:


   Procedure FillBuffer;

   Var
     R : Integer;

   begin
     SetLength(FBuffer,ReadBufLen);
 Repeat
       r:=FSocket.Read(FBuffer[1],ReadBufLen);
       If r0 then
         Raise EHTTPServer.Create(SErrReadingSocket);
   if R=0 then
 Sleep(10);
 Until (R0);
     if (RReadBuflen) then
       SetLength(FBuffer,r);
   end;

Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-25 Thread Ralf Quint
Just a minor issue,but when installing 1.2.2 over an existing 1.2.0 
(32bit on Windows 8.1 64bit), it did not properly set the path to the 
make file. Had to go on the first startup and browse to the binary in 
the fpc compiler bin folder, all other paths were set right...


Ralf

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] MSSQL and ftAutoInc: FPC 2.6.5 changes the behavior of 2.6.2 but AutoInc not works yet

2014-04-25 Thread LacaK

Martin Schreiber  wrote / napísal(a):

On Friday 25 April 2014 07:46:23 LacaK wrote:
  

Do you have tried for ftAutoInc field simply set ReadOnly:=False; ?
-Laco.
P.S. there is feature request about automatic fetching of new values of
idnetity columns, but implementing it in generic way for all supported
SQLConnections is not trivial ;-)


In MSEgui I used flags in tfield.providerflags1 
(pf1_refreshinsert,pf1_refreshupdate) which trigger the use of 
the returning clause in insert or update statement if the DB supports it. 
Additionally there is tcustomsqlconnection.updateprimarykeyfield() which is 
called after insert, it automatically updates the primary key field field 
with the last insert id if the DB supports it.
The third option is to use tsequencelink which automatically fetches sequence 
values from the DB before inserting.
  

Thanks for interesting points, ideas
-Laco.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] java events calling pascal code vs java calling library.

2014-04-25 Thread fredvs
Many thanks Stephano.

 as my java exposure started only a few days ago.

Same for me. I have successfully adapt some of my fpc native libraries into
Java-native libraries.
Im extremely happy with the result, all the functions/procedures are
exported and working. Even callback procedures.

I am only blocked how to create a Java wrapper class for those libraries...
All Java , code-guru, stackoverflow forum cannot help me...

Without that library wrapper class, i have to declare all the native
methods of the library inside the main Java class.

But it works perfectly...



-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/java-events-calling-pascal-code-vs-java-calling-library-tp5719036p5719050.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-25 Thread Krzysztof
I noticed something weird in 1.2.2. When finishing debugging (by pressing
Stop icon) codeeditor can't restore position cursor. I need to switch tab
and back again and then it is ok. Kubuntu 14.04 64bit
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-25 Thread Martin Frb

On 25/04/2014 13:52, Krzysztof wrote:
I noticed something weird in 1.2.2. When finishing debugging (by 
pressing Stop icon) codeeditor can't restore position cursor. I need 
to switch tab and back again and then it is ok. Kubuntu 14.04 64bit


You mean it does not show the flashing (blinking) vertical bar, 
indicating where you will type?


What happens, if you press a key? will it insert the key into the text? 
(that is, does the window have forus)?

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] CustHttpApp again, error: Missing HTTP protocol version in request

2014-04-25 Thread silvioprog
2014-04-25 3:39 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:
[...]

 Damn windows returning 0 on read... Can you please test with the following
 change:


Procedure FillBuffer;

Var
  R : Integer;

begin
  SetLength(FBuffer,ReadBufLen);
  Repeat
r:=FSocket.Read(FBuffer[1],ReadBufLen);

If r0 then
  Raise EHTTPServer.Create(SErrReadingSocket);
if R=0 then
  Sleep(10);
  Until (R0);
  if (RReadBuflen) then
SetLength(FBuffer,r);
end;


After apply this change, now when read returns 0, it freezes the app.,
because the sleep(10) command is infinitely called. :/

Damn windows!

-- 
Silvio Clécio
My public projects - github.com/silvioprog
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-25 Thread Mattias Gaertner
On Fri, 25 Apr 2014 14:52:55 +0200
Krzysztof dib...@wp.pl wrote:

 I noticed something weird in 1.2.2. When finishing debugging (by pressing
 Stop icon) codeeditor can't restore position cursor. I need to switch tab
 and back again and then it is ok. Kubuntu 14.04 64bit

What do you mean with can't restore position cursor?

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] CustHttpApp again, error: Missing HTTP protocol version in request

2014-04-25 Thread silvioprog
2014-04-25 10:05 GMT-03:00 silvioprog silviop...@gmail.com:

 2014-04-25 3:39 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:
 [...]

 Damn windows returning 0 on read... Can you please test with the
 following change:


Procedure FillBuffer;

Var
  R : Integer;

begin
  SetLength(FBuffer,ReadBufLen);
  Repeat
r:=FSocket.Read(FBuffer[1],ReadBufLen);

If r0 then
  Raise EHTTPServer.Create(SErrReadingSocket);
if R=0 then
  Sleep(10);
  Until (R0);
  if (RReadBuflen) then
SetLength(FBuffer,r);
end;


 After apply this change, now when read returns 0, it freezes the app.,
 because the sleep(10) command is infinitely called. :/

 Damn windows!


I have no much experience with sockets on Windows, but I saw two links:

http://stackoverflow.com/questions/10526382/recv-returns-0

http://blog.netherlabs.nl/articles/2009/01/18/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable

Seems that error occurs when client disconnects from server. :/

-- 
Silvio Clécio
My public projects - github.com/silvioprog
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] CustHttpApp again, error: Missing HTTP protocol version in request

2014-04-25 Thread Michael Van Canneyt



On Fri, 25 Apr 2014, silvioprog wrote:


2014-04-25 3:39 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:
[...] 
  Damn windows returning 0 on read... Can you please test with the 
following change:

     Procedure FillBuffer;

     Var
       R : Integer;

     begin
       SetLength(FBuffer,ReadBufLen);
     Repeat
       r:=FSocket.Read(FBuffer[1],ReadBufLen);
       If r0 then
         Raise EHTTPServer.Create(SErrReadingSocket);
       if R=0 then
         Sleep(10);
     Until (R0);
     if (RReadBuflen) then
       SetLength(FBuffer,r);
   end;


After apply this change, now when read returns 0, it freezes the app., because the 
sleep(10) command is infinitely called. :/


OK, what we can do is add a timeout:

Procedure FillBuffer;

Const
  MaxReadRetries = 150;

Var
  R,C : Integer;

begin
  C:=0;
  SetLength(FBuffer,ReadBufLen);
  Repeat
    r:=FSocket.Read(FBuffer[1],ReadBufLen);
    If r0 then
      Raise EHTTPServer.Create(SErrReadingSocket);
    if R=0 then
      begin
  Sleep(10);
  Inc(C);
  end;
  Until (R0) or (CMaxReadRetries);
  if (RReadBuflen) then
    SetLength(FBuffer,r);
end;

It will then try 150 times, and then error out.

BUT, reading this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms740121%28v=vs.85%29.aspx

If the connection has been gracefully closed, the return value is zero.

So, this means then thay the original implementation is correct. 
You just need to catch the error using the OnRequestError handler...


Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] CustHttpApp again, error: Missing HTTP protocol version in request

2014-04-25 Thread Michael Van Canneyt



On Fri, 25 Apr 2014, silvioprog wrote:


2014-04-25 10:05 GMT-03:00 silvioprog silviop...@gmail.com:
  2014-04-25 3:39 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:
[...] 
  Damn windows returning 0 on read... Can you please test with the 
following change:

     Procedure FillBuffer;

     Var
       R : Integer;

     begin
       SetLength(FBuffer,ReadBufLen);
     Repeat
       r:=FSocket.Read(FBuffer[1],ReadBufLen);
       If r0 then
         Raise EHTTPServer.Create(SErrReadingSocket);
       if R=0 then
         Sleep(10);
     Until (R0);
     if (RReadBuflen) then
       SetLength(FBuffer,r);
   end;


After apply this change, now when read returns 0, it freezes the app., because the 
sleep(10) command is infinitely called. :/

Damn windows!


I have no much experience with sockets on Windows, but I saw two links:

http://stackoverflow.com/questions/10526382/recv-returns-0

http://blog.netherlabs.nl/articles/2009/01/18/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable

Seems that error occurs when client disconnects from server. :/


See my other post...

Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] CustHttpApp again, error: Missing HTTP protocol version in request

2014-04-25 Thread silvioprog
2014-04-25 10:24 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:

  On Fri, 25 Apr 2014, silvioprog wrote:

 2014-04-25 3:39 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:
 [...]
   Damn windows returning 0 on read... Can you please test with the
 following change:

  Procedure FillBuffer;

  Var
R : Integer;

  begin
SetLength(FBuffer,ReadBufLen);
  Repeat
r:=FSocket.Read(FBuffer[1],ReadBufLen);
If r0 then
  Raise EHTTPServer.Create(SErrReadingSocket);
if R=0 then
  Sleep(10);
  Until (R0);
  if (RReadBuflen) then
SetLength(FBuffer,r);
end;


 After apply this change, now when read returns 0, it freezes the app.,
 because the sleep(10) command is infinitely called. :/


 OK, what we can do is add a timeout:

 Procedure FillBuffer;

 Const
   MaxReadRetries = 150;

 Var
   R,C : Integer;

 begin
   C:=0;

   SetLength(FBuffer,ReadBufLen);
   Repeat
 r:=FSocket.Read(FBuffer[1],ReadBufLen);
 If r0 then
   Raise EHTTPServer.Create(SErrReadingSocket);
 if R=0 then
   begin
   Sleep(10);
   Inc(C);
   end;
   Until (R0) or (CMaxReadRetries);

   if (RReadBuflen) then
 SetLength(FBuffer,r);
 end;

 It will then try 150 times, and then error out.

 BUT, reading this:

 http://msdn.microsoft.com/en-us/library/windows/desktop/
 ms740121%28v=vs.85%29.aspx

 If the connection has been gracefully closed, the return value is zero.

 So, this means then thay the original implementation is correct. You just
 need to catch the error using the OnRequestError handler...


Sorry for my ignorance, but, would not it be better to read the HTTP data
only if the client is still connected or if read bytes  0?

In original implementation, I made a ''quick fix to solve my problem,
please see the ADDED lines:

[code]
...
  TFPHTTPConnection = Class(TObject)
  private
{$IFDEF MSWINDOWS}  ADDED
FCanHandleRequest: Boolean;  ADDED
{$ENDIF}  ADDED
...
[/code]

[code]
...
function TFPHTTPConnection.ReadRequestHeaders: TFPHTTPConnectionRequest;

Var
  StartLine,S : String;
begin
  Result:=Server.CreateRequest;
  try
Server.InitRequest(Result);
Result.FConnection:=Self;
StartLine:=ReadString;
{$IFDEF MSWINDOWS}
FCanHandleRequest := (StartLine  '');
If not FCanHandleRequest Then
  Exit;
{$ENDIF}
...
[/code]

[code]
...
procedure TFPHTTPConnection.HandleRequest;

Var
  Req : TFPHTTPConnectionRequest;
  Resp : TFPHTTPConnectionResponse;

begin
  Try
SetupSocket;
// Read headers.
Req:=ReadRequestHeaders;
try
{$IFDEF MSWINDOWS}  ADDED
  if not FCanHandleRequest then  ADDED
Exit;  ADDED
{$ENDIF}  ADDED
...
[/code]

-- 
Silvio Clécio
My public projects - github.com/silvioprog
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] CustHttpApp again, error: Missing HTTP protocol version in request

2014-04-25 Thread Michael Van Canneyt



On Fri, 25 Apr 2014, silvioprog wrote:


2014-04-25 10:24 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:
  On Fri, 25 Apr 2014, silvioprog wrote:
2014-04-25 3:39 GMT-03:00 Michael Van Canneyt 
mich...@freepascal.org:
[...] 
      Damn windows returning 0 on read... Can you please test with 
the following change:

         Procedure FillBuffer;

         Var
           R : Integer;

         begin
           SetLength(FBuffer,ReadBufLen);
     Repeat
       r:=FSocket.Read(FBuffer[1],ReadBufLen);
       If r0 then
         Raise EHTTPServer.Create(SErrReadingSocket);
       if R=0 then
         Sleep(10);
     Until (R0);
     if (RReadBuflen) then
       SetLength(FBuffer,r);
   end;


After apply this change, now when read returns 0, it freezes the app., 
because the sleep(10) command is infinitely called. :/


OK, what we can do is add a timeout:

Procedure FillBuffer;

Const
  MaxReadRetries = 150;

Var
  R,C : Integer;

begin
  C:=0;
  SetLength(FBuffer,ReadBufLen);
  Repeat
    r:=FSocket.Read(FBuffer[1],ReadBufLen);
    If r0 then
      Raise EHTTPServer.Create(SErrReadingSocket);
    if R=0 then
      begin
      Sleep(10);
      Inc(C);
      end;
  Until (R0) or (CMaxReadRetries);
  if (RReadBuflen) then
    SetLength(FBuffer,r);
end;

It will then try 150 times, and then error out.

BUT, reading this:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms740121%28v=vs.85%29.aspx

If the connection has been gracefully closed, the return value is zero.

So, this means then thay the original implementation is correct. You just need 
to catch the error using the OnRequestError handler...


Sorry for my ignorance, but, would not it be better to read the HTTP data only if 
the client is still connected or if read bytes  0?


Yes and no. 
Yes in the sense that you have a more 'clean' experience.

No, because it IS an error condition (client went away unexpectedly) and you 
should be aware of it.

I will make it a property that is settable: 'IgnoreLostConnections' or so.

Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] CustHttpApp again, error: Missing HTTP protocol version in request

2014-04-25 Thread silvioprog
2014-04-25 11:11 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:

  On Fri, 25 Apr 2014, silvioprog wrote:

 2014-04-25 10:24 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:
   On Fri, 25 Apr 2014, silvioprog wrote:
 2014-04-25 3:39 GMT-03:00 Michael Van Canneyt 
 mich...@freepascal.org:
 [...]
   Damn windows returning 0 on read... Can you please test
 with the following change:

  Procedure FillBuffer;

  Var
R : Integer;

  begin
SetLength(FBuffer,ReadBufLen);
  Repeat
r:=FSocket.Read(FBuffer[1],ReadBufLen);
If r0 then
  Raise EHTTPServer.Create(SErrReadingSocket);
if R=0 then
  Sleep(10);
  Until (R0);
  if (RReadBuflen) then
SetLength(FBuffer,r);
end;


 After apply this change, now when read returns 0, it freezes
 the app., because the sleep(10) command is infinitely called. :/


 OK, what we can do is add a timeout:

 Procedure FillBuffer;

 Const
   MaxReadRetries = 150;

 Var
   R,C : Integer;

 begin
   C:=0;
   SetLength(FBuffer,ReadBufLen);
   Repeat
 r:=FSocket.Read(FBuffer[1],ReadBufLen);
 If r0 then
   Raise EHTTPServer.Create(SErrReadingSocket);
 if R=0 then
   begin
   Sleep(10);
   Inc(C);
   end;
   Until (R0) or (CMaxReadRetries);
   if (RReadBuflen) then
 SetLength(FBuffer,r);
 end;

 It will then try 150 times, and then error out.

 BUT, reading this:

 http://msdn.microsoft.com/en-us/library/windows/desktop/
 ms740121%28v=vs.85%29.aspx

 If the connection has been gracefully closed, the return value is zero.

 So, this means then thay the original implementation is correct. You just
 need to catch the error using the OnRequestError handler...

 Sorry for my ignorance, but, would not it be better to read the HTTP data
 only if the client is still connected or if read bytes  0?


 Yes and no. Yes in the sense that you have a more 'clean' experience.
 No, because it IS an error condition (client went away unexpectedly) and
 you should be aware of it.

 I will make it a property that is settable: 'IgnoreLostConnections' or so.


The 'IgnoreLostConnections' is a nice solution! :)

-- 
Silvio Clécio
My public projects - github.com/silvioprog
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] MSSQL and ftAutoInc: FPC 2.6.5 changes the behavior of 2.6.2 but AutoInc not works yet

2014-04-25 Thread Marcos Douglas
On Fri, Apr 25, 2014 at 2:46 AM, LacaK la...@zoznam.sk wrote:
 Do you have tried for ftAutoInc field simply set ReadOnly:=False; ?
 -Laco.

Errr... I forgot this option... worked, thanks!  :)


 P.S. there is feature request about automatic fetching of new values of
 idnetity columns, but implementing it in generic way for all supported
 SQLConnections is not trivial ;-)

Why not only start the implementation?
I think some property UpdatePrimaryKey. This property could be use
in an automatic way for some DBMS eg MSSQL that you have to call
select scope_identity() as id.
Maybe, for some DBMS, the programmer could write some SQL to execute,
similar to UpdateSQL.

Martin Schreiber, has many good ideas too.  ;-)

Regards,
Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-25 Thread Krzysztof
Cursor is not blinking. I don't know where it is


2014-04-25 15:10 GMT+02:00 Mattias Gaertner nc-gaert...@netcologne.de:

 On Fri, 25 Apr 2014 14:52:55 +0200
 Krzysztof dib...@wp.pl wrote:

  I noticed something weird in 1.2.2. When finishing debugging (by pressing
  Stop icon) codeeditor can't restore position cursor. I need to switch tab
  and back again and then it is ok. Kubuntu 14.04 64bit

 What do you mean with can't restore position cursor?

 Mattias
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-25 Thread Martin Frb

On 25/04/2014 17:07, Krzysztof wrote:

Cursor is not blinking. I don't know where it is



Does the window have focus, can you type?

Because when I press stop, then the window with the stop button (the 
main IDE bar) is focused. ANd yes in that case the caret (text cursor) 
is no blinking.


If you have the editor focused, while debugging, and press ctrl-F2 
(which is stop), then the editor keeps being focused.


The IDE has an option (Menu Tools  Option  EDitor) Persistent Caret, 
using this, the caret will be visible, after you clicked stop. But the 
Editor still will not have Focus, and you still will not be able to type 
until you focus it.



I cross posted this to the lazarus list, you may want to reply there, 
since this is not an fpc issue.





2014-04-25 15:10 GMT+02:00 Mattias Gaertner nc-gaert...@netcologne.de 
mailto:nc-gaert...@netcologne.de:


On Fri, 25 Apr 2014 14:52:55 +0200
Krzysztof dib...@wp.pl mailto:dib...@wp.pl wrote:

 I noticed something weird in 1.2.2. When finishing debugging (by
pressing
 Stop icon) codeeditor can't restore position cursor. I need to
switch tab
 and back again and then it is ok. Kubuntu 14.04 64bit



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] java events calling pascal code vs java calling library.

2014-04-25 Thread leledumbo
 All Java os (Android and friends) can only deal with Java class. 

Wrong.
http://developer.android.com/reference/android/app/NativeActivity.html (not
a single line of Java required)




--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/java-events-calling-pascal-code-vs-java-calling-library-tp5719036p5719064.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-25 Thread Krzysztof
Yes, I can type but carret is invisible. After checking Persistent Caret
everything is working fine, thanks!


2014-04-25 18:45 GMT+02:00 Martin Frb laza...@mfriebe.de:

  On 25/04/2014 17:07, Krzysztof wrote:

 Cursor is not blinking. I don't know where it is



 Does the window have focus, can you type?

 Because when I press stop, then the window with the stop button (the main
 IDE bar) is focused. ANd yes in that case the caret (text cursor) is no
 blinking.

 If you have the editor focused, while debugging, and press ctrl-F2 (which
 is stop), then the editor keeps being focused.

 The IDE has an option (Menu Tools  Option  EDitor) Persistent Caret,
 using this, the caret will be visible, after you clicked stop. But the
 Editor still will not have Focus, and you still will not be able to type
 until you focus it.


 I cross posted this to the lazarus list, you may want to reply there,
 since this is not an fpc issue.




 2014-04-25 15:10 GMT+02:00 Mattias Gaertner nc-gaert...@netcologne.de:

  On Fri, 25 Apr 2014 14:52:55 +0200
 Krzysztof dib...@wp.pl wrote:

  I noticed something weird in 1.2.2. When finishing debugging (by
 pressing
  Stop icon) codeeditor can't restore position cursor. I need to switch
 tab
  and back again and then it is ok. Kubuntu 14.04 64bit



 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Xlib Threads

2014-04-25 Thread Brian
All the Xlib documentation seems to imply that threads can be used , however
if I attempt to put XNextEvent() or XPending() in a thread , the rsult is a
GP fault . The error message suggests using XInitThreads() but it still
generates a GP fault.

Tried using XlockDisplay() and XUnlockDisplay() in the thread but still get
a GP fault.

X Error of failed request:  BadLength (poly request too large or internal
Xlib length error)
  Major opcode of failed request:  100 (X_ChangeKeyboardMapping)
  Serial number of failed request:  20
  Current serial number in output stream:  35

X11 code which causes the problem in the thread :

  
   NewEvent := Xpending(TheDisplay)  0 ;

   if NewEvent then 
 begin
  XNextEvent(TheDisplay, @myevent);
   KeypressedX :=  myevent._type = keypress ;
 end;

Any suggestions are welcomed. Thanks in advance.



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Xlib-Threads-tp5719066.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal