"formulafill" problem in Procedure?

I am trying to get a Procedure to run. I suspect the problem is with “formulafill”

In the Procedure below I get the error message:

“Total Fee does not exist in database RMD Pan X template” (“RMD Pan X template” is the name of the database). Well, “Total Fee” is a field that should be created by the Procedure below. The Procedure below adds the field.

When I take out the line
“formulafill “PV”*.015"
(right above addfield “Total Fee”) then the Procedure runs.

Except when I get to the last line in the Procedure:

formulafill “Total Fee”-“Cash”

I get an error message:
“Cannot subtract a number from text”

even though the Field types are Numbers (Float)by the procedure.

Any suggestions anyone? Thanks

Here is the Procedure:

addfield “PV”
Field “PV”
fieldtype “float”
addfield “1 yr Fee”
Field “1 yr Fee”
fieldtype “float”
formulafill “PV"*.015
addfield “Total Fee”
Field “Total Fee”
fieldtype “float”
formulafill «RMD Current Year»+“1 yr Fee”
addfield “Cash”
Field “Cash”
fieldtype “float”
addfield “SELL”
Field “SELL”
fieldtype “float”
formulafill “Total Fee”-“Cash”

You need to remove the quotes from around “PV”. With the quotes, you are trying to multiply the name of the field by .015. Without them, you are multiplying the content of the field by .015. The name is text, the content is a floating point number.

formulafill “Total Fee”-“Cash”

should be

formulafill «Total Fee»-Cash

The «» chevrons are necessary, because of the space in the field name.

Do I remove quotes from everything and use chevrons instead? Sorry for my ignorance. Thanks

For simple names such as PV they’re not necessary. When you add spaces or punctuation to the name, the chevrons are needed. So it’s never unsafe to put them around a field name.

For me it encourages simple names and camel case such as TotalFee in order to cut down the need for chevrons or other special treatment.

Here are a couple of help page that you may find helpful.

Your example is called upper camel case while I prefer lower camel case as in “totalFee”. I guess just because this looks more like a camel’s hump. :dromedary_camel: