Syntax
DETERMINE FROM <iterator> [ SERIAL ] [ SECURE | KEYONLY ] [ MULTI records ] [ GS status ] <logic_block> END | ENDEXIT | ENDNOPRINT <iterator> := <object> | <profile> <object> := object_name( argument [ ,...n ] ) <profile> := object_name.profile_name( argument [ ,...n ] )
Parameters
Determine From can be abbreviated as DT From.
iterator
The profile or persistent class to read. If a class is specified, records are read using the class's default profile.
,.…n
The key values to start reading back from.
SERIAL
Increases efficiency by retaining pointers. Refer to Serial for more information.
SECURE
Facilitates record locking of the database in applications that do not force integrity. Refer to Secure for more information.
KEYONLY
The KeyOnly command option is not supported on applications that are deployed to Windows.
For MCP-based systems, refer to KeyOnly.
MULTI records
The Multi command option is not supported on applications that are deployed to Windows or MCP.
GS status
Indicates if there are no records retrieved, using the specified qualifier.
Description
The Determine From logic command reads persistent class records into memory from the database in profile order, starting from the specified key values. The data read from the database is stored in the instance of the persistent class specified in the command.
Refer to Determine Variants for more information on the Determine logic command.
Example
This example illustrates code from a report that reads records from the product table by using a profile called P_ProductName, retrieving the records in forward order, starting from the specified value. The ProductID and ProductName are moved from each retrieved record into a ProductDetail frame and printed.
Message Attention “Please enter the starting product name” Accept Start_name Determine From Product.P_ProductName (Start_name) ProductDetail.ProductID := Product.ProductID ProductDetail.ProductName := Product.ProductName ProductDetail.Print() End If (GLB.STATUS = "*****") Message Attention "No Product records found from starting name" End
For this example, if the input is provided as Start_name = “P”, then the output is as follows. The output displays the product details of the products in forward order, starting from the specified value which is “P”. Since there is no product whose name is “P”, Determine From looks forward for the next record and in this example the first record retrieved is the one whose product name is “PetOutfit”.
Product ID |
Product Name |
---|---|
8 |
PetOutfit |
5 |
Toys for Cats |
10 | ToyPet |