Recent

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

rvk

  • Hero Member
  • *****
  • Posts: 3842
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: 375
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 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit