Determine From

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.

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