Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug: RETURN TO ProcName .F. causes spurious syntax error
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Bug: RETURN TO ProcName .F. causes spurious syntax error
Divers
Thread ID:
00620089
Message ID:
00620089
Vues:
54
My testing under VFP6 SP4 and earlier versions indicates that there is a bug that incorrectly generates a syntax error when a RETURN TO ... statement specifies a literal .F. as the value to be returned. The following form of RETURN statement produces a syntax error upon compilation:

RETURN TO ProcedureName .F.

Note, however, that the following forms of RETURN statement compile and run without error:

RETURN TO ProcedureName 123 && i.e. numeric literals are OK
RETURN TO MASTER .F. && i.e. MASTER works even for literal .F.

Use of &-macro expansion on the ProcedureName avoids the compile-time error, but it will fail with a syntax error at runtime:

procname = 'any_proc'
RETURN TO &procname .F. && this fails with syntax error at runtime

Here is a workaround that compiles and works in runtime as well: substitute a memory variable reference for the literal .F., e.g.:

retval = .F.
RETURN TO ProcedureName m.retval && this returns .F. successfully

or

RETURN TO &procname m.retval && this returns .F. successfully

If anyone can confirm the existence (or fixing) of this bug, esp. in more recent VFP releases, that would be appreciated. Thanks in advance.

Mike
Montage

"Free at last..."
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform