Recent

Author Topic: [solved] Projects in C:\lazarus\examples - openurltest  (Read 2103 times)

PeterX

  • Sr. Member
  • ****
  • Posts: 404
[solved] Projects in C:\lazarus\examples - openurltest
« on: May 12, 2017, 01:59:02 pm »
example openurltest

This makes more sense to me:

Quote
procedure TForm1.btnOpenURLHTTPClick(Sender: TObject);
begin
  // [original code] editResult.Text := BoolToStr(OpenURL('www.google.com'));

  editResult.Text := BoolToStr(OpenURL(editFilename.Text));
  if LeftStr(editFilename.Text, 7) <> 'http://'
    then ShowMessage( editFilename.Text +#13#13
                      +'is not a valid URL');
end;
« Last Edit: May 15, 2017, 02:03:45 pm by PeterX »
usually using latest Lazarus release version with Windows 10

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Projects in C:\lazarus\examples - openurltest
« Reply #1 on: May 12, 2017, 02:31:38 pm »
'www.google.com' is perfectly fine for OpenURL.

But, in r54878 I modified the demo to use default values if the url/filename edit is empty ('www.google.com', or 'mainform.pas'). And I added the optional parameter true to the BoolToStr in order to display the boolean result values as "true" and "false" instead of "-1" and "0".
« Last Edit: May 13, 2017, 12:35:56 am by wp »

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: Projects in C:\lazarus\examples - openurltest
« Reply #2 on: May 12, 2017, 02:54:56 pm »
Okay, well done, thanks !

I found the trunk access via browser so I can see now if something's changed.
https://svn.freepascal.org/svn/lazarus/trunk/examples/openurltest/mainform.pas
usually using latest Lazarus release version with Windows 10

 

TinyPortal © 2005-2018