* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Starting chromium-browser from within a lazarus program
« Last post by rvk on Today at 02:28:50 pm »
Next question - what is the easiest way to determine from my lazarus program whether the RasPi currently has an internet connection, so I can grey out the button which calls the runcommand if there's no internet connection available?
You could try to retrieve a webpage.
You could use http://checkip.amazonaws.com/. In that case you also get your IP directly back.

Something like this:
Code: Pascal  [Select]
  1. uses fpHttpClient;
  2.  
  3. function IsInternetConnectionActive: Boolean;
  4. begin
  5.   with TfpHttpClient.Create(nil) do
  6.   try
  7.     try
  8.       Get('http://checkip.amazonaws.com/');
  9.       Result := true;
  10.     except
  11.       Result := false;
  12.     end;
  13.   finally
  14.     Free;
  15.   end;
  16. end;
  17.  
  18. procedure TForm1.Button1Click(Sender: TObject);
  19. begin
  20.   if IsInternetConnectionActive then
  21.     Self.Caption := 'Internet active'
  22.   else
  23.     Self.Caption := 'Internet DOWN';
  24. end;
(Note, if you run this in the IDE with no internet connection, you also get an exception-dialog which you can "Continue")

This only checks if checkip.amazonaws.com is available. If that service is down it will give you false while the rest of the internet could still be available, but at least it's a start.
2
General / Re: Thread Safety?
« Last post by rvk on Today at 02:11:03 pm »
Code of ASerge works fine for me on Windows.
Attached a compilable test-project.
3
FPSpreadsheet / Re: Cannot load ods file with formulas
« Last post by Arion58 on Today at 02:09:35 pm »
@wp: As I read your post, this is exactly what I need (and what I suggested). Thank you very much. Just one more question: Where can I find the new revision 6209, and how to install?
Unfortunately, at this very moment I don't have the time to try, but I certainly will. And I will let you know my results.
4
General / Re: Thread Safety?
« Last post by howardpc on Today at 01:38:51 pm »
@ASerge

I tried your code on linux (under debugger), and if the timer interval is set low enough (~30 or below) the progressbar does reach its Max.
However, the form remains unresponsive, and the app has to be killed.
Have I missed a vital piece?
5
General / Re: Problem with sorting string (filepaths)
« Last post by molly on Today at 01:27:01 pm »
Attached is natural string comparing functions from Martin Pool (1:1 translation from c to Pascal) Original c files included as well as some test-data and Pascal example.

Follow ASerge's lead and use sort function like this:
Code: Pascal  [Select]
  1. function NaturalSort(List: TStringList; Index1, Index2: Integer): Integer;
  2. var
  3.   a, b: pnat_char;
  4. begin
  5.   a := pnat_char(List[index1]);
  6.   b := pnat_char(List[index2]);
  7.  
  8.   if List.CaseSensitive
  9.   then Result := strnatcmp(a, b)
  10.   else Result := strnatcasecmp(a, b);
  11. end;
  12.  

Happy coding !
6
Third party / Re: Online Package Manager + ct4laz repository
« Last post by GetMem on Today at 01:17:36 pm »
Quote
I knew something would be wrong. A typo in the package name... This is the new update link: https://sourceforge.net/projects/lazarus-ccr/files/PascalTZ/OPM/update_PascalTZ.json/download.
Just updated the link. It works fine now.
7
General / Re: Thread Safety?
« Last post by knuckles on Today at 01:01:38 pm »
Yes I have also heard a lot of bad things about Application.ProcessMessages,

I will take more time to read these follow up messages and examples. I was going to attempt something today but glancing at what has been posted I think I would have ended off track, so thanks again everyone for your input I will study what has been posted and play around some more :)

The main thing I was interested in was ensuring I made my threads safe and don't violate coding standards etc, of course seeing examples helps a lot to know what the syntax and things look like too.
8
General / Re: Error in conditionals - Lazarus 1.8.0 Win32
« Last post by josh on Today at 12:49:21 pm »
@Thaddy
Quote
Today I became $111100

Happy 60th Birthday  ;)
9
Third party / Re: Online Package Manager + ct4laz repository
« Last post by wp on Today at 12:20:01 pm »
I knew something would be wrong. A typo in the package name... This is the new update link: https://sourceforge.net/projects/lazarus-ccr/files/PascalTZ/OPM/update_PascalTZ.json/download.
10
General / Re: Error in conditionals - Lazarus 1.8.0 Win32
« Last post by Thaddy on Today at 12:16:15 pm »
Therefor I added a more serious note...
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