Hallo Fred van Stappen,
vous ecrit au Fri, 27 May 2022 14:09:26 +0000:
> OK, fixed in last mseide-msegui commit:
...
> The trick is to add {$modeswitch arraytodynarray} in mo2arrays.pas
> and mo4stock.pas. See:
Sorry, I have to contradict. That's not a trick, that's a crutch at
best. The cause for the compiler complaints lies elsewhere. It is the,
historically justifiable, decision to use static array for the "stock"
predefined text items. They're historically justified by the fact that
with fpc before 3.0 there was no really appealing way to provide such
data, although even then, it might have been possible to preset them
within an initialization section in the defining unit, "mseconsts.pas".
But of course, there have been deep and far reaching modifications to
that unit in the progresss of implementing the "dynpo" functionality.
Since introduction of fpc 3.0, dynamic array have "constructors",
which can be used to achieve everything and more of what's needed to
initialize these arrays, defined as a standard type. That way, there's
no type conversion required any more for their use in combination with
other dynamic arrays, as e.g. in "mse4stock,pas", and so there are no
compiler complaints any more. Perhaps this could even eliminate a few
other compiler messages at places that use these data in a similar
manner.
BTW, there was another place in the "podemo_formscan" demo where the
compiler complained about incompatible types, that was a usage of a
plain enumeration as an index of integer type for these arrays.
Interestingly, the index variable was written in parentheses, so it
must have been coerced some way before, but that had been eliminated
sometime. All versions of that program I have are that way, even.
Simply inserting an "ord" function in front of the parantheses resolves
the complaints, and that's what I have done to the NEW version of the
demo project file on my web site.
There's another new file, too, named "mseconsts.zip", that contains a
modified "mseconsts.pas" unit file. It is changed according to the
observations above and will NO LONGER produce the compiler messages
that triggered this thread.
I hope that you can make some use of this and continue to advance
mseide-msegui on its way in the future!
--
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
-----------------------------------------------------------
Mit freundlichen Grüßen, S. Schicktanz
-----------------------------------------------------------
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk