Simple question: @setfield

This is really basic, but since I don’t know the actual differences and uses, I figured I would ask. What is the difference between:

@setfield(“FieldName”;“Info To Update it to”)

and

FIELD FieldName:=";“Info To Update it to”;

When would you use one of these over the other?

Thanks All,

Teri

Subject: simple question: @setfield

Basically theres not much difference (incidentally theres a bug in this line:FIELD FieldName:=";“Info To Update it to”;

should be

FIELD FieldName:=“Info To Update it to”;

If I was coding a simple agent, that didn’t do much except set a few fields, I would use FIELD FieldName:= .

If I was doing code that needed to do other stuff first (for example, send emails, display prompts etc etc, I would use @SetField.

One reason this is is that ‘sometimes’ notes complains (or possibly used to complain) if you use the := construct half way down formula language…these statements as I understood it, had to be at the start of formula code.

@Setfield does not suffer from this disadvantage.

If you are really setting a lot of fields, I tend to prefer @Setfield, because I think it makes the code look clearer, but thats just personal preference really…

Subject: RE: simple question: @setfield

Thanks,

I thought it was that simple, but couldn’t convince myself. I have been using the @setfield method mostly so that I have a consistent look, but thought if the other method helped with performance or anything else that I could start using it more often.

Oh, I saw that “bug” copy and paste problem just after I hit the Post button.

thanks again for the time to explain.

Teri

Subject: One reason is you can use @setfield in other formulas

You could use an @setfield in other formulas like @if. But, you can not use the Field statement in the @if.

Note that this limitation (using FIELD in a formula) went away starting with ND6…

Howard