>What error do you get? VFP calls UDF one extra time at the beginning to determine field size. It may use either the first record in the table or empty record. You shoud account for that in UDF code.
Ok, if it calls the function at first to check field size, then, the initialization is needed as no parameter would be passed from our selected records.