PlanetSquires Forums

Support Forums => General Board => Topic started by: Petrus Vorster on August 08, 2022, 04:52:59 AM

Title: GOSUB , Option Gosub
Post by: Petrus Vorster on August 08, 2022, 04:52:59 AM
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
Title: Re: GOSUB , Option Gosub
Post by: Paul Squires on August 08, 2022, 10:39:45 AM
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.

Title: Re: GOSUB , Option Gosub
Post by: Petrus Vorster on August 08, 2022, 10:46:50 AM
Great! That was my thought on getting past it.
Make a function!

On the right track then!

-Peter