Recent Posts

Pages: [1] 2 3 ... 10
General / Dealing with OO UNO through Windows Service Application
« Last post by mith on Today at 09:24:27 pm »
I'm sucessfully using OO Document automation in my application like it is described here:

Last hours I spent trying to port some of the functionality to the Windows Service application that is running without gui - no success. I only need to open a template (*.odt file), replace some text, save the file.
I'm wondering if it is wheather possible.
Has anyone a experience with that?
Thanks in advance for any advise.
General / JSON Config sometimes file is empty
« Last post by Lainz on Today at 09:22:56 pm »
Hi, this is a strange bug, we have this function:

Code: Pascal  [Select]
  1. function GuardarConfig(sKey: string; sValue:string):boolean;
  2. var
  3.     JsonConf: TJSONConfig;
  4.     sSeccion: string;
  5. begin
  6.  try   // TJSONConf is component, so needs an owner.
  7.     JsonConf:=TJSONConfig.Create(nil);
  8.     if gsRealm='' then
  9.         sSeccion:='local'
  10.     else
  11.         sSeccion:=LowerCase(gsRealm);
  12.     Try
  13.        // Set filename. This will read the file.
  14.        JsonConf.FileName:=DirectorioAplicacion+'config.json';
  15.        JsonConf.SetValue('/'+sSeccion+'/'+sKey,sValue);
  16.        if sSeccion<>'local' then //siempre guardo en local para q se use cuando no hay realm
  17.           JsonConf.SetValue('/local/'+sKey,sValue);
  18.        JsonConf.Flush;
  19.     finally
  20.        JsonConf.Free;
  21.     end;
  23.  except
  25.  end;
  26. end;

With that method we store the config in the application config folder.

But sometimes the file is empty, there is any reason because this error can happen?
Linux / Re: Lazarus 2 Raspbian
« Last post by af0815 on Today at 09:20:47 pm »
I build direct on RasPi 3B+with fpc 3.2 and Laz 2.0 and can crossbuild on Win10 to RasPi with the same Version. No Problem.

Both Versions are build with fpcupdeluxe.
General / Re: Need Combobox with full text search
« Last post by sstvmaster on Today at 09:06:08 pm »
In  {$MODE Delphi}?

But i think i'm not the only one who need this. Why this does not exist, already?

Greetings Maik
General / Re: Need Combobox with full text search
« Last post by JuhaManninen on Today at 08:30:09 pm »
Windows / How to translate a Delphi7 proj to Lazarus 1.6??
« Last post by stephanweber on Today at 08:22:52 pm »

I found that some parts, which I used very often in Delphi7, cause now programs if a migrate to Lazarus  :D.
E.g. I need to remove Windows stuff like printer setup dialogs, messagebeep, winexec, etc. This is expected, and often easy because I can simply comment these things out.

BUT, what about things placed in formulars, like a component gfvcl which gave me a gradient fill in Delphi?
Or how to change a spinbutton to updown component of Lazarus?

The problem is that Lazarus simply does not open the forms. It would be good to instruct Lazarus just to skip reading-in such Windows-Delphi-specific stuff, but how?
What would also help is a text view for formulars, like in Delphi. Then I could edit within this text view. But I have not found such feature in Lazarus yet.

Any hints are highly welcome, thanks!

Bye Stephan
Hi wp,

Thank you. Your update has fixed the Divide By Zero problem.

However, I don't see Google Map in the list. Plus, every time I click on the map and enter the name of the location to add to the point list, it crashes.

I have KcMapViewer in working condition, but it doesn't have a way to add or delete marker on the map for a given LONGITUDE and LATITUDE and keep it in place even if you move the map around. I easily modify the Kcmapviewer to include markers on the map, but it is going from Longitude and Latitude to X,Y on the screen. It is bit too confusing.
General / Re: Multi Lineseries
« Last post by mpknap on Today at 07:34:30 pm »
Dear WP.
That's the whole procedure. It works well, it shows what I want.
There is only one problem.

