Is Lotus script better to increase value of several fields by certain percentage?

I have 4 fields, Year1, Year2, Year 3, Year 4, after entering values in Year 1, User than just click a button, a dialog box will pop up, asking, what percentage I want to use? (with default value is 3%), user once click okay, another dialogue box will pop up, asking which field should it be affected, user can click all fields, (which will than check all Y2 to Y4 fields) or he can just select any of Y2,Y3,Y4. Than, system will get value from Year 1, times with 1+3%m than input value into Year 2, thank, will get Year 2 values, time with 1 + 3%, etc. I am not an expert in script, was looking at using @function formula, but I think it may be too messy?

I am currently using in client environment, any helps are appreciated.

Subject: Is Lotus script better to increase value of several fields by certain percentage?

If I understand correctly what you want to do you should be able to use something like this:

Function addThreePercent(yearFieldValue as double) as double

’ Function takes a double value and returns the value with an additional 3 percent

addThreePercent = yearFieldValue * 1.03 ’ decimal equivalent of 3 percent

End Function

You can then use this function repeatedly like this:

dim tempDouble1, tempDouble2 as Double

tempDouble1 = addThreePercent(CDbl(document.fieldA(0)))

tempDouble2 = addThreePercent(CDbl(document.fieldb(0)))

HTH

Shawn

Subject: RE: Is Lotus script better to increase value of several fields by certain percentage?

Tqvm, appreciates that, would you happen to have any formula for the dialog box as mentioned by me earlier? I am not such an expert in that area.

tqvm.

Subject: RE: Is Lotus script better to increase value of several fields by certain percentage?

look in development help for @dialogbox

Shawn