Basic syntax

scott.lindsay

New Member
Hi all,

Am brand new to Progress/4GL so this is probably the easiest question ever. I want to set up a default value to be false whenever a new row is added but I can't get the syntax right.

So far I've got

find first ttCustomer where ttCustomer.RowMod = 'A' assign ttCustomer.FinCharges = false

Please can someone tell me where I'm going wrong

Thanks
 
Logicals always default to false on record create. But just to make sure, you could change the definition of the field to

FIELD FinCharges AS LOGICAL INITIAL FALSE
 
Code:
find first ttCustomer where ttCustomer.RowMod = 'A' .
 assign ttCustomer.FinCharges = false.

Remember the .
 
First, why the find first? There is some question that there is ever a useful place for find first.

The where clause suggests trying to set it for all records that match that criterion. If so, you need a for each.

The use of the word default suggests you want a dictionary default, but the where clause suggests you want it conditional. Which is it?

What is the context? Are you doing update directly into a customer buffer? Bad start since that means user input within a transaction scope. Do IO into local variables and create and modify the record buffer in a tight block with no UI.
 
Back
Top