4D v16.3

GET QUERY DESTINATION

Home

 
4D v16.3
GET QUERY DESTINATION

GET QUERY DESTINATION 


 

GET QUERY DESTINATION ( destinationType ; destinationObject ; destinationPtr ) 
Parameter Type   Description
destinationType  Longint in 0=current selection, 1=set, 2=named selection, 3=variable
destinationObject  String in Name of the set or Name of the named selection or Empty string
destinationPtr  Pointer in 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)
When the query destination is a local variable (destinationType returns 3), 4D returns a pointer to this variable in the destinationPtr parameter.

Example  

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



See also 

SET QUERY DESTINATION

 
PROPERTIES 

Product: 4D
Theme: Queries
Number: 1155

This command can be run in preemptive processes

 
HISTORY 

Created: 4D v13

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)