Recent

Author Topic: Windows 10 and FormClose  (Read 22977 times)

rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: Windows 10 and FormClose
« Reply #105 on: July 12, 2019, 05:43:13 pm »
Just add {$H-} at the top (instead of {$H+} and be done with all the hassle of checking for Long- and ShortStrings altogether.
This recommendation is probably ok for a calculator application, but not in general, IMHO. The user at least must be aware of the consequence that strings cannot be longer than 255 characters then.
Yes, that's wat I also already mentioned in a previous post. Because the application isn't really string oriented (as calculator) the {$H-} would be the safest and fastest option. For all others you need to make certain choices. So when dealing with FPC 3.0.4 and lower in combination with Str() in {$H+} you need to be careful.

In other applications I wouldn't even begin to consider using Str(n:x:y) anyway. I would use format(). I know for sure Delphi doesn't use Str() internally for format (but I'm not sure if FPC does).

rick2691

  • Sr. Member
  • ****
  • Posts: 444
Re: Windows 10 and FormClose
« Reply #106 on: July 12, 2019, 06:19:05 pm »
@rvk et.al.

Thanks for your diligence. Its been a mess.
Windows 11, LAZ 2.0.10, FPC 3.2.0, SVN 63526, i386-win32-win32/win64, using windows unit

 

TinyPortal © 2005-2018