Dateformula field

Hi, I openned table with RecordRef and Fieldref object. I read some text values from external source and I want insert then into opened table. When I use Fieldref.value:= Variant; or Fieldref.value(Variant); with string in Variant, Attain said me, then I cannot convert Text into Dateformula data type. Thanks for any valuable answer,

Hi Rudolf, it seems like the field “Fieldref.Value” is some Date field. So instead of Fieldref.Value := Variant; try following: EVALUATE(Fieldref.Value, Variant); Michal


Originally posted by m_dano […] EVALUATE(Fieldref.Value, Variant); […]

I tried something like this with 3.70 (HF12) client and get following error message:


A variable was expected. For example: MyVar Customer.Name

The cursor is set toEVALUATE(**|**Fieldref.Value,Record.Field); Can anybody tell me how to evaluate a value into a FieldRef?

Evaluate the Variant into a variable which type matches the type of the field you want to put the value in. Then put that variable into the fieldref: EVALUATE(DateVar,Variant); FieldRef.Value(DateVar); I suggest to build a CASE structure which checks of what type the actual FieldRef is and to convert the variant to a matching variable to keep the code flexible. Alex


Originally posted by AK EVALUATE(DateVar,Variant); FieldRef.Value(DateVar);

but date isn’t the same as dateformula, isn’t it?

I meant DateVar to be of the type DateFormula, not of type Date. Sorry for being unclear. Alex