[Gambas-user] Backward Compatibility with gambas versions added to wiki faq

Christof Thalhofer chrisml at deganius.de
Fri Oct 9 08:15:04 CEST 2020


> Is a Gambas application i make backward compatible with a lesser version of Gambas; ?
> 
> Maybe, depending on the code you have used but not by default.

Thats wrong, IMO. Older bytecode is been executed by the interpreter and
runs in Gambas3 *by default*.

By default older bytecode runs in newer versions.

Bytecode is the product of the compilation process. If you compiled your
code with V3.8 it will be executed and run by the interpreter of Gambas
3.15.

There was a change of the bytecode in 3.15 and the bytecode is tagged
accordingly. So if you execute a bytecode created by a compiler with a
version number *equal or newer than 3.15* with an interpreter of Gambas
*older than 3.15* this old interpreter will complain about that and tell
you:

"bytecode too recent"

Because the bytecode may contain parts the old interpreter *may* not be
able to understand.

With the environment variable 'GB_PCODE_VERSION' you can tell the newer
compiler to tag the bytecode with an older version number so that older
interpreters will not complain.

But you have to ensure that then your code does not contain language
features introduced in the newer version.

Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201009/d50fdee4/attachment.sig>


More information about the User mailing list