Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
rpm: Failed  make: *** There are no rules for making target "rpm". Stop it.
deb: Failed ! /usr/bin/echo "Debian version (3.2.0) is not correct, expect 3.2.2"
inno: Not available on Linux
innox64: Not available on Linux

Building debs, rpms and using inno all require quite specific software tools on your system. Do you already have those things ? Without them, no chance of a build working. I don't think there is any reason to think that the average FPC user, you or me, would be attempting to use those "make targets".

I imagine the necessary build environment is documented somewhere, but again, not something you would find with understanding the process.

Davo
2
Databases / Re: Database standards OR Am I doing this right?
« Last post by cdbc on Today at 06:24:05 am »
Hi
@TRon: Primoz Gabrielski once wrote an interesting article in "The Delphi Magazine", about 'File-based Locking'.
Would have to sift through all the old magazines to find it, though  :P
Regards Benny
3
Databases / Re: Database standards OR Am I doing this right?
« Last post by TRon on Today at 06:16:49 am »
.. and might have to use critical sections, so that other uses may not access the same record whey you are doing something with a record. 
Critical sections apply to code in the same executable and usually when using multiple threads.
4
Databases / Re: Database standards OR Am I doing this right?
« Last post by cdbc on Today at 06:16:39 am »
Hi
It looks like a locking issue, so if the second /offender/ is *only* reading, it should work.
Can you, by any chance, make sure, that when you only want to read data, the 'ZQuery' is marked "ReadOnly" e.g.: via a property?!? _Live_ so to speak...
Regards Benny
5
Databases / Re: Database standards OR Am I doing this right?
« Last post by egsuh on Today at 05:53:03 am »
I do not know very much about this issue. AFAIK you should take care of transaction, and might have to use critical sections, so that other uses may not access the same record whey you are doing something with a record. 

https://www.freepascal.org/docs-html/prog/progse45.html
6
Hey my challenge peeps!!

I was given owner access to https://github.com/1brc after asking to be included on the https://1brc.dev site.
Yeah, I know, owner... Still don't understand why, but it's where we're at, LOL!! :D
Now I'm in a bit of a pickle: I don't have an icon that will represent Object Pascal.
There's many for Delphi, and many for Lazarus, but none for Object Pascal in general.
Can anyone help me on this?

Cheers,
Gus
7
FPC development / Re: what to do if my target MIPS cpu has no FPU
« Last post by Laksen on Today at 12:49:12 am »
Anything involving fpu_libgcc is the wrong path to look for, pretty sure it's just leftovers from long ago. fpu_soft is the right fputype for softfloat stuff.
Same with CPUFPEMU, as far as I remember it's only relevant for cases where you have mixed support or ancient cpus
8
I've used a generic wrapper function utilizing implicit function specializations that can then be used to access any enumerator.
The current version of FPC does not support {$modeswitch implicitfunctionspecialization}.

With code
Code: Pascal  [Select][+][-]
  1. for S in specialize WrapClass<TInverseStringsEnumerator>(SList.GetInverseEnumerator) do
  2.   Writeln(S);
there is a memory leak.

With
Code: Pascal  [Select][+][-]
  1. for S in specialize WrapRecord<TInverseStringsEnumerator>(SList.GetInverseEnumerator) do
  2.   Writeln(S);
not.
9
General / Re: Converting a string/index to upper/lower ...
« Last post by TRon on April 18, 2024, 11:56:37 pm »
Perhaps it is me doing something wrong but I seem to get very confused by your description about the behaviour of jvDBSearchEdit.

I made a simple test project and when executed it is impossible for me to type a character that isn't 'valid' (according to jvDBSearchEdit).

While typing the edit corrects what I write to match the contents of a field, no matter what I try to do (that is unless typing something that does not match (anymore)).

