>Cetin,
>
>I mean setting a data environment in .prg just like we can do in forms. as i won't use visual tools to design a form and use .prg to generate a form, i want to know how to set data environment in a .prg as we can set it in forms.
>thanks for your reply!!!
>
>Linda
Linda,
I'm not sure I still understand it right. Anyway let me try :)
Now suppose within a dataenvironment you'd put few tables where some are linked.
Dataenvironment would look like (settings imaginary - using testdata.dbc tables to make it more clear):
InitialSelected alias - Customer
Customer - BufferModeOverride = 5, order = 'Company' && Assume this tag existed
Orders - BufferModeOverride = 5, order = 'cust_idx'
* Cust_idx is our modified version of cust_id tag
* We want to have customer orders per particular customer
* from last date to first and created this tag with expression :
* Index on cust_id + dtos(order_date) tag cust_idx DESCENDING
Products - order = 'ProdName' && Again assume this existed - I can't remember if really exists
There is a relation from Customer (cust_id) to table3 (cust_idx tag - cust_id+date combination)
This would translate to .prg code version like this :
use customer in 0 order tag Company
use orders in 0 order tag Cust_Idx
use products in 0 order tag ProdName
select customer
set relation to cust_id into Orders
cursorsetprop('Buffering',5,'customer')
cursorsetprop('Buffering',5,'orders')
However I'd ask why not use visual tools ? Use them whenever you can IMHO.
For example DataEnvironment is not just only a visual tool but opening of tables from DE and code use different mechanisms and DE version using lowlevel interfaces is faster (of course it's only a theoritical issue since we don't open hundreths of tables per table to show the difference between DE and in code from load event).
Cetin