Chris Miller
Programmer
This shows the checksum doesn't care for calculated fields (in this case 'fieldsum')
The checksum shuold differ when the calculated field is added, but it stays the same. Adding field2 proves the SET FIELD setting has an effect, but it look as if calculated fields are disregarded.
And they forget to tell that calculated fields need SET FIELDS GLOBAL, but even this doesn't help. I tried many variations, also with Flags set to 3, but either I do something completely wrong or the documentation makes a promise Sys(2017) doesn't keep. Can anybody teach me how this works or confirm it's a bug?
Chriss
Code:
Create Cursor test (field1 C(1), field2 c(1))
Insert Into test Values ('a','b')
Set Fields Global
Set Fields To
? Set("Fields",1)
? Sys(2017,'',0,1)
Set Fields To field1
? Set("Fields",1)
? Sys(2017,'',0,1)
Set Fields to fieldsum = field1+field2
? Set("Fields",1)
? Sys(2017,'',0,1)
Set Fields To field2
? Set("Fields",1)
? Sys(2017,'',0,1)
The checksum shuold differ when the calculated field is added, but it stays the same. Adding field2 proves the SET FIELD setting has an effect, but it look as if calculated fields are disregarded.
VFP help said:If you specified a setting for SET FIELDS, the checksum is calculated based on the current list specified by SET FIELDS [highlight #FCE94F]which could include calculated fields[/highlight][highlight #FCE94F][/highlight].
Calculated fields are temporary fields that exist in the current cursor based on an expression but are not defined in the actual table structure. For example, the field LOCATION is a calculated field:
Code:Use Customer SET FIELDS TO LOCATION = ALLTRIM(city) + ',' + state
And they forget to tell that calculated fields need SET FIELDS GLOBAL, but even this doesn't help. I tried many variations, also with Flags set to 3, but either I do something completely wrong or the documentation makes a promise Sys(2017) doesn't keep. Can anybody teach me how this works or confirm it's a bug?
Chriss