Code: Pascal  [Select]
  1. procedure TForm4.Button3Click(Sender: TObject);
  2. const
  3.   BLOCK_SIZE = 1000;
  4. var
  5.   Deteccion: array{[1..15000]} of thit;
  6.   f: textfile;
  7.   d, i, j, y, z: integer;
  8.   ex, cc: int64;
  9.   plik, dir, xxx: string;
  10.   dt: tdatetime;
  11.   Users: TStringList;
  12. begin
  13.   Users := TStringList.Create;
  14.   Users.Duplicates := dupIgnore;
  15.   Users.Sorted := True;
  18.   dir := GetCurrentDir;
  19.   chdir(dir + '\DATA');
  20.    begin
  22.     plik := label6.Caption;
  23.     AssignFile(f, plik);
  24.     reset(f);
  25.     i := 0;
  26.     SetLength(Deteccion, 0);
  28.     while not EOF(f) do
  29.     begin
  30.       if i mod BLOCK_SIZE = 0 then
  31.         SetLength(Deteccion, Length(Deteccion) + BLOCK_SIZE);
  33.       readln(f, cc);
  34.       Deteccion[i].time := cc;//div 1000;
  35.       readln(f, xxx);
  36.       Deteccion[i].lat := xxx;
  37.       readln(f, xxx);
  38.       Deteccion[i].long := xxx;
  40.       readln(f, xxx);
  41.       Deteccion[i].user_n := xxx;
  43.       readln(f, xxx);
  45.       readln(f, xxx);
  46.       Deteccion[i].user_name := CP1250ToUTF8(xxx);
  47.       Users.Add(Deteccion[i].user_n);
  49.       readln(f, xxx);
  50.       Inc(i);
  51.     end;
  52.     closefile(f);
  53.     SetLength(Deteccion, i);
  55.     // The stringlist "UserNames" contains the list of all user names. Each user
  56.     // name should have its own line series.
  57.     SetLength(Series_ar, Users.Count);
  59.     z := 0;
  60.       for j := 0 to Users.Count - 1 do
  62.     begin
  63.       Series_ar[j] := TLineSeries.Create(Chart1);
  64.       Series_ar[j].ShowPoints := True;
  65.       Series_ar[j].Pointer.Brush.Color := rgb(Random(256), Random(256), Random(256));
  66.       ;
  67.       Series_ar[j].Pointer.Pen.Color := clBlack;
  68.       Series_ar[j].Pointer.Style := psCircle;
  69.       Series_ar[j].Title := '';
  70.       Chart1.AddSeries(Series_ar[j]);
  71.      end;
  72.       d := 0;
  73.     for j := 0 to High(Deteccion) do
  74.     begin
  75.       d := Users.IndexOf(Deteccion[j].User_n);
  76.       if d = -1 then
  77.         continue;
  78.         DT := unixToDateTime((Deteccion[j].time) div 1000);
  80.       Series_ar[d].AddXy(Deteccion[j].time, StrToInt(Deteccion[j].user_n){dt}, 'a');
  81.         Series_ar[d].Title := (Deteccion[j].user_name);
  83.     end;
  85.   end;
  86.   chdir(dir);
  87.   Users.Free;
  88. end;          

I also display the results in ChartListBox.
When I click Button3 for the first time, the results are ok. But when you re-click the ChartListBox, the results are added to the previous data. The graph is ok. How do I reset ChartListBox before redrawing?

I tried, ChartListbox1.clear, ... free, ... DeleteSelected and nothing.
General / Issue with fpvectorial and Onedrive
« Last post by LittleBritaly on Today at 07:26:00 pm »
I'm using Lazarus on a mac.

I'm pulling information from a database and placing it into a .docx file then saving the .docx on OneDrive locally, I'm using fpvectorial to do this.

The .docx will then be shared with customers.

Shortly after, the file shows up in Onedrive online (so in my web browser), but when I try and open it in Word Online, I'm told "Sorry, this document can't be opened for editing".

If I open the file locally in Libreoffice, then save it (even without making any changes), I can then open it for editing in Word online.

The permissions of the file don't change after saving in Libreoffice, but the file size changes significantly (from 8294 to 13597).

Does anyone have any idea what the issue could be ?

Third party / Re: Fpcupdeluxe
« Last post by xinyiman on Today at 07:25:19 pm »
I not found in ZDbcOracleStatement.pas this code
Code: Pascal  [Select]
  1. FExecStatements[FCallExecKind].RegisterParameter(IDX,
  2.           Descriptor.SQLType, OCIParamTypeMatrix[Descriptor.OrdPos = 0][Descriptor.IODirection], tmp,
  3.             Max(QWord(Descriptor.DataSize), QWord(Descriptor.Precision)), Descriptor.Scale);
Which version of zeos do you have installed? I 7.2.4-stable
Pages: [1] 2 3 ... 10