[Lazarus] Old Lazarus code fail at runtime

Chavoux Luyt chavoux at gmail.com
Thu Dec 29 08:40:04 CET 2016


Hi,

From: Giuliano Colla <giuliano.colla at fastwebnet.it>
> Just a wild guess. The villain might be some property (such as FileName,
> Filter or InitialDir) that you did set up with old Lazarus at design
> time and which isn't compatible with current version. Revising the
> design time properties of your File Open Dialog with Object Inspector
> should fix the issue.
> Giuliano
>
How do I do this? I created a new TOpenDialog (should be new version now?)
with the same name and the same InitialDir property set as "./data/text".
Still the same error (also when using the TOpenPictureDialog with
InitialDir set to "./data/photo"). However, just opening the file itself
using

>      brdNr := StrToInt(NumberStr);
>      brdNr := brdNr + 1;
>      NumberStr := AddChar('0', IntToStr(brdNr), 3);
>      FileNm := 'file://' + BaseDir + '/text/' + NumberStr + '.htm';
>      Self.IpHtmlPanel1.OpenURL(fileNm);
> AND
>      FileNm := BaseDir + '/photo/' + NumberStr + 'a.jpg';
>  Image.Picture.LoadFromFile(fileNm);
>      FileNm := BaseDir + '/plate_bd/' + NumberStr + 'a.png';
>      ImageDraw.Picture.LoadFromFile(fileNm);
>

it works without problems.
<SNIP>

> From: DougC <doug at moosemail.net>
> Has OpenDialog been created at this point? Better to double check by
> changing to
>
>
>
> if Assigned(OpenDialog) then
>
>   OpenDialog.Execute
>
> else
>
>   raise Exception.Create('OpenDialog not yet created');
>
> Yes, has it has been created. Adding the check has no effect at all.

I use the following code elsewhere (but only after executing and closing
the OpenDialog:

>   NumberStr := AnsiLeftStr(NumberStr, RPos('.', NumberStr)-1);
>
>   NumberStr := AnsiRightStr(NumberStr, 3);//RPos('/', NumberStr));
>
> Can this have an influence on the OpenDialog?

Any other ideas?

Cheers,
Chavoux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20161229/1c47759e/attachment.html>


More information about the Lazarus mailing list