IS 6.3.0-dev: Pos function - Type mismatch

75 views
Skip to first unread message

Alex Born

unread,
Jun 5, 2024, 7:27:32 AMJun 5
to innosetup
Hi!

On Inno Setup 6.2.2 and below, the example script provided can be compiled and tested.
But on Inno Setup 6.3.0-dev it does not compile.
Error in POS function - “Type mismatch”.

What has changed after Inno Setup 6.2.2? Why the error?

Func_POS.png

Example script:
Example_FormatFloat.iss

Wilenty do ut des

unread,
Jun 5, 2024, 2:12:44 PMJun 5
to innosetup
Hi all.

Change this line:
          if not IsStringType(Tmp.ExpectedType.BaseType) then
from:
https://github.com/remobjects/pascalscript/blob/fa5fcb67e77eeca980eeb944a66c7d5e4ceff165/Source/uPSCompiler.pas#L9581
to:
          if not IsStringOrCharType(Tmp.ExpectedType.BaseType) then

This build does not have this bug:
https://github.com/Wilenty/InnoSetup-with-latest-LZMA/releases/tag/v6.3.0-betafLZMA2406sc

By the way, I attach simplest example of this bug with explanation what should be changed (same as above).

Greetings,
Wilenty
PosBugSimpleTest.iss

Martijn Laan

unread,
Jun 6, 2024, 2:51:40 AMJun 6
to innosetup
Hi,

In 6.2.2 and older you could write strange things like Pos(1, 2) without a compile-time error.

Pos and other functions use AnyString parameters and I added a missing type check for those, but my check only allowed strings and not chars so that why you got an error, sorry.

I've fixed this in Git and will upload a new build later.

Thanks for reporting.

Greetings,
Martijn

Martijn Laan

unread,
Jun 6, 2024, 7:44:20 AMJun 6
to innosetup
I've uploaded the new build, please try it:

Compared to the previous build this comes with two extra Compiler IDE features I personally find quite exciting:
  • Added multiple selection support (Ctrl+Click or Ctrl+Drag).
    Typing, backspace, delete, undo, redo, copy, and paste all work with multiple selections added this way or via the pre-existing support for performing rectangular block selection (Alt+Shift+Arrow or Alt+Drag).
    Also added a shortcut to revert multiple selections into a single one or a single selection into an empty one (Esc).
  • Added new Highlight occurrences of current selection and Highlight occurrences of current word options.
    The first is enabled by default and the second is disabled by default.
I expect to make an official release soon now, so I appreciate it very much if you let me know asap when you (or anyone else) find more problems.
The full list of changes can be seen at https://jrsoftware.github.io/issrc/whatsnew.htm

Greetings,
Martijn


Op woensdag 5 juni 2024 om 13:27:32 UTC+2 schreef alex.b...@gmail.com:
Reply all
Reply to author
Forward
0 new messages