| 4D v15.4GET QUERY DESTINATION | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | 
    4D v15.4
 GET QUERY DESTINATION 
         | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET QUERY DESTINATION ( destinationType ; destinationObject ; destinationPtr ) | ||||||||
| Parameter | Type | Description | ||||||
| destinationType | Longint |   | 0=current selection, 1=set, 2=named selection, 3=variable | |||||
| destinationObject | String |   | Name of the set or Name of the named selection or Empty string | |||||
| destinationPtr | Pointer |   | Pointer to local variable if destinationType=3 | |||||
The GET QUERY DESTINATION command returns the current destination of query results for the process underway. By default, query results modify the current selection, but you can change this using the SET QUERY DESTINATION command.
In the destinationType parameter, 4D returns a value indicating the current destination of queries and in the destinationObject parameter it returns the name of the destination (if applicable). You can compare the value of the destinationType parameter with the constants of the Queries theme:
| Constant | Type | Value | 
| Into current selection | Longint | 0 | 
| Into named selection | Longint | 2 | 
| Into set | Longint | 1 | 
| Into variable | Longint | 3 | 
The value returned in the destinationObject parameter depends on the value of the destinationType parameter:
| destinationType parameter | destinationObject parameter | 
| 0 (current selection ) | destinationObject is an empty string | 
| 1 (set) | destinationObject contains the name of the set | 
| 2 (named selection ) | destinationObject contains the name of the selection | 
| 3 (variable) | destinationObject is an empty string (use the destinationPtr parameter) | 
We want to modify the query destination temporarily and then restore the previous parameters:
 GET QUERY DESTINATION($vType;$vName;$ptr)
  //retrieval of current parameters
 SET QUERY DESTINATION(Into set;"$temp")
  //temporary modification of destination
 QUERY(...) //query
 SET QUERY DESTINATION($vType;$vName;$ptr)
  //restoring parameters
	Product:  4D
	Theme:  Queries
	Number:  
        1155
        
        
        
	
	Created:  4D v13
	
	
	4D Language Reference ( 4D v15.4)
	
	
	4D Language Reference ( 4D v15)
	
	
	
	
	
	4D Language Reference ( 4D v15.3)
 Add a comment
Add a comment