Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cant get home from endscan
Message
From
13/06/2013 02:46:16
 
 
To
12/06/2013 22:35:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01576184
Message ID:
01576192
Views:
77
This message has been marked as the solution to the initial question of the thread.
>When i scan for a match and GET a match, i exit and assume the program should break out of the loop.
>what happens here however is that the program continues AFTER the endscan even if i place a RETURN
>
>so the only way i have found to determine if the scan was successful is to place a count in the search.
>
>i must be missing something. Can anyone tell me how to break out of the scan and return to the program that called the lookup procedure without the messy count.
>
>what i want is if the scan is successful in find one match to break out and not go beyond endscan. the only time endscan should be reached is if the scan was not successful in finding a match.
>
>tnx
>k
>
>
>procedure lookup
>cc=0
>scan for sct = TL  
>wait window tl+ " found '
>cc=cc+1
>exit
>RETURN	
>endscan
>		if cc = 0
>		WAIT WINDOW TL+' NOT FOUND '
>		endif
>



Karen,

The RETURN is never executed. The exit transfers control to the statement after the endscan


Don't need the exit, only the return

>
>procedure lookup
>cc=0
>scan for sct = TL  
>wait window tl+ " found '
>cc=cc+1
> && exit
>RETURN	
>endscan
>		if cc = 0
>		WAIT WINDOW TL+' NOT FOUND '
>		endif
>
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform