Syntax
DETERMINE BACK <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 Back can be abbreviated as DT Back.
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 Back logic command reads persistent class records into memory from the database in reverse profile order, starting back 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 the reverse 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 Back 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 = T, then the output is as follows. The output displays the product details of the products in reverse order, starting from the specified value which is “T”. Since there is no product whose name is “T”, Determine Back looks in reverse order 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 |
1 |
Outfit for Dogs |
9 |
Leather Belt |
4 |
KittenCaps |
3 |
Gimborn R-7 |
6 |
DogBelt |
2 |
Chips for Cats |
7 | CatBathSoap |