Recent

Author Topic: Getting format error loading form  (Read 562 times)

MISV

  • Hero Member
  • *****
  • Posts: 808
Getting format error loading form
« on: January 23, 2025, 08:42:52 am »
My usual Windows/Delphi to Mac/Lazarus process is to have Lazarus open the Windows form file and remove all invalid properties. This generally works well.

However, today I for the first time got a funky error *after* this when trying to load the form

Format error

Quote
Unable to convert text form data of file "...path..." into binary stream. (Wrong token type: = expected byt Symbol found (at 326,24, stream offset 00002059))

The offending line appears to be

Code: Pascal  [Select][+][-]
  1.                   Style = csDropDown

If we assume first COL is 1 then "=" is placed on COL 25 (but if zero indexed it is ar 24)

I read this as an error in occuring in the reader (and not an error in actually trying to convert this to a "live" component on the form)



Any ideas?

n7800

  • Full Member
  • ***
  • Posts: 235
Re: Getting format error loading form
« Reply #1 on: January 23, 2025, 04:04:34 pm »
I have no idea if this is related, but I want to share a similar error, which with its "hint" confused me as much as possible and took a lot of time: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41323

If you want to investigate this, then try opening your file in another version of Lazarus to see if this is a regression. If so, then it will be easy to find the culprit commit.

wp

  • Hero Member
  • *****
  • Posts: 12578
Re: Getting format error loading form
« Reply #2 on: January 24, 2025, 11:56:19 am »
Quote
Unable to convert text form data of file "...path..." into binary stream. (Wrong token type: = expected byt Symbol found (at 326,24, stream offset 00002059))
Recently I had the same or a similar error after I had modified a package and did not do a clean rebuild of the IDE. So, maybe just try that.

MISV

  • Hero Member
  • *****
  • Posts: 808
Re: Getting format error loading form
« Reply #3 on: January 24, 2025, 02:07:44 pm »
I think you may be right.

I imported the form into Lazarus on Windows. No problems. And moving the file to my Mac afterwards works. So it must be some versioning difference between them. (Mac version newer)

 

TinyPortal © 2005-2018