• Welcome to PlanetSquires Forums.
 

GOSUB , Option Gosub

Started by Petrus Vorster, August 08, 2022, 04:22:59 AM

Previous topic - Next topic

Petrus Vorster

Hi All

At first Freebasic complained about a gosub routine i tried to include.
I see it has a OPTION GOSUB that should allow normal gosub routines.

Does anyone use it, or is it bad code practice as they say?
Why exclude it, but allow an option to INCLUDE it?

Or how do you work without it, as Gosub is something i use a great deal.

-regards, Peter
-Regards
Peter

Paul Squires

You can not use GOSUB in WinFBE visual designer projects because WinFBE uses #LANG FB

GOSUB can only be used in "QB" or "FBLITE (with option Gosub enabled)"

QuoteDialect Differences:

    Only available in the -lang qb and -lang fblite dialects.
    Gosub support is disabled by default in the -lang fblite unless the Option Gosub statement is used.

Instead of Gosub, i simply refactor my code to do without it, or call a separate sub/function rather than calling the Gosub.

Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Petrus Vorster

Great! That was my thought on getting past it.
Make a function!

On the right track then!

-Peter
-Regards
Peter