* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
Win32/64 / Re: Caret stops blinking after a few seconds
« Last post by Dr.Theopolis on Today at 05:50:14 pm »
The issue might not have anything to do with TKMemo component. I am looking into it and will probably start a new topic if I have questions.
2
General / Re: Please make your language more freedom
« Last post by Thaddy on Today at 05:50:11 pm »
neither does it support:
Code: Pascal  [Select]
  1.   if condition then begin
  2.     a:= 1;
  3.     DoSomethingWith(a);
  4.   end;
  5.   // a may be undefined... And yet you can access it
  6.  

FPC supports while <condition> do..
Code: Pascal  [Select]
  1. {$ifdef fpc}{$mode delphi}{$H+}{$endif}
  2. begin
  3.   while true do
  4.   begin
  5.     //
  6.   end;  
  7. end.

3
General / Re: Please make your language more freedom
« Last post by Martin_fr on Today at 05:39:56 pm »
Something I saw in my C days could be nice..

For COUNTER:Integer := 1 to Whatever do....


 That's not exactly like in C but it makes sure the COUNTER variable never exists out side
the control loop.

 I am pretty sure FPC does not support that, yet ;)

neither does it support:
Code: Pascal  [Select]
  1.   if condition then begin
  2.     a:= 1;
  3.     DoSomethingWith(a);
  4.   end;
  5.   // a may be undefined... And yet you can access it
  6.  

Or any other situation where a variable is only used for a subset of the code of a procedure.
It just isn't part of (proper) Pascal.

This discussion is a bit, like going to a javascript forum, and ask if they can introduce strictly typed variables, and abandon none typed vars. That wouldn't be javascript.
Different languages, different concepts.
4
General / Re: Please make your language more freedom
« Last post by jamie on Today at 05:10:47 pm »
Something I saw in my C days could be nice..

For COUNTER:Integer := 1 to Whatever do....


 That's not exactly like in C but it makes sure the COUNTER variable never exists out side
the control loop.

 I am pretty sure FPC does not support that, yet ;)
5
Windows / Re: CreateFileMapping between two processes
« Last post by Romain on Today at 05:06:53 pm »
Works great  :)

Many thanks ASerge !
6
Windows / Re: Collision detection between sqaures
« Last post by lainz on Today at 04:54:08 pm »
TRect.IntersectsWith(R: TRect): Boolean; ?

Bart

Good =)
7
Win32/64 / Re: Caret stops blinking after a few seconds
« Last post by engkin on Today at 04:44:15 pm »
Just downloaded tkweb-kcontrols. Compiled laz package without installing it. Tried the following code:
Code: Pascal  [Select]
  1.   m := TKMemo.Create(Self);
  2.   m.SetBounds(10,10,200, 150);
  3.   m.Parent := Self;
  4.   m.Visible:=True;

Did not see the caret problem. Possibly solved?

8
General / Re: Some problems in Lazarus 1.8.4 that I had
« Last post by Bart on Today at 04:42:58 pm »
Set the Caption in the associated Action.

Bart
9
Windows / Re: Collision detection between sqaures
« Last post by Bart on Today at 04:39:49 pm »
TRect.IntersectsWith(R: TRect): Boolean; ?

Bart
10
Windows / Re: CreateFileMapping between two processes
« Last post by ASerge on Today at 04:35:09 pm »
Can you provide a practical example that works for dynamic text sizes ... I'm somehow lost  %)
Code: Pascal  [Select]
  1. program Project1;
  2. {$APPTYPE CONSOLE}
  3. {$MODE OBJFPC}
  4. {$LONGSTRINGS ON}
  5.  
  6. uses SysUtils, uPageFileStream;
  7.  
  8. const
  9.   CMapName = '{9D809F6B-FC10-4E4F-B352-4A7773762BAA}'; // Any unique name
  10.  
  11. type
  12.   TData = record
  13.     FUniqueID: DWORD;
  14.     FName: string;
  15.   end;
  16.  
  17. function Receive(out Data: TData): Boolean;
  18. var
  19.   Stream: TPageFileStream;
  20. begin
  21.   Stream := TPageFileStream.CreateForRead(CMapName);
  22.   try
  23.     Result := (pfsValid in Stream.States) and (Stream.Size >= SizeOf(Data));
  24.     if Result then
  25.     begin
  26.       Data.FUniqueID := Stream.ReadDWord;
  27.       Data.FName := Stream.ReadAnsiString;
  28.     end;
  29.   finally
  30.     Stream.Free;
  31.   end;
  32. end;
  33.  
  34. var
  35.   Stream: TPageFileStream;
  36.   DataIn, DataOut: TData;
  37. begin
  38.   DataIn.FUniqueID := 15;
  39.   DataIn.FName := 'Some string';
  40.   // SizeOf(DataIn) + Length(DataIn.FName) is enough
  41.   Stream := TPageFileStream.Create(SizeOf(DataIn) + Length(DataIn.FName), CMapName);
  42.   try
  43.     Stream.WriteDWord(DataIn.FUniqueID);
  44.     Stream.WriteAnsiString(DataIn.FName);
  45.     // Do interprocess
  46.     if Receive(DataOut) then
  47.       Writeln('ID=', DataOut.FUniqueID, ', Name=', DataOut.FName)
  48.     else
  49.       Writeln(SysErrorMessage(GetLastOSError));
  50.   finally
  51.     Stream.Free;
  52.   end;
  53.   Readln;
  54. end.

unit uPageFileStream are included.
Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus