Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RETRY command
Message
From
18/11/2015 11:27:25
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
RETRY command
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01627594
Message ID:
01627594
Views:
55
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
Next
Reply
Map
View

Click here to load this message in the networking platform