The first attached picture shows user typing m (lowercase, the edit component itself turns it into uppercase and automatically "selects" the rest of the field) and the second is after typing i after the initial m character (also here the component corrects the resulting edit field automatically as well as selects the rest of the characters).

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, DB, SQLDB, SQLite3Conn, Forms, Controls, Graphics, Dialogs,
  9.   DBGrids, StdCtrls, JvDBSearchEdit;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     DataSource1: TDataSource;
  17.     DBGrid1: TDBGrid;
  18.     JvDBSearchEdit1: TJvDBSearchEdit;
  19.     Memo1: TMemo;
  20.     SQLite3Connection1: TSQLite3Connection;
  21.     SQLQuery1: TSQLQuery;
  22.     SQLTransaction1: TSQLTransaction;
  23.     procedure FormCreate(Sender: TObject);
  24.     procedure FormDestroy(Sender: TObject);
  25.     procedure JvDBSearchEdit1Change(Sender: TObject);
  26.   private
  27.     procedure CreateDB;
  28.   public
  29.  
  30.   end;
  31.  
  32. var
  33.   Form1: TForm1;
  34.  
  35. implementation
  36.  
  37. {$R *.lfm}
  38.  
  39. { TForm1 }
  40.  
  41. procedure TForm1.FormCreate(Sender: TObject);
  42. begin
  43.   // Clear/init Memo
  44.   Memo1.Clear;
  45.   Memo1.Lines.Values['Status'] := 'Entering form creation';
  46.  
  47.   // Setup transaction
  48.   SQLTransaction1.Active := false;
  49.   SQLTransaction1.Action := caCommitRetaining;
  50.   SQLTransaction1.DataBase := SQLite3Connection1;
  51.  
  52.   // Setup connection
  53.   SQLite3Connection1.Connected := false;
  54.   SQLite3Connection1.LoginPrompt :=false;
  55.   SQLite3Connection1.DatabaseName := ':memory:';
  56.   SQLite3Connection1.Transaction := SQLTransaction1;
  57.  
  58.   // Setup query
  59.   SQLQuery1.DataBase := SQLite3Connection1;
  60.   SQLQuery1.Transaction := SQLTransaction1;
  61.  
  62.   // Setup dataset
  63.   DataSource1.DataSet := SQLQuery1;
  64.  
  65.   // Setup grid
  66.   DBGrid1.DataSource := DataSource1;
  67.  
  68.   // Setup jvdbsearchedit
  69.   JvDBSearchEdit1.DataSource := DataSource1;
  70.   JvDBSearchEdit1.DataField := 'Name';
  71.  
  72.   // Create the database
  73.   CreateDB;
  74.  
  75.   SQLQuery1.Close;
  76.   SQLQuery1.SQL.Text:= 'select * from DATA';
  77.   SQLQuery1.Open;
  78.  
  79.   Memo1.Lines.Values['RecordCount'] := SQLQuery1.RecordCount.ToString;
  80.   Memo1.Lines.Values['Status'] := 'Leaving form creation';
  81. end;
  82.  
  83. procedure TForm1.FormDestroy(Sender: TObject);
  84. begin
  85.   SQLQuery1.Close;
  86.   SQLTransaction1.Active := False;
  87.   SQLite3Connection1.Connected := False;
  88. end;
  89.  
  90. procedure TForm1.JvDBSearchEdit1Change(Sender: TObject);
  91. begin
  92. //  Memo1.Lines.Values['jvDBSearch.DataResult'] := (Sender as TJvDBSearchEdit).DataResult;
  93.   Memo1.Lines.Values['jvDBSearch.DataResult'] := (Sender as TJvDBSearchEdit).Text;
  94.   Memo1.Lines.Values['Status'] := 'Updated jvDBSearchEdit';
  95. end;
  96.  
  97. procedure TForm1.CreateDB;
  98. const
  99.   ItemNames: array of string =
  100.   (
  101.     'Bill','John','Eliza','george','Melinda',
  102.     'Sunshine','Omega','Alice','Fabio','Alvin',
  103.     'medusa', 'Gary', 'michael'
  104.   );
  105. var
  106.   ItemName: string;
  107. begin
  108.   // Setup a table "DATA" in newyl created database
  109.   SQLite3Connection1.ExecuteDirect
  110.   (
  111.     'CREATE TABLE "DATA"'+
  112.     '(' +
  113.       ' "id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,' +
  114.       ' "Name" Char(128) NOT NULL' +
  115.     ');'
  116.   );
  117.  
  118.   // Populate table
  119.   for ItemName in ItemNames do
  120.   begin
  121.     SQLQuery1.SQL.text := 'INSERT INTO ' + '"DATA"' + '(Name) VALUES (:Name);';
  122.     SQLQuery1.Params.ParamByName('Name').AsString     := ItemName;
  123.     SQLQuery1.ExecSQL;
  124.   end;
  125.  
  126.   // Make database magic happen
  127.   SQLTransaction1.Commit;
  128. end;
  129.  
  130. end.
  131.  
No fancy visual edit of properties, all manual in code. I only placed the components on a form.
10
FPC development / Re: what to do if my target MIPS cpu has no FPU
« Last post by PascalDragon on April 18, 2024, 11:44:18 pm »
Seems like there are some locations that don't handle software floating point correctly for the MIPS CPU. Best look for fpu_soft inside the other code generator backends and try to adjust locations in the MIPS backend in similar ways.
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018