This can be useful for testing selected chunks of code during development, but it also gives you a VFP equivalent to the SQL Server Query Analyzer. In SQL Server, you can store several batches of T-SQL statements in a single query file and run them independently of one another using the Query Analyzer. In VFP, you can store several groups of SQL statements in a single program file and run them independently of one another using the Execute Selection command in a VFP editing window.
As in the Query Analyzer, you can revise the code in the VFP editing window and execute it without having to save the file. Unlike the Query Analyzer, though, the F5 key does not execute the selection in a VFP editing window. Neither does VFP recognize the GO command that signals the end of a batch in the Query Analyzer (GO has a different meaning in VFP); if you need a way of ending a batch of statements in VFP, use RETURN.
VFP's Execute Selection feature can be useful during development and testing of almost any kind of VFP code, but it's particularly handy when you're working with lengthy SQL statements. While you could use the VFP Command window for the same purpose, an editing window is much more usable when individual statements run into several lines of code, which is typically the case with SQL statements. A program file is of course also more useful than the command window when you want to save your work and return to it later.