Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RETRY command
Message
De
18/11/2015 11:27:25
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
RETRY command
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01627594
Message ID:
01627594
Vues:
56
Just curious,

I was just experimenting and noticed this.

If a subroutine is called as a procedure with a DO statement, the RETRY statement will execute the DO statement again as expected. But if the subroutine is called as a function, the RETRY statement acts like a RETURN command. I have not found any documentation that states is the case.

Does anyone have any further insight to this?

Here is a Test Case that demonstrates this
*-- loopless Loop

SET UDFPARMS TO REFERENCE

LOCAL i as Integer 
i = 0

DO LoopLess WITH i
? i      & 10

i = 0
= LoopLess( @i )
? i     && 1, expected 10


*-----------
PROCEDURE LoopLess
	LPARAMETER j
	LOCAL llResult as Boolean
	llResult = .T.
	*
	j = j + 1 
	IF j < 10 THEN 
		RETRY
	ENDIF 
	*
	RETURN llResult
ENDPROC

* EOF
Greg Reichert
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform